Class GroupSymbol

  • All Implemented Interfaces:
    Cloneable, Comparable<GroupSymbol>, LanguageObject

    public class GroupSymbol
    extends Symbol
    implements Comparable<GroupSymbol>

    This is the server's representation of a metadata group symbol. The group symbol has a name, an optional definition, and a reference to a real metadata ID. Typically, a GroupSymbol will be created only from a name and possibly a definition if the group has an alias. The metadata ID is discovered only when resolving the query.

    For example, if the original string contained a FROM clause such as "FROM Group1 AS G, Group2", there would be two GroupSymbols created. The first would have name=G, definition=Group1 and the second would have name=Group2, definition=null.

    • Constructor Detail

      • GroupSymbol

        public GroupSymbol​(String name)
        Construct a symbol with a name.
        name - Name of the symbol
        IllegalArgumentException - If name is null
      • GroupSymbol

        public GroupSymbol​(String name,
                           String definition)
        Construct a symbol with a name.
        name - Name of the symbol
        definition - Definition of the symbol, may be null
        IllegalArgumentException - If name is null
    • Method Detail

      • getModelMetadataId

        public Object getModelMetadataId()
      • getNonCorrelationName

        public String getNonCorrelationName()
      • getDefinition

        public String getDefinition()
        Get the definition for the group symbol, which may be null
        Group definition, may be null
      • setDefinition

        public void setDefinition​(String definition)
        Set the definition for the group symbol, which may be null
        definition - Definition
      • getMetadataID

        public Object getMetadataID()
        Get the metadata ID that this group symbol resolves to. If the group symbol has not been resolved yet, this will be null. If the symbol has been resolved, this will never be null.
        Metadata ID object
      • acceptVisitor

        public void acceptVisitor​(LanguageVisitor visitor)
        Description copied from interface: LanguageObject
        Method for accepting a visitor. It is the responsibility of the language object to call back on the visitor.
        Specified by:
        acceptVisitor in interface LanguageObject
        visitor - Visitor being used
      • setMetadataID

        public void setMetadataID​(Object metadataID)
        Set the metadata ID that this group symbol resolves to. It cannot be null.
        metadataID - Metadata ID object
        IllegalArgumentException - If metadataID is null
      • isResolved

        public boolean isResolved()
        Returns true if this symbol has been completely resolved with respect to actual runtime metadata. A resolved symbol has been validated that it refers to actual metadata and will have references to the real metadata IDs if necessary. Different types of symbols determine their resolution in different ways, so this method is abstract and must be implemented by subclasses.
        True if resolved with runtime metadata
      • isTempGroupSymbol

        public boolean isTempGroupSymbol()
        Returns true if this is a symbol for a temporary (implicit or explicit) group May return false for explicit temp tables prior to resolving. see isTempTable()
      • isImplicitTempGroupSymbol

        public boolean isImplicitTempGroupSymbol()
      • compareTo

        public int compareTo​(GroupSymbol o)
        Compare two groups and give an ordering.
        Specified by:
        compareTo in interface Comparable<GroupSymbol>
        o - Other group
        -1, 0, or 1 depending on how this compares to group
      • equals

        public boolean equals​(Object obj)
        Compare group symbols
        equals in class Symbol
        obj - Other object to compare
        True if equivalent
      • hasAlias

        public boolean hasAlias()
      • setIsTempTable

        public void setIsTempTable​(boolean isTempTable)
      • isTempGroupName

        public static boolean isTempGroupName​(String name)
      • isTempTable

        public boolean isTempTable()
        Returns if this is a Temp Table Set after resolving.
      • isPushedCommonTable

        public boolean isPushedCommonTable()
        Returns if this is a pushed Common Table Set after resolving and initial common table planning
      • isProcedure

        public boolean isProcedure()
      • setProcedure

        public void setProcedure​(boolean isProcedure)
      • getOutputDefinition

        public String getOutputDefinition()
      • setOutputDefinition

        public void setOutputDefinition​(String outputDefinition)
      • isGlobalTable

        public boolean isGlobalTable()
      • setGlobalTable

        public void setGlobalTable​(boolean isGlobalTable)
      • getName

        public String getName()
        Description copied from class: Symbol
        Get the name of the symbol
        getName in class Symbol
        Name of the symbol, never null
      • hashCode

        public int hashCode()
        Description copied from class: Symbol
        Return a hash code for this symbol.
        hashCode in class Symbol
        Hash code
      • setCheckMatStatus

        public void setCheckMatStatus​(Object viewMatadataId)
      • getCheckMatViewStatus

        public Object getCheckMatViewStatus()