Class DruidSqlInsert
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.DruidSqlInsert
- All Implemented Interfaces:
Cloneable
Extends the 'insert' call to hold custom parameters specific to Druid i.e. PARTITIONED BY and CLUSTERED BY
This class extends the
DruidSqlIngest 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 Stringstatic 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
ConstructorsConstructorDescriptionDruidSqlInsert(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) 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 DruidSqlInsertcreate(org.apache.calcite.sql.SqlInsert insertNode, SqlGranularityLiteral partitionedBy, org.apache.calcite.sql.SqlNodeList clusteredBy, org.apache.calcite.sql.SqlIdentifier exportFileFormat) org.apache.calcite.sql.SqlOperatorvoidunparse(org.apache.calcite.sql.SqlWriter writer, int leftPrec, int rightPrec) Methods inherited from class org.apache.druid.sql.calcite.parser.DruidSqlIngest
getClusteredBy, getExportFileFormat, getOperandList, 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_INSERT_SEGMENT_GRANULARITY
- See Also:
-
SQL_INSERT_QUERY_GRANULARITY
- See Also:
-
OPERATOR
public static final org.apache.calcite.sql.SqlOperator OPERATOR
-
-
Constructor Details
-
DruidSqlInsert
public DruidSqlInsert(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) 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 DruidSqlInsert 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) -
getOperator
@Nonnull public org.apache.calcite.sql.SqlOperator getOperator()- Overrides:
getOperatorin classorg.apache.calcite.sql.SqlInsert
-
unparse
public void unparse(org.apache.calcite.sql.SqlWriter writer, int leftPrec, int rightPrec) - Overrides:
unparsein classorg.apache.calcite.sql.SqlInsert
-