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 java.util.List<java.lang.String> |
schemaPath |
private java.util.List<java.lang.String> |
viewPath |
private java.lang.String |
viewSql |
elementType
Constructor and Description |
---|
ViewTable(java.lang.reflect.Type elementType,
RelProtoDataType rowType,
java.lang.String viewSql,
java.util.List<java.lang.String> schemaPath,
java.util.List<java.lang.String> viewPath) |
Modifier and Type | Method and Description |
---|---|
<T> Queryable<T> |
asQueryable(QueryProvider queryProvider,
SchemaPlus schema,
java.lang.String tableName)
Converts this table into a
Queryable . |
private RelRoot |
expandView(RelOptTable.ToRelContext context,
RelDataType rowType,
java.lang.String queryString) |
Schema.TableType |
getJdbcTableType()
Type of table.
|
RelDataType |
getRowType(RelDataTypeFactory typeFactory)
Returns this table's row type.
|
java.util.List<java.lang.String> |
getSchemaPath()
Returns the the schema path of the view.
|
java.util.List<java.lang.String> |
getViewPath()
Returns the the path of the view.
|
java.lang.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,
java.lang.String viewSql,
java.util.List<java.lang.String> schemaPath)
Deprecated.
|
static ViewTableMacro |
viewMacro(SchemaPlus schema,
java.lang.String viewSql,
java.util.List<java.lang.String> schemaPath,
java.lang.Boolean modifiable)
Deprecated.
|
static ViewTableMacro |
viewMacro(SchemaPlus schema,
java.lang.String viewSql,
java.util.List<java.lang.String> schemaPath,
java.util.List<java.lang.String> viewPath,
java.lang.Boolean modifiable)
Table macro that returns a view.
|
getElementType, getExpression
getStatistic, isRolledUp, rolledUpColumnValidInsideAgg, unwrap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getStatistic, isRolledUp, rolledUpColumnValidInsideAgg
private final java.lang.String viewSql
private final java.util.List<java.lang.String> schemaPath
private final RelProtoDataType protoRowType
private final java.util.List<java.lang.String> viewPath
public ViewTable(java.lang.reflect.Type elementType, RelProtoDataType rowType, java.lang.String viewSql, java.util.List<java.lang.String> schemaPath, java.util.List<java.lang.String> viewPath)
@Deprecated public static ViewTableMacro viewMacro(SchemaPlus schema, java.lang.String viewSql, java.util.List<java.lang.String> schemaPath)
@Deprecated public static ViewTableMacro viewMacro(SchemaPlus schema, java.lang.String viewSql, java.util.List<java.lang.String> schemaPath, java.lang.Boolean modifiable)
public static ViewTableMacro viewMacro(SchemaPlus schema, java.lang.String viewSql, java.util.List<java.lang.String> schemaPath, java.util.List<java.lang.String> viewPath, java.lang.Boolean modifiable)
schema
- Schema the view will belong toviewSql
- SQL queryschemaPath
- Path of schemamodifiable
- Whether view is modifiable, or null to deduce itpublic java.lang.String getViewSql()
public java.util.List<java.lang.String> getSchemaPath()
public java.util.List<java.lang.String> getViewPath()
public Schema.TableType getJdbcTableType()
Table
getJdbcTableType
in interface Table
getJdbcTableType
in class AbstractTable
public RelDataType getRowType(RelDataTypeFactory typeFactory)
Table
This 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 Table
typeFactory
- Type factory with which to create the typepublic <T> Queryable<T> asQueryable(QueryProvider queryProvider, SchemaPlus schema, java.lang.String tableName)
QueryableTable
Queryable
.asQueryable
in interface QueryableTable
public RelNode toRel(RelOptTable.ToRelContext context, RelOptTable relOptTable)
TranslatableTable
relational expression
.toRel
in interface TranslatableTable
private RelRoot expandView(RelOptTable.ToRelContext context, RelDataType rowType, java.lang.String queryString)
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.