Class AlterTableNode

  • All Implemented Interfaces:
    Visitable

    class AlterTableNode
    extends DDLStatementNode
    A AlterTableNode represents a DDL statement that alters a table. It contains the name of the object to be created.
    • Field Detail

      • lockGranularity

        char lockGranularity
      • updateStatistics

        private boolean updateStatistics
        updateStatistics will indicate that we are here for updating the statistics. It could be statistics of just one index or all the indexes on a given table.
      • updateStatisticsAll

        private boolean updateStatisticsAll
        The flag updateStatisticsAll will tell if we are going to update the statistics of all indexes or just one index on a table.
      • dropStatistics

        private boolean dropStatistics
        dropStatistics will indicate that we are here for dropping the statistics. It could be statistics of just one index or all the indexes on a given table.
      • dropStatisticsAll

        private boolean dropStatisticsAll
        The flag dropStatisticsAll will tell if we are going to drop the statistics of all indexes or just one index on a table.
      • indexNameForStatistics

        private java.lang.String indexNameForStatistics
        If statistic is getting updated/dropped for just one index, then indexNameForStatistics will tell the name of the specific index whose statistics need to be updated/dropped.
      • compressTable

        public boolean compressTable
      • sequential

        public boolean sequential
      • purge

        public boolean purge
      • defragment

        public boolean defragment
      • truncateEndOfTable

        public boolean truncateEndOfTable
      • behavior

        public int behavior
      • numConstraints

        protected int numConstraints
      • changeType

        private int changeType
      • truncateTable

        private boolean truncateTable
    • Constructor Detail

      • AlterTableNode

        AlterTableNode​(TableName tableName,
                       boolean sequential,
                       ContextManager cm)
                throws StandardException
        Constructor for COMPRESS using temporary tables rather than in place compress
        Parameters:
        tableName - The name of the table being altered
        sequential - Whether or not the COMPRESS is SEQUENTIAL
        cm - Context manager
        Throws:
        StandardException - Thrown on error
      • AlterTableNode

        AlterTableNode​(TableName tableName,
                       boolean purge,
                       boolean defragment,
                       boolean truncateEndOfTable,
                       ContextManager cm)
                throws StandardException
        Constructor for INPLACE COMPRESS
        Parameters:
        tableName - The name of the table being altered
        purge - PURGE during INPLACE COMPRESS?
        defragment - DEFRAGMENT during INPLACE COMPRESS?
        truncateEndOfTable - TRUNCATE END during INPLACE COMPRESS?
        cm - Context manager
        Throws:
        StandardException - Thrown on error
      • AlterTableNode

        AlterTableNode​(TableName tableName,
                       int changeType,
                       boolean statsAll,
                       java.lang.String indexName,
                       ContextManager cm)
                throws StandardException
        Constructor for UPDATE_STATISTICS or DROP_STATISTICS
        Parameters:
        tableName - The name of the table being altered
        changeType - update or drop statistics
        statsAll - true means update or drop the statistics of all the indexes on the table. false means update or drop the statistics of only the index name provided by next parameter.
        indexName - Name of the index for which statistics is to be updated or dropped
        cm - Context manager
        Throws:
        StandardException
      • AlterTableNode

        AlterTableNode​(TableName tableName,
                       int changeType,
                       TableElementList impactedElements,
                       char lockGranularity,
                       int behavior,
                       ContextManager cm)
                throws StandardException
        Constructor for ADD_TYPE, DROP_TYPE, MODIFY_TYPE and LOCK_TYPE
        Parameters:
        tableName - The name of the table being altered
        changeType - add, drop, modify or lock
        impactedElements - list of table elements impacted
        lockGranularity - lock granularity encoded in a single character
        behavior - cascade or restrict (for DROP_TYPE)
        cm - Context Manager
        Throws:
        StandardException
    • Method Detail

      • 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
      • getChangeType

        public int getChangeType()
      • bindStatement

        public void bindStatement()
                           throws StandardException
        Bind this AlterTableNode. This means doing any static error checking that can be done before actually creating the table. For example, verifying that the user is not trying to add a non-nullable column.
        Overrides:
        bindStatement in class StatementNode
        Throws:
        StandardException - Thrown on error
      • prepConstantAction

        private void prepConstantAction()
                                 throws StandardException
        Generate arguments to constant action. Called by makeConstantAction() in this class and in our subclass RepAlterTableNode.
        Throws:
        StandardException - Thrown on failure
      • genColumnInfo

        public void genColumnInfo()
                           throws StandardException
        Generate the ColumnInfo argument for the constant action. Return the number of constraints.
        Throws:
        StandardException