Class DruidSqlReplace
java.lang.Object
org.apache.calcite.sql.SqlNode
org.apache.calcite.sql.SqlCall
org.apache.calcite.sql.SqlInsert
org.apache.druid.sql.calcite.parser.DruidSqlIngest
org.apache.druid.sql.calcite.parser.DruidSqlReplace
- All Implemented Interfaces:
Cloneable
Extends the 'replace' call to hold custom parameters specific to Druid i.e. PARTITIONED BY and the PARTITION SPECS
This class extends the
SqlInsert so that this SqlNode can be used in
SqlToRelConverter for getting converted into RelNode, and further processing-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.calcite.sql.SqlOperatorstatic final StringFields inherited from class org.apache.druid.sql.calcite.parser.DruidSqlIngest
clusteredBy, partitionedBy, SQL_EXPORT_FILE_FORMATFields inherited from class org.apache.calcite.sql.SqlNode
EMPTY_ARRAY, pos -
Constructor Summary
ConstructorsConstructorDescriptionDruidSqlReplace(org.apache.calcite.sql.parser.SqlParserPos pos, org.apache.calcite.sql.SqlNodeList keywords, org.apache.calcite.sql.SqlNode targetTable, org.apache.calcite.sql.SqlNode source, org.apache.calcite.sql.SqlNodeList columnList, SqlGranularityLiteral partitionedBy, org.apache.calcite.sql.SqlNodeList clusteredBy, org.apache.calcite.sql.SqlIdentifier exportFileFormat, org.apache.calcite.sql.SqlNode replaceTimeQuery) While partitionedBy can be null as arguments to the constructor, this is disallowed (semantically) andIngestHandler.validate()performs checks to ensure that. -
Method Summary
Modifier and TypeMethodDescriptionstatic DruidSqlReplacecreate(org.apache.calcite.sql.SqlInsert insertNode, SqlGranularityLiteral partitionedBy, org.apache.calcite.sql.SqlNodeList clusteredBy, org.apache.calcite.sql.SqlIdentifier exportFileFormat, org.apache.calcite.sql.SqlNode replaceTimeQuery) List<org.apache.calcite.sql.SqlNode>org.apache.calcite.sql.SqlOperatororg.apache.calcite.sql.SqlNodevoidunparse(org.apache.calcite.sql.SqlWriter writer, int leftPrec, int rightPrec) Methods inherited from class org.apache.druid.sql.calcite.parser.DruidSqlIngest
getClusteredBy, getExportFileFormat, getPartitionedByMethods inherited from class org.apache.calcite.sql.SqlInsert
getKind, getModifierNode, getSource, getTargetColumnList, getTargetTable, isUpsert, setOperand, setSource, validateMethods inherited from class org.apache.calcite.sql.SqlCall
accept, clone, equalsDeep, findValidOptions, getCallSignature, getFunctionQuantifier, getMonotonicity, isCountStar, isExpanded, operand, operandCountMethods inherited from class org.apache.calcite.sql.SqlNode
clone, clone, cloneArray, equalDeep, equalDeep, equalsDeep, getParserPosition, isA, toList, toList, toSqlString, toSqlString, toSqlString, toString, unparseWithParentheses, validateExpr
-
Field Details
-
SQL_REPLACE_TIME_CHUNKS
- See Also:
-
OPERATOR
public static final org.apache.calcite.sql.SqlOperator OPERATOR
-
-
Constructor Details
-
DruidSqlReplace
public DruidSqlReplace(org.apache.calcite.sql.parser.SqlParserPos pos, org.apache.calcite.sql.SqlNodeList keywords, org.apache.calcite.sql.SqlNode targetTable, org.apache.calcite.sql.SqlNode source, org.apache.calcite.sql.SqlNodeList columnList, @Nullable SqlGranularityLiteral partitionedBy, @Nullable org.apache.calcite.sql.SqlNodeList clusteredBy, @Nullable org.apache.calcite.sql.SqlIdentifier exportFileFormat, @Nullable org.apache.calcite.sql.SqlNode replaceTimeQuery) While partitionedBy can be null as arguments to the constructor, this is disallowed (semantically) andIngestHandler.validate()performs checks to ensure that. This helps in producing friendly errors when the PARTITIONED BY custom clause is not present, and keeps its error separate from JavaCC/Calcite's custom errors which can be cryptic when someone accidentally forgets to explicitly specify the PARTITIONED BY clause
-
-
Method Details
-
create
public static DruidSqlReplace create(@Nonnull org.apache.calcite.sql.SqlInsert insertNode, @Nullable SqlGranularityLiteral partitionedBy, @Nullable org.apache.calcite.sql.SqlNodeList clusteredBy, @Nullable org.apache.calcite.sql.SqlIdentifier exportFileFormat, @Nullable org.apache.calcite.sql.SqlNode replaceTimeQuery) -
getReplaceTimeQuery
public org.apache.calcite.sql.SqlNode getReplaceTimeQuery() -
getOperator
@Nonnull public org.apache.calcite.sql.SqlOperator getOperator()- Overrides:
getOperatorin classorg.apache.calcite.sql.SqlInsert
-
getOperandList
- Overrides:
getOperandListin classDruidSqlIngest
-
unparse
public void unparse(org.apache.calcite.sql.SqlWriter writer, int leftPrec, int rightPrec) - Overrides:
unparsein classorg.apache.calcite.sql.SqlInsert
-