Class SqlCreateTableAs

  • All Implemented Interfaces:
    Cloneable, ExtendedSqlNode

    public class SqlCreateTableAs
    extends SqlCreateTable
    SqlNode to describe the CREATE TABLE AS syntax. The CTAS would create a pipeline to compute the result of the given query and insert data into the derived table.

    Example:

    
     CREATE TABLE base_table (
         id BIGINT,
         name STRING,
         tstmp TIMESTAMP,
         PRIMARY KEY(id)
     ) WITH (
         ‘connector’ = ‘kafka’,
         ‘connector.starting-offset’: ‘12345’,
         ‘format’ =  ‘json’
     )
    
     CREATE TABLE derived_table
     WITH (
       'connector' = 'jdbc',
       'url' = 'http://localhost:10000',
       'table-name' = 'syncedTable'
     )
     AS SELECT * FROM base_table;
     
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.apache.calcite.sql.SqlSpecialOperator OPERATOR  
      • Fields inherited from class org.apache.calcite.sql.SqlCreate

        ifNotExists
      • Fields inherited from class org.apache.calcite.sql.SqlDdl

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

        EMPTY_ARRAY, pos
    • Constructor Summary

      Constructors 
      Constructor Description
      SqlCreateTableAs​(org.apache.calcite.sql.parser.SqlParserPos pos, org.apache.calcite.sql.SqlIdentifier tableName, org.apache.calcite.sql.SqlNodeList columnList, List<SqlTableConstraint> tableConstraints, org.apache.calcite.sql.SqlNodeList propertyList, org.apache.calcite.sql.SqlNodeList partitionKeyList, SqlWatermark watermark, org.apache.calcite.sql.SqlCharStringLiteral comment, org.apache.calcite.sql.SqlNode asQuery, boolean isTemporary, boolean ifNotExists)  
    • Field Detail

      • OPERATOR

        public static final org.apache.calcite.sql.SqlSpecialOperator OPERATOR
    • Constructor Detail

      • SqlCreateTableAs

        public SqlCreateTableAs​(org.apache.calcite.sql.parser.SqlParserPos pos,
                                org.apache.calcite.sql.SqlIdentifier tableName,
                                org.apache.calcite.sql.SqlNodeList columnList,
                                List<SqlTableConstraint> tableConstraints,
                                org.apache.calcite.sql.SqlNodeList propertyList,
                                org.apache.calcite.sql.SqlNodeList partitionKeyList,
                                @Nullable
                                SqlWatermark watermark,
                                @Nullable
                                org.apache.calcite.sql.SqlCharStringLiteral comment,
                                org.apache.calcite.sql.SqlNode asQuery,
                                boolean isTemporary,
                                boolean ifNotExists)