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

    OPERATOR

    Fields inherited from class org.apache.calcite.sql.SqlNode

    EMPTY_ARRAY, pos
  • Constructor Summary

    Constructors
    Constructor
    Description
    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 Summary

    Modifier and Type
    Method
    Description
    Get static partition key value pair as strings.
    org.apache.calcite.sql.SqlNodeList
     
    org.apache.calcite.sql.SqlNodeList
    Returns the table hints as list of SqlNode for current insert node.
    org.apache.calcite.sql.SqlNode
    Returns the target table identifier.
    boolean
    Returns whether the insert mode is overwrite (for whole table or for specific partitions).
    static boolean
    isUpsert(List<org.apache.calcite.sql.SqlLiteral> keywords)
     
    void
    unparse(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, validate

    Methods inherited from class org.apache.calcite.sql.SqlCall

    accept, clone, equalsDeep, findValidOptions, getCallSignature, getFunctionQuantifier, getMonotonicity, isCountStar, isExpanded, operand, operandCount

    Methods inherited from class org.apache.calcite.sql.SqlNode

    clone, clone, cloneArray, equalDeep, equalDeep, equalsDeep, getParserPosition, isA, toList, toList, toSqlString, toSqlString, toSqlString, toString, unparseWithParentheses, validateExpr

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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

      public LinkedHashMap<String,String> 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, use getStaticPartitions().

      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 of SqlNode for current insert node.
    • unparse

      public void unparse(org.apache.calcite.sql.SqlWriter writer, int leftPrec, int rightPrec)
      Overrides:
      unparse in class org.apache.calcite.sql.SqlInsert
    • isUpsert

      public static boolean isUpsert(List<org.apache.calcite.sql.SqlLiteral> keywords)
    • 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