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
public class MaterializedViewTable extends ViewTable
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
Nested Classes Modifier and Type Class Description static class
MaterializedViewTable.MaterializedViewTableMacro
Table function that returns the table that materializes a view.
-
Field Summary
Fields Modifier and Type Field Description private MaterializationKey
key
static CalciteConnection
MATERIALIZATION_CONNECTION
Internal connection, used to execute queries to materialize views.-
Fields inherited from class org.apache.calcite.adapter.java.AbstractQueryableTable
elementType
-
-
Constructor Summary
Constructors Constructor Description MaterializedViewTable(java.lang.reflect.Type elementType, RelProtoDataType relDataType, java.lang.String viewSql, java.util.List<java.lang.String> viewSchemaPath, java.util.List<java.lang.String> viewPath, MaterializationKey key)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MaterializedViewTable.MaterializedViewTableMacro
create(CalciteSchema schema, java.lang.String viewSql, java.util.List<java.lang.String> viewSchemaPath, java.util.List<java.lang.String> viewPath, java.lang.String suggestedTableName, boolean existing)
Table macro that returns a materialized view.RelNode
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
-
-
-
-
Field Detail
-
key
private final MaterializationKey key
-
MATERIALIZATION_CONNECTION
public static final CalciteConnection MATERIALIZATION_CONNECTION
Internal connection, used to execute queries to materialize views. To be used only by Calcite internals. And sparingly.
-
-
Constructor Detail
-
MaterializedViewTable
public MaterializedViewTable(java.lang.reflect.Type elementType, RelProtoDataType relDataType, java.lang.String viewSql, java.util.List<java.lang.String> viewSchemaPath, java.util.List<java.lang.String> viewPath, MaterializationKey key)
-
-
Method Detail
-
create
public static MaterializedViewTable.MaterializedViewTableMacro create(CalciteSchema schema, java.lang.String viewSql, java.util.List<java.lang.String> viewSchemaPath, java.util.List<java.lang.String> viewPath, java.lang.String suggestedTableName, boolean existing)
Table macro that returns a materialized view.
-
toRel
public RelNode toRel(RelOptTable.ToRelContext context, RelOptTable relOptTable)
Description copied from interface:TranslatableTable
Converts this table into arelational expression
.- Specified by:
toRel
in interfaceTranslatableTable
- Overrides:
toRel
in classViewTable
-
-