Class CreateViewNode

  • All Implemented Interfaces:
    Visitable

    class CreateViewNode
    extends DDLStatementNode
    A CreateViewNode is the root of a QueryTree that represents a CREATE VIEW statement.
    • Field Detail

      • qeText

        private java.lang.String qeText
      • checkOption

        private int checkOption
      • hasJDBClimitClause

        private boolean hasJDBClimitClause
    • Constructor Detail

      • CreateViewNode

        CreateViewNode​(TableName viewName,
                       ResultColumnList resultColumns,
                       ResultSetNode queryExpression,
                       int checkOption,
                       java.lang.String qeText,
                       OrderByList orderCols,
                       ValueNode offset,
                       ValueNode fetchFirst,
                       boolean hasJDBClimitClause,
                       ContextManager cm)
                throws StandardException
        Constructor for a CreateViewNode
        Parameters:
        viewName - The name of the table to be created
        resultColumns - The column list from the view definition, if specified
        queryExpression - The query expression for the view
        checkOption - The type of WITH CHECK OPTION that was specified (NONE for now)
        qeText - The text for the queryExpression
        orderCols - ORDER BY list
        offset - OFFSET if any, or null
        fetchFirst - FETCH FIRST if any, or null
        hasJDBClimitClause - True if the offset/fetchFirst clauses come from JDBC limit/offset escape syntax
        cm - Context manager
        Throws:
        StandardException - Thrown on error
    • 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 of this node in the tree
      • bindStatement

        public void bindStatement()
                           throws StandardException
        Bind this CreateViewNode. This means doing any static error checking that can be done before actually creating the table. For example, verifying that the ResultColumnList does not contain any duplicate column names.
        Overrides:
        bindStatement in class StatementNode
        Throws:
        StandardException - Thrown on error
      • genColumnInfos

        private void genColumnInfos​(ColumnInfo[] colInfos)
        Fill in the ColumnInfo[] for this create view.
        Parameters:
        colInfos - The ColumnInfo[] to be filled in.
      • getParsedQueryExpression

        ResultSetNode getParsedQueryExpression()
        Get the parsed query expression (the SELECT statement).
        Returns:
        the parsed query expression.
      • getFetchFirst

        public ValueNode getFetchFirst()
      • hasJDBClimitClause

        public boolean hasJDBClimitClause()