Class FilterOperator
- java.lang.Object
-
- org.apache.iotdb.db.qp.logical.crud.FilterOperator
-
- All Implemented Interfaces:
java.lang.Comparable<FilterOperator>
- Direct Known Subclasses:
FunctionOperator
public class FilterOperator extends java.lang.Object implements java.lang.Comparable<FilterOperator>
This class is for filter in where clause. It may consist of more than two child FilterOperators, but if it's not a leaf operator, 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 FilterOperator()FilterOperator(FilterConstant.FilterType filterType)FilterOperator(FilterConstant.FilterType filterType, boolean isSingle)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChildOperator(FilterOperator op)intcompareTo(FilterOperator fil)a filter with null path is no smaller than any other filter.FilterOperatorcopy()booleanequals(java.lang.Object fil)java.util.List<FilterOperator>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()voidsetChildren(java.util.List<FilterOperator> 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
-
FilterOperator
public FilterOperator()
-
FilterOperator
public FilterOperator(FilterConstant.FilterType filterType)
-
FilterOperator
public FilterOperator(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<FilterOperator> getChildren()
-
setChildren
public void setChildren(java.util.List<FilterOperator> 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(FilterOperator 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 QueryProcessExceptionFor a filter operator, if isSingle, call transformToSingleQueryFilter.
FilterOperator cannot be leaf.- Parameters:
pathTSDataTypeHashMap-- Returns:
- QueryFilter in TsFile
- Throws:
QueryProcessException
-
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 LogicalOperatorException, 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 transformingLogicalOperatorException
-
compareTo
public int compareTo(FilterOperator fil)
a filter with null path is no smaller than any other filter.- Specified by:
compareToin interfacejava.lang.Comparable<FilterOperator>
-
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 FilterOperator copy()
-
-