Class QueryFilter
- java.lang.Object
-
- org.apache.iotdb.db.mpp.common.filter.QueryFilter
-
- All Implemented Interfaces:
java.lang.Comparable<QueryFilter>
- Direct Known Subclasses:
FunctionFilter
public class QueryFilter extends java.lang.Object implements java.lang.Comparable<QueryFilter>
This class is for filter in where clause. It may consist of more than two child filters, but if it's not a leaf filter, the relation is the same among all of its children (AND or OR), which is identified by tokenType.
-
-
Field Summary
Fields Modifier and Type Field Description protected FilterConstant.FilterTypefilterTypeprotected booleanisLeaf
-
Constructor Summary
Constructors Constructor Description QueryFilter()QueryFilter(FilterConstant.FilterType filterType)QueryFilter(FilterConstant.FilterType filterType, boolean isSingle)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChildOperator(QueryFilter op)intcompareTo(QueryFilter fil)a filter with null path is no smaller than any other filter.QueryFiltercopy()static QueryFilterdeserialize(java.nio.ByteBuffer byteBuffer)booleanequals(java.lang.Object fil)java.util.List<QueryFilter>getChildren()java.lang.StringgetFilterName()java.lang.StringgetFilterSymbol()FilterConstant.FilterTypegetFilterType()java.util.Set<org.apache.iotdb.commons.path.PartialPath>getPathSet()org.apache.iotdb.commons.path.PartialPathgetSinglePath()inthashCode()booleanisLeaf()booleanisSingle()voidserialize(java.nio.ByteBuffer byteBuffer)protected voidserializeWithoutType(java.nio.ByteBuffer byteBuffer)voidsetChildren(java.util.List<QueryFilter> children)voidsetFilterType(FilterConstant.FilterType filterType)voidsetIsSingle(boolean b)voidsetPathSet(java.util.Set<org.apache.iotdb.commons.path.PartialPath> pathSet)voidsetSinglePath(org.apache.iotdb.commons.path.PartialPath singlePath)java.lang.StringshowTree()java.lang.StringshowTree(int spaceNum)java.lang.StringtoString()org.apache.iotdb.tsfile.read.expression.IExpressiontransformToExpression(java.util.Map<org.apache.iotdb.commons.path.PartialPath,org.apache.iotdb.tsfile.file.metadata.enums.TSDataType> pathTSDataTypeHashMap)For a filter operator, if isSingle, call transformToSingleQueryFilter.
FilterOperator cannot be leaf.protected org.apache.iotdb.tsfile.utils.Pair<org.apache.iotdb.tsfile.read.expression.IUnaryExpression,java.lang.String>transformToSingleQueryFilter(java.util.Map<org.apache.iotdb.commons.path.PartialPath,org.apache.iotdb.tsfile.file.metadata.enums.TSDataType> pathTSDataTypeHashMap)it will be used in BasicFunction Operator.
-
-
-
Field Detail
-
filterType
protected FilterConstant.FilterType filterType
-
isLeaf
protected boolean isLeaf
-
-
Constructor Detail
-
QueryFilter
public QueryFilter()
-
QueryFilter
public QueryFilter(FilterConstant.FilterType filterType)
-
QueryFilter
public QueryFilter(FilterConstant.FilterType filterType, boolean isSingle)
-
-
Method Detail
-
getFilterType
public FilterConstant.FilterType getFilterType()
-
setFilterType
public void setFilterType(FilterConstant.FilterType filterType)
-
getFilterName
public java.lang.String getFilterName()
-
getFilterSymbol
public java.lang.String getFilterSymbol()
-
getChildren
public java.util.List<QueryFilter> getChildren()
-
setChildren
public void setChildren(java.util.List<QueryFilter> children)
-
setIsSingle
public void setIsSingle(boolean b)
-
getSinglePath
public org.apache.iotdb.commons.path.PartialPath getSinglePath()
-
setSinglePath
public void setSinglePath(org.apache.iotdb.commons.path.PartialPath singlePath)
-
addChildOperator
public void addChildOperator(QueryFilter op)
-
setPathSet
public void setPathSet(java.util.Set<org.apache.iotdb.commons.path.PartialPath> pathSet)
-
getPathSet
public java.util.Set<org.apache.iotdb.commons.path.PartialPath> getPathSet()
-
transformToExpression
public org.apache.iotdb.tsfile.read.expression.IExpression transformToExpression(java.util.Map<org.apache.iotdb.commons.path.PartialPath,org.apache.iotdb.tsfile.file.metadata.enums.TSDataType> pathTSDataTypeHashMap) throws StatementAnalyzeExceptionFor a filter operator, if isSingle, call transformToSingleQueryFilter.
FilterOperator cannot be leaf.- Parameters:
pathTSDataTypeHashMap-- Returns:
- QueryFilter in TsFile
- Throws:
StatementAnalyzeException
-
transformToSingleQueryFilter
protected org.apache.iotdb.tsfile.utils.Pair<org.apache.iotdb.tsfile.read.expression.IUnaryExpression,java.lang.String> transformToSingleQueryFilter(java.util.Map<org.apache.iotdb.commons.path.PartialPath,org.apache.iotdb.tsfile.file.metadata.enums.TSDataType> pathTSDataTypeHashMap) throws StatementAnalyzeException, org.apache.iotdb.commons.exception.MetadataExceptionit will be used in BasicFunction Operator.- Parameters:
pathTSDataTypeHashMap-- Returns:
- - pair.left: UnaryQueryFilter constructed by its one child; pair.right: Path represented by this child.
- Throws:
org.apache.iotdb.commons.exception.MetadataException- exception in filter transformingStatementAnalyzeException
-
compareTo
public int compareTo(QueryFilter fil)
a filter with null path is no smaller than any other filter.- Specified by:
compareToin interfacejava.lang.Comparable<QueryFilter>
-
equals
public boolean equals(java.lang.Object fil)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
isLeaf
public boolean isLeaf()
-
isSingle
public boolean isSingle()
-
showTree
public java.lang.String showTree()
-
showTree
public java.lang.String showTree(int spaceNum)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
copy
public QueryFilter copy()
-
serialize
public void serialize(java.nio.ByteBuffer byteBuffer)
-
serializeWithoutType
protected void serializeWithoutType(java.nio.ByteBuffer byteBuffer)
-
deserialize
public static QueryFilter deserialize(java.nio.ByteBuffer byteBuffer)
-
-