Package org.apache.calcite.schema.impl
Class MaterializedViewTable
java.lang.Object
org.apache.calcite.schema.impl.AbstractTable
org.apache.calcite.adapter.java.AbstractQueryableTable
org.apache.calcite.schema.impl.ViewTable
org.apache.calcite.schema.impl.MaterializedViewTable
- All Implemented Interfaces:
QueryableTable
,Table
,TranslatableTable
,Wrapper
Table that is a materialized view.
It can exist in two states: materialized and not materialized. Over time,
a given materialized view may switch states. How it is expanded depends upon
its current state. State is managed by
MaterializationService
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Table function that returns the table that materializes a view. -
Field Summary
Modifier and TypeFieldDescriptionstatic final CalciteConnection
Internal connection, used to execute queries to materialize views.Fields inherited from class org.apache.calcite.adapter.java.AbstractQueryableTable
elementType
-
Constructor Summary
ConstructorDescriptionMaterializedViewTable
(Type elementType, RelProtoDataType relDataType, String viewSql, List<String> viewSchemaPath, @Nullable List<String> viewPath, MaterializationKey key) -
Method Summary
Modifier and TypeMethodDescriptioncreate
(CalciteSchema schema, String viewSql, @Nullable List<String> viewSchemaPath, List<String> viewPath, @Nullable String suggestedTableName, boolean existing) Table macro that returns a materialized view.toRel
(RelOptTable.ToRelContext context, RelOptTable relOptTable) Converts this table into arelational expression
.Methods inherited from class org.apache.calcite.schema.impl.ViewTable
asQueryable, getJdbcTableType, getRowType, getSchemaPath, getViewPath, getViewSql, viewMacro, viewMacro, viewMacro
Methods inherited from class org.apache.calcite.adapter.java.AbstractQueryableTable
getElementType, getExpression
Methods inherited from class org.apache.calcite.schema.impl.AbstractTable
getStatistic, isRolledUp, rolledUpColumnValidInsideAgg, unwrap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.calcite.schema.Table
getStatistic, isRolledUp, rolledUpColumnValidInsideAgg
Methods inherited from interface org.apache.calcite.schema.Wrapper
maybeUnwrap, unwrapOrThrow
-
Field Details
-
MATERIALIZATION_CONNECTION
Internal connection, used to execute queries to materialize views. To be used only by Calcite internals. And sparingly.
-
-
Constructor Details
-
MaterializedViewTable
public MaterializedViewTable(Type elementType, RelProtoDataType relDataType, String viewSql, List<String> viewSchemaPath, @Nullable List<String> viewPath, MaterializationKey key)
-
-
Method Details
-
create
public static MaterializedViewTable.MaterializedViewTableMacro create(CalciteSchema schema, String viewSql, @Nullable List<String> viewSchemaPath, List<String> viewPath, @Nullable String suggestedTableName, boolean existing) Table macro that returns a materialized view. -
toRel
Description copied from interface:TranslatableTable
Converts this table into arelational expression
.- Specified by:
toRel
in interfaceTranslatableTable
- Overrides:
toRel
in classViewTable
-