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
public class ViewTableMacro extends java.lang.Object implements TableMacro
Table function that implements a view. It returns the operator tree of the view's SQL query.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Boolean
modifiable
protected CalciteSchema
schema
protected java.util.List<java.lang.String>
schemaPath
Typically null.protected java.util.List<java.lang.String>
viewPath
protected java.lang.String
viewSql
-
Constructor Summary
Constructors Constructor Description ViewTableMacro(CalciteSchema schema, java.lang.String viewSql, java.util.List<java.lang.String> schemaPath, java.util.List<java.lang.String> viewPath, java.lang.Boolean modifiable)
Creates a ViewTableMacro.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TranslatableTable
apply(java.util.List<java.lang.Object> arguments)
Applies arguments to yield a table.java.util.List<FunctionParameter>
getParameters()
Returns the parameters of this function.protected ModifiableViewTable
modifiableViewTable(CalcitePrepare.AnalyzeViewResult parsed, java.lang.String viewSql, java.util.List<java.lang.String> schemaPath, java.util.List<java.lang.String> viewPath, CalciteSchema schema)
Allows a sub-class to return an extension ofModifiableViewTable
by overriding this method.protected ViewTable
viewTable(CalcitePrepare.AnalyzeViewResult parsed, java.lang.String viewSql, java.util.List<java.lang.String> schemaPath, java.util.List<java.lang.String> viewPath)
Allows a sub-class to return an extension ofViewTable
by overriding this method.
-
-
-
Field Detail
-
viewSql
protected final java.lang.String viewSql
-
schema
protected final CalciteSchema schema
-
modifiable
private final java.lang.Boolean modifiable
-
schemaPath
protected final java.util.List<java.lang.String> schemaPath
Typically null. If specified, overrides the path of the schema as the context for validatingviewSql
.
-
viewPath
protected final java.util.List<java.lang.String> viewPath
-
-
Constructor Detail
-
ViewTableMacro
public ViewTableMacro(CalciteSchema schema, java.lang.String viewSql, java.util.List<java.lang.String> schemaPath, java.util.List<java.lang.String> viewPath, java.lang.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 Detail
-
getParameters
public java.util.List<FunctionParameter> getParameters()
Description copied from interface:Function
Returns the parameters of this function.- Specified by:
getParameters
in interfaceFunction
- Returns:
- Parameters; never null
-
apply
public TranslatableTable apply(java.util.List<java.lang.Object> arguments)
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, java.lang.String viewSql, java.util.List<java.lang.String> schemaPath, java.util.List<java.lang.String> viewPath, CalciteSchema schema)
Allows a sub-class to return an extension ofModifiableViewTable
by overriding this method.
-
viewTable
protected ViewTable viewTable(CalcitePrepare.AnalyzeViewResult parsed, java.lang.String viewSql, java.util.List<java.lang.String> schemaPath, java.util.List<java.lang.String> viewPath)
Allows a sub-class to return an extension ofViewTable
by overriding this method.
-
-