Class AbstractSchema

    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractSchema()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Expression getExpression​(SchemaPlus parentSchema, java.lang.String name)
      Returns the expression by which this schema can be referenced in generated code.
      protected com.google.common.collect.Multimap<java.lang.String,​Function> getFunctionMultimap()
      Returns a multi-map of functions in this schema by name.
      java.util.Set<java.lang.String> getFunctionNames()
      Returns the names of the functions in this schema.
      java.util.Collection<Function> getFunctions​(java.lang.String name)
      Returns a list of functions in this schema with the given name, or an empty list if there is no such function.
      Schema getSubSchema​(java.lang.String name)
      Returns a sub-schema with a given name, or null.
      protected java.util.Map<java.lang.String,​Schema> getSubSchemaMap()
      Returns a map of sub-schemas in this schema by name.
      java.util.Set<java.lang.String> getSubSchemaNames()
      Returns the names of this schema's child schemas.
      Table getTable​(java.lang.String name)
      Returns a table with a given name, or null if not found.
      protected java.util.Map<java.lang.String,​Table> getTableMap()
      Returns a map of tables in this schema by name.
      java.util.Set<java.lang.String> getTableNames()
      Returns the names of the tables in this schema.
      RelProtoDataType getType​(java.lang.String name)
      Returns a type with a given name, or null if not found.
      protected java.util.Map<java.lang.String,​RelProtoDataType> getTypeMap()
      Returns a map of types in this schema by name.
      java.util.Set<java.lang.String> getTypeNames()
      Returns the names of the types in this schema.
      boolean isMutable()
      Returns whether the user is allowed to create new tables, functions and sub-schemas in this schema, in addition to those returned automatically by methods such as Schema.getTable(String).
      Schema snapshot​(SchemaVersion version)
      Returns the snapshot of this schema as of the specified time.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractSchema

        public AbstractSchema()
    • Method Detail

      • isMutable

        public boolean isMutable()
        Description copied from interface: Schema
        Returns whether the user is allowed to create new tables, functions and sub-schemas in this schema, in addition to those returned automatically by methods such as Schema.getTable(String).

        Even if this method returns true, the maps are not modified. Calcite stores the defined objects in a wrapper object.

        Specified by:
        isMutable in interface Schema
        Returns:
        Whether the user is allowed to create new tables, functions and sub-schemas in this schema
      • snapshot

        public Schema snapshot​(SchemaVersion version)
        Description copied from interface: Schema
        Returns the snapshot of this schema as of the specified time. The contents of the schema snapshot should not change over time.
        Specified by:
        snapshot in interface Schema
        Parameters:
        version - The current schema version
        Returns:
        the schema snapshot.
      • getExpression

        public Expression getExpression​(SchemaPlus parentSchema,
                                        java.lang.String name)
        Description copied from interface: Schema
        Returns the expression by which this schema can be referenced in generated code.
        Specified by:
        getExpression in interface Schema
        Parameters:
        parentSchema - Parent schema
        name - Name of this schema
        Returns:
        Expression by which this schema can be referenced in generated code
      • getTableMap

        protected java.util.Map<java.lang.String,​Table> getTableMap()
        Returns a map of tables in this schema by name.

        The implementations of getTableNames() and getTable(String) depend on this map. The default implementation of this method returns the empty map. Override this method to change their behavior.

        Returns:
        Map of tables in this schema by name
      • getTableNames

        public final java.util.Set<java.lang.String> getTableNames()
        Description copied from interface: Schema
        Returns the names of the tables in this schema.
        Specified by:
        getTableNames in interface Schema
        Returns:
        Names of the tables in this schema
      • getTable

        public final Table getTable​(java.lang.String name)
        Description copied from interface: Schema
        Returns a table with a given name, or null if not found.
        Specified by:
        getTable in interface Schema
        Parameters:
        name - Table name
        Returns:
        Table, or null
      • getTypeMap

        protected java.util.Map<java.lang.String,​RelProtoDataType> getTypeMap()
        Returns a map of types in this schema by name.

        The implementations of getTypeNames() and getType(String) depend on this map. The default implementation of this method returns the empty map. Override this method to change their behavior.

        Returns:
        Map of types in this schema by name
      • getType

        public RelProtoDataType getType​(java.lang.String name)
        Description copied from interface: Schema
        Returns a type with a given name, or null if not found.
        Specified by:
        getType in interface Schema
        Parameters:
        name - Table name
        Returns:
        Table, or null
      • getTypeNames

        public java.util.Set<java.lang.String> getTypeNames()
        Description copied from interface: Schema
        Returns the names of the types in this schema.
        Specified by:
        getTypeNames in interface Schema
        Returns:
        Names of the tables in this schema
      • getFunctionMultimap

        protected com.google.common.collect.Multimap<java.lang.String,​Function> getFunctionMultimap()
        Returns a multi-map of functions in this schema by name. It is a multi-map because functions are overloaded; there may be more than one function in a schema with a given name (as long as they have different parameter lists).

        The implementations of getFunctionNames() and Schema.getFunctions(String) depend on this map. The default implementation of this method returns the empty multi-map. Override this method to change their behavior.

        Returns:
        Multi-map of functions in this schema by name
      • getFunctions

        public final java.util.Collection<Function> getFunctions​(java.lang.String name)
        Description copied from interface: Schema
        Returns a list of functions in this schema with the given name, or an empty list if there is no such function.
        Specified by:
        getFunctions in interface Schema
        Parameters:
        name - Name of function
        Returns:
        List of functions with given name, or empty list
      • getFunctionNames

        public final java.util.Set<java.lang.String> getFunctionNames()
        Description copied from interface: Schema
        Returns the names of the functions in this schema.
        Specified by:
        getFunctionNames in interface Schema
        Returns:
        Names of the functions in this schema
      • getSubSchemaMap

        protected java.util.Map<java.lang.String,​Schema> getSubSchemaMap()
        Returns a map of sub-schemas in this schema by name.

        The implementations of getSubSchemaNames() and getSubSchema(String) depend on this map. The default implementation of this method returns the empty map. Override this method to change their behavior.

        Returns:
        Map of sub-schemas in this schema by name
      • getSubSchemaNames

        public final java.util.Set<java.lang.String> getSubSchemaNames()
        Description copied from interface: Schema
        Returns the names of this schema's child schemas.
        Specified by:
        getSubSchemaNames in interface Schema
        Returns:
        Names of this schema's child schemas
      • getSubSchema

        public final Schema getSubSchema​(java.lang.String name)
        Description copied from interface: Schema
        Returns a sub-schema with a given name, or null.
        Specified by:
        getSubSchema in interface Schema
        Parameters:
        name - Sub-schema name
        Returns:
        Sub-schema with a given name, or null