Package org.apache.iotdb.db.qp.utils
Class GroupByLevelController
- java.lang.Object
-
- org.apache.iotdb.db.qp.utils.GroupByLevelController
-
public class GroupByLevelController extends java.lang.ObjectThis class is used to control the row number of group by level query. For example, selected series[root.sg.d1.s1, root.sg.d2.s1, root.sg2.d1.s1], level = 1; the result rows will be [root.sg.*.s1, root.sg2.*.s1], sLimit and sOffset will be used to control the result numbers rather than the selected series.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringALIAS_ERROR_MESSAGE1static java.lang.StringALIAS_ERROR_MESSAGE2
-
Constructor Summary
Constructors Constructor Description GroupByLevelController(int seriesLimit, int[] levels)GroupByLevelController(QueryOperator operator)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcontrol(ResultColumn rawColumn, java.util.List<ResultColumn> resultColumns)static GroupByLevelControllerdeserialize(java.nio.ByteBuffer byteBuffer)java.lang.StringgeneratePartialPathByLevel(boolean isCountStar, org.apache.iotdb.commons.path.PartialPath rawPath, int[] pathLevels)Transform an originalPath to a partial path that satisfies given level.java.lang.StringgetAlias(java.lang.String originName)java.lang.StringgetGroupedPath(java.lang.String rawPath)voidserialize(java.nio.ByteBuffer byteBuffer)
-
-
-
Constructor Detail
-
GroupByLevelController
public GroupByLevelController(int seriesLimit, int[] levels)
-
GroupByLevelController
public GroupByLevelController(QueryOperator operator)
-
-
Method Detail
-
getGroupedPath
public java.lang.String getGroupedPath(java.lang.String rawPath)
-
getAlias
public java.lang.String getAlias(java.lang.String originName)
-
control
public void control(ResultColumn rawColumn, java.util.List<ResultColumn> resultColumns) throws LogicalOptimizeException
- Throws:
LogicalOptimizeException
-
generatePartialPathByLevel
public java.lang.String generatePartialPathByLevel(boolean isCountStar, org.apache.iotdb.commons.path.PartialPath rawPath, int[] pathLevels)Transform an originalPath to a partial path that satisfies given level. Path nodes don't satisfy the given level will be replaced by "*" except the sensor level, e.g. generatePartialPathByLevel("root.sg.dh.d1.s1", 2) will return "root.*.dh.*.s1".Especially, if count(*), then the sensor level will be replaced by "*" too.
- Returns:
- result partial path
-
serialize
public void serialize(java.nio.ByteBuffer byteBuffer)
-
deserialize
public static GroupByLevelController deserialize(java.nio.ByteBuffer byteBuffer)
-
-