Package org.apache.flink.sql.parser.dml
Class RichSqlInsert
java.lang.Object
org.apache.calcite.sql.SqlNode
org.apache.calcite.sql.SqlCall
org.apache.calcite.sql.SqlInsert
org.apache.flink.sql.parser.dml.RichSqlInsert
- All Implemented Interfaces:
Cloneable
public class RichSqlInsert
extends org.apache.calcite.sql.SqlInsert
A
SqlInsert that have some extension functions like partition, overwrite. *-
Field Summary
Fields inherited from class org.apache.calcite.sql.SqlInsert
OPERATORFields inherited from class org.apache.calcite.sql.SqlNode
EMPTY_ARRAY, pos -
Constructor Summary
ConstructorsConstructorDescriptionRichSqlInsert(org.apache.calcite.sql.parser.SqlParserPos pos, org.apache.calcite.sql.SqlNodeList keywords, org.apache.calcite.sql.SqlNodeList extendedKeywords, org.apache.calcite.sql.SqlNode targetTable, org.apache.calcite.sql.SqlNode source, org.apache.calcite.sql.SqlNodeList columnList, org.apache.calcite.sql.SqlNodeList staticPartitions) -
Method Summary
Modifier and TypeMethodDescriptionGet static partition key value pair as strings.org.apache.calcite.sql.SqlNodeListorg.apache.calcite.sql.SqlNodeListReturns the table hints as list ofSqlNodefor current insert node.org.apache.calcite.sql.SqlNodeReturns the target table identifier.booleanReturns whether the insert mode is overwrite (for whole table or for specific partitions).static booleanvoidunparse(org.apache.calcite.sql.SqlWriter writer, int leftPrec, int rightPrec) Methods inherited from class org.apache.calcite.sql.SqlInsert
getKind, getModifierNode, getOperandList, getOperator, 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
-
Constructor Details
-
RichSqlInsert
public RichSqlInsert(org.apache.calcite.sql.parser.SqlParserPos pos, org.apache.calcite.sql.SqlNodeList keywords, org.apache.calcite.sql.SqlNodeList extendedKeywords, org.apache.calcite.sql.SqlNode targetTable, org.apache.calcite.sql.SqlNode source, org.apache.calcite.sql.SqlNodeList columnList, org.apache.calcite.sql.SqlNodeList staticPartitions)
-
-
Method Details
-
getStaticPartitions
public org.apache.calcite.sql.SqlNodeList getStaticPartitions()- Returns:
- the list of partition key-value pairs, returns empty if there is no partition specifications.
-
getStaticPartitionKVs
Get static partition key value pair as strings.For character literals we return the unquoted and unescaped values. For other types we use
SqlNode.toString()to get the string format of the value literal. If the string format is not what you need, usegetStaticPartitions().- Returns:
- the mapping of column names to values of partition specifications, returns an empty map if there is no partition specifications.
-
getTargetTableID
public org.apache.calcite.sql.SqlNode getTargetTableID()Returns the target table identifier. -
getTableHints
public org.apache.calcite.sql.SqlNodeList getTableHints()Returns the table hints as list ofSqlNodefor current insert node. -
unparse
public void unparse(org.apache.calcite.sql.SqlWriter writer, int leftPrec, int rightPrec) - Overrides:
unparsein classorg.apache.calcite.sql.SqlInsert
-
isUpsert
-
isOverwrite
public boolean isOverwrite()Returns whether the insert mode is overwrite (for whole table or for specific partitions).- Returns:
- true if this is overwrite mode
-