Package org.apache.calcite.schema.impl
Class ViewTableMacro
java.lang.Object
org.apache.calcite.schema.impl.ViewTableMacro
- All Implemented Interfaces:
Function,TableMacro
- Direct Known Subclasses:
MaterializedViewTable.MaterializedViewTableMacro,MockCatalogReader.MockModifiableViewRelOptTable.MockViewTableMacro
Table function that implements a view. It returns the operator
tree of the view's SQL query.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CalciteSchemaTypically null.protected final String -
Constructor Summary
ConstructorsConstructorDescriptionViewTableMacro(CalciteSchema schema, String viewSql, @Nullable List<String> schemaPath, @Nullable List<String> viewPath, @Nullable Boolean modifiable) Creates a ViewTableMacro. -
Method Summary
Modifier and TypeMethodDescriptionApplies arguments to yield a table.Returns the parameters of this function.protected ModifiableViewTablemodifiableViewTable(CalcitePrepare.AnalyzeViewResult parsed, String viewSql, List<String> schemaPath, @Nullable List<String> viewPath, CalciteSchema schema) Allows a sub-class to return an extension ofModifiableViewTableby overriding this method.protected ViewTableviewTable(CalcitePrepare.AnalyzeViewResult parsed, String viewSql, List<String> schemaPath, @Nullable List<String> viewPath) Allows a sub-class to return an extension ofViewTableby overriding this method.
-
Field Details
-
viewSql
-
schema
-
schemaPath
Typically null. If specified, overrides the path of the schema as the context for validatingviewSql. -
viewPath
-
-
Constructor Details
-
ViewTableMacro
public ViewTableMacro(CalciteSchema schema, String viewSql, @Nullable List<String> schemaPath, @Nullable List<String> viewPath, @Nullable Boolean modifiable) Creates a ViewTableMacro.- Parameters:
schema- Root schemaviewSql- SQL defining the viewschemaPath- Schema path relative to the root schemaviewPath- View path relative to the schema pathmodifiable- Request that a view is modifiable (dependent on analysis ofviewSql)
-
-
Method Details
-
getParameters
Description copied from interface:FunctionReturns the parameters of this function.- Specified by:
getParametersin interfaceFunction- Returns:
- Parameters; never null
-
apply
Description copied from interface:TableMacroApplies arguments to yield a table.- Specified by:
applyin interfaceTableMacro- Parameters:
arguments- Arguments- Returns:
- Table
-
modifiableViewTable
protected ModifiableViewTable modifiableViewTable(CalcitePrepare.AnalyzeViewResult parsed, String viewSql, List<String> schemaPath, @Nullable List<String> viewPath, CalciteSchema schema) Allows a sub-class to return an extension ofModifiableViewTableby overriding this method. -
viewTable
protected ViewTable viewTable(CalcitePrepare.AnalyzeViewResult parsed, String viewSql, List<String> schemaPath, @Nullable List<String> viewPath) Allows a sub-class to return an extension ofViewTableby overriding this method.
-