Class CreateTableNode

  • All Implemented Interfaces:
    Visitable

    class CreateTableNode
    extends DDLStatementNode
    A CreateTableNode is the root of a QueryTree that represents a CREATE TABLE or DECLARE GLOBAL TEMPORARY TABLE statement.
    • Field Detail

      • lockGranularity

        private char lockGranularity
      • onCommitDeleteRows

        private boolean onCommitDeleteRows
      • onRollbackDeleteRows

        private boolean onRollbackDeleteRows
      • properties

        private java.util.Properties properties
      • tableType

        protected int tableType
    • Constructor Detail

      • CreateTableNode

        CreateTableNode​(TableName tableName,
                        TableElementList tableElementList,
                        java.util.Properties properties,
                        char lockGranularity,
                        ContextManager cm)
                 throws StandardException
        Constructor for a CreateTableNode for a base table
        Parameters:
        tableName - The name of the new object being created (ie base table)
        tableElementList - The elements of the table: columns, constraints, etc.
        properties - The optional list of properties associated with the table.
        lockGranularity - The lock granularity.
        cm - The context manager
        Throws:
        StandardException - Thrown on error
      • CreateTableNode

        CreateTableNode​(TableName tableName,
                        TableElementList tableElementList,
                        java.util.Properties properties,
                        boolean onCommitDeleteRows,
                        boolean onRollbackDeleteRows,
                        ContextManager cm)
                 throws StandardException
        Constructor for a CreateTableNode for a global temporary table
        Parameters:
        tableName - The name of the new object being declared (ie temporary table)
        tableElementList - The elements of the table: columns, constraints, etc.
        properties - The optional list of properties associated with the table.
        onCommitDeleteRows - If true, on commit delete rows else on commit preserve rows of temporary table.
        onRollbackDeleteRows - If true, on rollback, delete rows from temp tables which were logically modified. true is the only supported value
        Throws:
        StandardException - Thrown on error
      • CreateTableNode

        CreateTableNode​(TableName tableName,
                        ResultColumnList resultColumns,
                        ResultSetNode queryExpression,
                        ContextManager cm)
                 throws StandardException
        Constructor for a CreateTableNode for a base table create from a query
        Parameters:
        tableName - The name of the new object being created (ie base table).
        resultColumns - The optional column list.
        queryExpression - The query expression for the table.
        cm - The context manager
        Throws:
        StandardException
    • Method Detail

      • tempTableSchemaNameCheck

        private static TableName tempTableSchemaNameCheck​(TableName tableName)
                                                   throws StandardException
        If no schema name specified for global temporary table, SESSION is the implicit schema. Otherwise, make sure the specified schema name for global temporary table is SESSION.
        Parameters:
        tableName - The name of the new object being declared (ie temporary table)
        Throws:
        StandardException
      • toString

        public java.lang.String toString()
        Convert this object to a String. See comments in QueryTreeNode.java for how this should be done for tree printing.
        Overrides:
        toString in class DDLStatementNode
        Returns:
        This object as a String
      • printSubNodes

        void printSubNodes​(int depth)
        Prints the sub-nodes of this object. See QueryTreeNode.java for how tree printing is supposed to work.
        Overrides:
        printSubNodes in class QueryTreeNode
        Parameters:
        depth - The depth to indent the sub-nodes
      • bindStatement

        public void bindStatement()
                           throws StandardException
        Bind this CreateTableNode. This means doing any static error checking that can be done before actually creating the base table or declaring the global temporary table. For eg, verifying that the TableElementList does not contain any duplicate column names.
        Overrides:
        bindStatement in class StatementNode
        Throws:
        StandardException - Thrown on error