Package org.apache.calcite.adapter.file
Class FileTable
- java.lang.Object
-
- org.apache.calcite.schema.impl.AbstractTable
-
- org.apache.calcite.adapter.java.AbstractQueryableTable
-
- org.apache.calcite.adapter.file.FileTable
-
- All Implemented Interfaces:
QueryableTable
,Table
,TranslatableTable
,Wrapper
class FileTable extends AbstractQueryableTable implements TranslatableTable
Table implementation wrapping a URL / HTML table.
-
-
Field Summary
Fields Modifier and Type Field Description private FileRowConverter
converter
private RelProtoDataType
protoRowType
private FileReader
reader
-
Fields inherited from class org.apache.calcite.adapter.java.AbstractQueryableTable
elementType
-
-
Constructor Summary
Constructors Modifier Constructor Description private
FileTable(Source source, java.lang.String selector, java.lang.Integer index, RelProtoDataType protoRowType, java.util.List<java.util.Map<java.lang.String,java.lang.Object>> fieldConfigs)
Creates a FileTable.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Queryable<T>
asQueryable(QueryProvider queryProvider, SchemaPlus schema, java.lang.String tableName)
Converts this table into aQueryable
.(package private) static FileTable
create(Source source, java.util.Map<java.lang.String,java.lang.Object> tableDef)
Creates a FileTable.RelDataType
getRowType(RelDataTypeFactory typeFactory)
Returns this table's row type.Statistic
getStatistic()
Returns a provider of statistics about this table.Enumerable<java.lang.Object>
project(int[] fields)
Returns an enumerable over a given projection of the fields.RelNode
toRel(RelOptTable.ToRelContext context, RelOptTable relOptTable)
Converts this table into arelational expression
.java.lang.String
toString()
-
Methods inherited from class org.apache.calcite.adapter.java.AbstractQueryableTable
getElementType, getExpression
-
Methods inherited from class org.apache.calcite.schema.impl.AbstractTable
getJdbcTableType, isRolledUp, rolledUpColumnValidInsideAgg, unwrap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.calcite.schema.Table
getJdbcTableType, isRolledUp, rolledUpColumnValidInsideAgg
-
-
-
-
Field Detail
-
protoRowType
private final RelProtoDataType protoRowType
-
reader
private FileReader reader
-
converter
private FileRowConverter converter
-
-
Constructor Detail
-
FileTable
private FileTable(Source source, java.lang.String selector, java.lang.Integer index, RelProtoDataType protoRowType, java.util.List<java.util.Map<java.lang.String,java.lang.Object>> fieldConfigs) throws java.lang.Exception
Creates a FileTable.- Throws:
java.lang.Exception
-
-
Method Detail
-
create
static FileTable create(Source source, java.util.Map<java.lang.String,java.lang.Object> tableDef) throws java.lang.Exception
Creates a FileTable.- Throws:
java.lang.Exception
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getStatistic
public Statistic getStatistic()
Description copied from interface:Table
Returns a provider of statistics about this table.- Specified by:
getStatistic
in interfaceTable
- Overrides:
getStatistic
in classAbstractTable
-
getRowType
public RelDataType getRowType(RelDataTypeFactory typeFactory)
Description copied from interface:Table
Returns this table's row type.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.
- Specified by:
getRowType
in interfaceTable
- Parameters:
typeFactory
- Type factory with which to create the type- Returns:
- Row type
-
asQueryable
public <T> Queryable<T> asQueryable(QueryProvider queryProvider, SchemaPlus schema, java.lang.String tableName)
Description copied from interface:QueryableTable
Converts this table into aQueryable
.- Specified by:
asQueryable
in interfaceQueryableTable
-
project
public Enumerable<java.lang.Object> project(int[] fields)
Returns an enumerable over a given projection of the fields.
-
toRel
public RelNode toRel(RelOptTable.ToRelContext context, RelOptTable relOptTable)
Description copied from interface:TranslatableTable
Converts this table into arelational expression
.- Specified by:
toRel
in interfaceTranslatableTable
-
-