Package org.apache.calcite.adapter.druid
Class DruidJsonFilter
- java.lang.Object
-
- org.apache.calcite.adapter.druid.DruidJsonFilter
-
- All Implemented Interfaces:
DruidJson
- Direct Known Subclasses:
DruidJsonFilter.JsonBound
,DruidJsonFilter.JsonCompositeFilter
,DruidJsonFilter.JsonExpressionFilter
,DruidJsonFilter.JsonInFilter
,DruidJsonFilter.JsonSelector
abstract class DruidJsonFilter extends java.lang.Object implements DruidJson
Filter element of a Druid "groupBy" or "topN" query.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
DruidJsonFilter.JsonBound
Bound filter.private static class
DruidJsonFilter.JsonCompositeFilter
Filter that combines other filters using a boolean operator.protected static class
DruidJsonFilter.JsonDimHavingFilter
Druid Having Filter specstatic class
DruidJsonFilter.JsonExpressionFilter
Druid Expression filter.protected static class
DruidJsonFilter.JsonInFilter
IN filter.private static class
DruidJsonFilter.JsonSelector
Equality filter.protected static class
DruidJsonFilter.Type
Supported filter types
-
Field Summary
Fields Modifier and Type Field Description private static java.text.SimpleDateFormat
DATE_FORMATTER
protected DruidJsonFilter.Type
type
-
Constructor Summary
Constructors Modifier Constructor Description private
DruidJsonFilter(DruidJsonFilter.Type type)
-
Method Summary
-
-
-
Field Detail
-
DATE_FORMATTER
private static final java.text.SimpleDateFormat DATE_FORMATTER
-
type
protected final DruidJsonFilter.Type type
-
-
Constructor Detail
-
DruidJsonFilter
private DruidJsonFilter(DruidJsonFilter.Type type)
-
-
Method Detail
-
toEqualityKindDruidFilter
@Nullable private static DruidJsonFilter toEqualityKindDruidFilter(RexNode rexNode, RelDataType rowType, DruidQuery druidQuery)
- Parameters:
rexNode
- rexNode to translate to Druid Json FilterrowType
- rowType associated to rexNodedruidQuery
- druid query- Returns:
- Druid Json filter or null if it can not translate
-
toBoundDruidFilter
@Nullable private static DruidJsonFilter toBoundDruidFilter(RexNode rexNode, RelDataType rowType, DruidQuery druidQuery)
- Parameters:
rexNode
- rexNode to translaterowType
- row type associated to FilterdruidQuery
- druid query- Returns:
- valid Druid Json Bound Filter or null if it can not translate the rexNode.
-
toDruidLiteral
@Nullable private static java.lang.String toDruidLiteral(RexNode rexNode, RelDataType rowType, DruidQuery druidQuery)
- Parameters:
rexNode
- rexNode to translate to Druid literal equivalanterowType
- rowType associated to rexNodedruidQuery
- druid Query- Returns:
- non null string or null if it can not translate to valid Druid equivalent
-
toIsNullKindDruidFilter
@Nullable private static DruidJsonFilter toIsNullKindDruidFilter(RexNode rexNode, RelDataType rowType, DruidQuery druidQuery)
-
toInKindDruidFilter
@Nullable private static DruidJsonFilter toInKindDruidFilter(RexNode e, RelDataType rowType, DruidQuery druidQuery)
-
toNotDruidFilter
@Nullable protected static DruidJsonFilter toNotDruidFilter(DruidJsonFilter druidJsonFilter)
-
toBetweenDruidFilter
@Nullable private static DruidJsonFilter toBetweenDruidFilter(RexNode rexNode, RelDataType rowType, DruidQuery query)
-
toSimpleDruidFilter
@Nullable private static DruidJsonFilter toSimpleDruidFilter(RexNode e, RelDataType rowType, DruidQuery druidQuery)
-
toDruidFilters
@Nullable static DruidJsonFilter toDruidFilters(RexNode rexNode, RelDataType rowType, DruidQuery druidQuery)
- Parameters:
rexNode
- rexNode to translate to Druid FilterrowType
- rowType of filter inputdruidQuery
- Druid query- Returns:
- Druid Json Filters or null when can not translate to valid Druid Filters.
-
toDruidExpressionFilter
@Nullable private static DruidJsonFilter toDruidExpressionFilter(RexNode rexNode, RelDataType rowType, DruidQuery query)
-
getSelectorFilter
public static DruidJsonFilter getSelectorFilter(java.lang.String column, java.lang.String value, ExtractionFunction extractionFunction)
-
getDateFormatter
private static java.text.SimpleDateFormat getDateFormatter()
-
-