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 CalciteSchema
Typically 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 ModifiableViewTable
modifiableViewTable
(CalcitePrepare.AnalyzeViewResult parsed, String viewSql, List<String> schemaPath, @Nullable List<String> viewPath, CalciteSchema schema) Allows a sub-class to return an extension ofModifiableViewTable
by overriding this method.protected ViewTable
viewTable
(CalcitePrepare.AnalyzeViewResult parsed, String viewSql, List<String> schemaPath, @Nullable List<String> viewPath) Allows a sub-class to return an extension ofViewTable
by 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:Function
Returns the parameters of this function.- Specified by:
getParameters
in interfaceFunction
- Returns:
- Parameters; never null
-
apply
Description copied from interface:TableMacro
Applies arguments to yield a table.- Specified by:
apply
in 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 ofModifiableViewTable
by 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 ofViewTable
by overriding this method.
-