Class RelOptTableImpl

    • Field Detail

      • table

        private final Table table
      • expressionFunction

        private final java.util.function.Function<java.lang.Class,​Expression> expressionFunction
      • names

        private final<java.lang.String> names
      • rowCount

        private final java.lang.Double rowCount
        Estimate for the row count, or null.

        If not null, overrides the estimate from the actual table.

        Useful when a table that contains a materialized query result is being used to replace a query expression that wildly underestimates the row count. Now the materialized table can tell the same lie.

    • Constructor Detail

      • RelOptTableImpl

        private RelOptTableImpl​(RelOptSchema schema,
                                RelDataType rowType,
                                java.util.List<java.lang.String> names,
                                Table table,
                                java.util.function.Function<java.lang.Class,​Expression> expressionFunction,
                                java.lang.Double rowCount)
    • Method Detail

      • copy

        public RelOptTableImpl copy​(RelDataType newRowType)
        Creates a copy of this RelOptTable. The new RelOptTable will have newRowType.
      • getClassExpressionFunction

        private static java.util.function.Function<java.lang.Class,​Expression> getClassExpressionFunction​(SchemaPlus schema,
                                                                                                                java.lang.String tableName,
                                                                                                                Table table)
      • unwrap

        public <T> T unwrap​(java.lang.Class<T> clazz)
        Description copied from interface: Wrapper
        Finds an instance of an interface implemented by this object, or returns null if this object does not support that interface.
      • getExpression

        public Expression getExpression​(java.lang.Class clazz)
        Description copied from interface: RelOptTable
        Generates code for this table.
        clazz - The desired collection class; for example Queryable.
      • equals

        public boolean equals​(java.lang.Object obj)
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        hashCode in class java.lang.Object
      • getRowCount

        public double getRowCount()
        Description copied from interface: RelOptTable
        Returns an estimate of the number of rows in the table.
      • isKey

        public boolean isKey​(ImmutableBitSet columns)
        Description copied from interface: RelOptTable
        Returns whether the given columns are a key or a superset of a unique key of this table.
        columns - Ordinals of key columns
        Whether the given columns are a key or a superset of a key
      • getReferentialConstraints

        public java.util.List<RelReferentialConstraint> getReferentialConstraints()
        Description copied from interface: RelOptTable
        Returns the referential constraints existing for this table. These constraints are represented over other tables using RelReferentialConstraint nodes.
      • getRowType

        public RelDataType getRowType()
        Description copied from interface: RelOptTable
        Describes the type of rows returned by this table.
      • supportsModality

        public boolean supportsModality​(SqlModality modality)
      • isTemporal

        public boolean isTemporal()
        Description copied from interface: SqlValidatorTable
        Returns whether the table is temporal.
      • getQualifiedName

        public java.util.List<java.lang.String> getQualifiedName()
        Description copied from interface: RelOptTable
        Obtains an identifier for this table. The identifier must be unique with respect to the Connection producing this table.
        qualified name
      • getMonotonicity

        public SqlMonotonicity getMonotonicity​(java.lang.String columnName)
        Description copied from interface: SqlValidatorTable
        Returns whether a given column is monotonic.
      • getAllowedAccess

        public SqlAccessType getAllowedAccess()
        Description copied from interface: SqlValidatorTable
        Returns the access type of the table
      • realOrdinal

        public static int realOrdinal​(RelOptTable table,
                                      int i)
        Converts the ordinal of a field into the ordinal of a stored field. That is, it subtracts the number of virtual fields that come before it.
      • realRowType

        public static RelDataType realRowType​(RelOptTable table)
        Returns the row type of a table after any ColumnStrategy.VIRTUAL columns have been removed. This is the type of the records that are actually stored.