Class CalciteSchema.SchemaPlusImpl

    • Nested Class Summary

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private SchemaPlusImpl()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(java.lang.String name, Lattice lattice)
      Adds a lattice to this schema.
      void add​(java.lang.String name, RelProtoDataType type)
      Adds a type to this schema.
      void add​(java.lang.String name, Function function)
      Adds a function to this schema.
      SchemaPlus add​(java.lang.String name, Schema schema)
      Adds a schema as a sub-schema of this schema, and returns the wrapped object.
      void add​(java.lang.String name, Table table)
      Adds a table to this schema.
      (package private) CalciteSchema calciteSchema()  
      Expression getExpression​(SchemaPlus parentSchema, java.lang.String name)
      Returns the expression by which this schema can be referenced in generated code.
      java.util.NavigableSet<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.
      java.lang.String getName()
      Returns the name of this schema.
      SchemaPlus getParentSchema()
      Returns the parent schema, or null if this schema has no parent.
      SchemaPlus getSubSchema​(java.lang.String name)
      Returns a sub-schema with a given name, or null.
      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.
      java.util.NavigableSet<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.
      java.util.Set<java.lang.String> getTypeNames()
      Returns the names of the types in this schema.
      boolean isCacheEnabled()  
      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).
      void setCacheEnabled​(boolean cache)  
      void setPath​(com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableList<java.lang.String>> path)  
      Schema snapshot​(SchemaVersion version)
      Returns the snapshot of this schema as of the specified time.
      <T> T unwrap​(java.lang.Class<T> clazz)
      Returns an underlying object.
      • Methods inherited from class java.lang.Object

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

      • SchemaPlusImpl

        private SchemaPlusImpl()
    • Method Detail

      • getName

        public java.lang.String getName()
        Description copied from interface: SchemaPlus
        Returns the name of this schema.

        The name must not be null, and must be unique within its parent. The root schema is typically named "".

        Specified by:
        getName in interface SchemaPlus
      • 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
        Specified by:
        isMutable in interface SchemaPlus
        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
      • getTable

        public 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
      • getTableNames

        public java.util.NavigableSet<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
      • 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
      • getFunctions

        public 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 java.util.NavigableSet<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
      • getSubSchema

        public SchemaPlus 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
        Specified by:
        getSubSchema in interface SchemaPlus
        Parameters:
        name - Sub-schema name
        Returns:
        Sub-schema with a given name, or null
      • getSubSchemaNames

        public 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
      • add

        public SchemaPlus add​(java.lang.String name,
                              Schema schema)
        Description copied from interface: SchemaPlus
        Adds a schema as a sub-schema of this schema, and returns the wrapped object.
        Specified by:
        add in interface SchemaPlus
      • unwrap

        public <T> T unwrap​(java.lang.Class<T> clazz)
        Description copied from interface: SchemaPlus
        Returns an underlying object.
        Specified by:
        unwrap in interface SchemaPlus
      • setPath

        public void setPath​(com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableList<java.lang.String>> path)
        Specified by:
        setPath in interface SchemaPlus
      • add

        public void add​(java.lang.String name,
                        Table table)
        Description copied from interface: SchemaPlus
        Adds a table to this schema.
        Specified by:
        add in interface SchemaPlus
      • add

        public void add​(java.lang.String name,
                        Function function)
        Description copied from interface: SchemaPlus
        Adds a function to this schema.
        Specified by:
        add in interface SchemaPlus
      • add

        public void add​(java.lang.String name,
                        Lattice lattice)
        Description copied from interface: SchemaPlus
        Adds a lattice to this schema.
        Specified by:
        add in interface SchemaPlus