Class ListScope

    • Method Detail

      • addChild

        public void addChild​(SqlValidatorNamespace ns,
                             java.lang.String alias,
                             boolean nullable)
        Description copied from interface: SqlValidatorScope
        Registers a relation in this scope.
        Specified by:
        addChild in interface SqlValidatorScope
        Overrides:
        addChild in class DelegatingScope
        Parameters:
        ns - Namespace representing the result-columns of the relation
        alias - Alias with which to reference the relation, must not be null
        nullable - Whether this is a null-generating side of a join
      • getChildren

        public java.util.List<SqlValidatorNamespace> getChildren()
        Returns an immutable list of child namespaces.
        Returns:
        list of child namespaces
      • getChildNames

        java.util.List<java.lang.String> getChildNames()
        Returns an immutable list of child names.
        Returns:
        list of child namespaces
      • findQualifyingTableNames

        public java.util.Map<java.lang.String,​ScopeChild> findQualifyingTableNames​(java.lang.String columnName,
                                                                                         SqlNode ctx,
                                                                                         SqlNameMatcher nameMatcher)
        Description copied from interface: SqlValidatorScope
        Finds all table aliases which are implicitly qualifying an unqualified column name.

        This method is only implemented in scopes (such as SelectScope) which can be the context for name-resolution. In scopes such as IdentifierNamespace, it throws UnsupportedOperationException.

        Specified by:
        findQualifyingTableNames in interface SqlValidatorScope
        Overrides:
        findQualifyingTableNames in class DelegatingScope
        Parameters:
        columnName - Column name
        ctx - Validation context, to appear in any error thrown
        nameMatcher - Name matcher
        Returns:
        Map of applicable table alias and namespaces, never null, empty if no aliases found
      • resolve

        public void resolve​(java.util.List<java.lang.String> names,
                            SqlNameMatcher nameMatcher,
                            boolean deep,
                            SqlValidatorScope.Resolved resolved)
        Description copied from interface: SqlValidatorScope
        Looks up a node with a given name. Returns null if none is found.
        Specified by:
        resolve in interface SqlValidatorScope
        Overrides:
        resolve in class DelegatingScope
        Parameters:
        names - Name of node to find, maybe partially or fully qualified
        nameMatcher - Name matcher
        deep - Whether to look more than one level deep
        resolved - Callback wherein to write the match(es) we find
      • resolveColumn

        public RelDataType resolveColumn​(java.lang.String columnName,
                                         SqlNode ctx)
        Description copied from interface: SqlValidatorScope
        Resolves a single identifier to a column, and returns the datatype of that column.

        If it cannot find the column, returns null. If the column is ambiguous, throws an error with context ctx.

        Specified by:
        resolveColumn in interface SqlValidatorScope
        Overrides:
        resolveColumn in class DelegatingScope
        Parameters:
        columnName - Name of column
        ctx - Context for exception
        Returns:
        Type of column, if found and unambiguous; null if not found