public class ViewTable extends AbstractQueryableTable implements TranslatableTable
It is not evaluated; it is expanded during query planning.
| Modifier and Type | Field and Description |
|---|---|
private RelProtoDataType |
protoRowType |
private List<String> |
schemaPath |
private List<String> |
viewPath |
private String |
viewSql |
elementType| Constructor and Description |
|---|
ViewTable(Type elementType,
RelProtoDataType rowType,
String viewSql,
List<String> schemaPath,
List<String> viewPath) |
| Modifier and Type | Method and Description |
|---|---|
<T> Queryable<T> |
asQueryable(QueryProvider queryProvider,
SchemaPlus schema,
String tableName)
Converts this table into a
Queryable. |
private RelRoot |
expandView(RelOptTable.ToRelContext preparingStmt,
RelDataType rowType,
String queryString) |
Schema.TableType |
getJdbcTableType()
Type of table.
|
RelDataType |
getRowType(RelDataTypeFactory typeFactory)
Returns this table's row type.
|
List<String> |
getSchemaPath()
Returns the the schema path of the view.
|
List<String> |
getViewPath()
Returns the the path of the view.
|
String |
getViewSql()
Returns the view's SQL definition.
|
RelNode |
toRel(RelOptTable.ToRelContext context,
RelOptTable relOptTable)
Converts this table into a
relational expression. |
static ViewTableMacro |
viewMacro(SchemaPlus schema,
String viewSql,
List<String> schemaPath)
Deprecated.
|
static ViewTableMacro |
viewMacro(SchemaPlus schema,
String viewSql,
List<String> schemaPath,
Boolean modifiable)
Deprecated.
|
static ViewTableMacro |
viewMacro(SchemaPlus schema,
String viewSql,
List<String> schemaPath,
List<String> viewPath,
Boolean modifiable)
Table macro that returns a view.
|
getElementType, getExpressiongetStatistic, isRolledUp, rolledUpColumnValidInsideAgg, unwrapclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetStatistic, isRolledUp, rolledUpColumnValidInsideAggprivate final String viewSql
private final RelProtoDataType protoRowType
@Deprecated public static ViewTableMacro viewMacro(SchemaPlus schema, String viewSql, List<String> schemaPath)
@Deprecated public static ViewTableMacro viewMacro(SchemaPlus schema, String viewSql, List<String> schemaPath, Boolean modifiable)
public static ViewTableMacro viewMacro(SchemaPlus schema, String viewSql, List<String> schemaPath, List<String> viewPath, Boolean modifiable)
schema - Schema the view will belong toviewSql - SQL queryschemaPath - Path of schemamodifiable - Whether view is modifiable, or null to deduce itpublic String getViewSql()
public Schema.TableType getJdbcTableType()
TablegetJdbcTableType in interface TablegetJdbcTableType in class AbstractTablepublic RelDataType getRowType(RelDataTypeFactory typeFactory)
TableThis is a struct type whose fields describe the names and types of the columns in this table.
The implementer must use the type factory provided. This ensures that the type is converted into a canonical form; other equal types in the same query will use the same object.
getRowType in interface TabletypeFactory - Type factory with which to create the typepublic <T> Queryable<T> asQueryable(QueryProvider queryProvider, SchemaPlus schema, String tableName)
QueryableTableQueryable.asQueryable in interface QueryableTablepublic RelNode toRel(RelOptTable.ToRelContext context, RelOptTable relOptTable)
TranslatableTablerelational expression.toRel in interface TranslatableTableprivate RelRoot expandView(RelOptTable.ToRelContext preparingStmt, RelDataType rowType, String queryString)
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.