Interface Table
- All Known Subinterfaces:
CustomColumnResolvingTable
,ExtensibleTable
,FilterableTable
,ModifiableTable
,ModifiableView
,ProjectableFilterableTable
,QueryableTable
,ScannableTable
,StreamableTable
,TemporalTable
,TransientTable
,TranslatableTable
- All Known Implementing Classes:
AbstractModifiableTable
,AbstractModifiableView
,AbstractQueryableTable
,AbstractTable
,ArrowTable
,BaseOrderStreamTable
,CassandraTable
,CsvFilterableTable
,CsvScannableTable
,CsvStreamScannableTable
,CsvTable
,CsvTable
,CsvTranslatableTable
,CsvTranslatableTable
,DruidTable
,ElasticsearchTable
,GeodeSimpleScannableTable
,GeodeTable
,InfiniteOrdersTable
,InnodbTable
,JdbcTable
,JsonScannableTable
,JsonTable
,KafkaStreamTable
,ListTransientTable
,MaterializedViewTable
,MazeTable
,MockCatalogReader.MockDynamicTable
,MockCatalogReader.MockModifiableViewRelOptTable.MockModifiableViewTable
,ModifiableViewTable
,MongoTable
,OrdersHistoryTable
,OrdersTable
,PigTable
,PigTable
,ProductsTable
,ProductsTemporalTable
,RedisTable
,Smalls.MazeTable
,Smalls.SimpleTable
,SqlSpatialTypeFunctions.ExplodeTable
,SqlSpatialTypeFunctions.GridTable
,StarTable
,ViewTable
The typical way for a table to be created is when Calcite interrogates a
user-defined schema in order to validate names appearing in a SQL query.
Calcite finds the schema by calling Schema.getSubSchema(String)
on
the connection's root schema, then gets a table by calling
Schema.getTable(String)
.
Note that a table does not know its name. It is in fact possible for a table to be used more than once, perhaps under multiple names or under multiple schemas. (Compare with the i-node concept in the UNIX filesystem.)
A particular table instance may also implement Wrapper
,
to give access to sub-objects.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionType of table.getRowType
(RelDataTypeFactory typeFactory) Returns this table's row type.Returns a provider of statistics about this table.boolean
isRolledUp
(String column) Determines whether the givencolumn
has been rolled up.boolean
rolledUpColumnValidInsideAgg
(String column, SqlCall call, @Nullable SqlNode parent, @Nullable CalciteConnectionConfig config) Determines whether the given rolled up column can be used inside the given aggregate function.
-
Method Details
-
getRowType
Returns this table's row type.This is a struct type whose fields describe the names and types of the columns in this table.
The implementer must use the type factory provided. This ensures that the type is converted into a canonical form; other equal types in the same query will use the same object.
- Parameters:
typeFactory
- Type factory with which to create the type- Returns:
- Row type
-
getStatistic
Statistic getStatistic()Returns a provider of statistics about this table. -
getJdbcTableType
Schema.TableType getJdbcTableType()Type of table. -
isRolledUp
Determines whether the givencolumn
has been rolled up. -
rolledUpColumnValidInsideAgg
boolean rolledUpColumnValidInsideAgg(String column, SqlCall call, @Nullable SqlNode parent, @Nullable CalciteConnectionConfig config) Determines whether the given rolled up column can be used inside the given aggregate function. You can assume thatisRolledUp(column)
istrue
.- Parameters:
column
- The column name for whichisRolledUp
is truecall
- The aggregate callparent
- Parent node ofcall
in theSqlNode
treeconfig
- Config settings. May be null- Returns:
- true iff the given aggregate call is valid
-