Package org.apache.calcite.adapter.clone
Class ArrayTable
- java.lang.Object
-
- org.apache.calcite.schema.impl.AbstractTable
-
- org.apache.calcite.adapter.java.AbstractQueryableTable
-
- org.apache.calcite.adapter.clone.ArrayTable
-
- All Implemented Interfaces:
QueryableTable
,ScannableTable
,Table
,Wrapper
class ArrayTable extends AbstractQueryableTable implements ScannableTable
Implementation of table that reads rows from column stores, one per column. Column store formats are chosen based on the type and distribution of the values in the column; seeArrayTable.Representation
andArrayTable.RepresentationType
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ArrayTable.BitSlicedPrimitiveArray
Representation that stores numeric values in a bit-sliced array.static class
ArrayTable.ByteStringDictionary
Representation that stores byte-string column values.static class
ArrayTable.Column
Column definition and value set.static class
ArrayTable.Constant
Representation of a column that has the same value for every row.static class
ArrayTable.Content
Contents of a table.static class
ArrayTable.ObjectArray
Representation that stores the column values in an array.static class
ArrayTable.ObjectDictionary
Representation that stores the values of a column as a dictionary of objects.static class
ArrayTable.PrimitiveArray
Representation that stores the values of a column in an array of primitive values.static class
ArrayTable.PrimitiveDictionary
Representation that stores column values in a dictionary of primitive values, then uses a short code for each row.static interface
ArrayTable.Representation
Representation of the values of a column.(package private) static class
ArrayTable.RepresentationType
How a column's values are represented.static class
ArrayTable.StringDictionary
Representation that stores string column values.
-
Field Summary
Fields Modifier and Type Field Description private RelProtoDataType
protoRowType
private com.google.common.base.Supplier<ArrayTable.Content>
supplier
-
Fields inherited from class org.apache.calcite.adapter.java.AbstractQueryableTable
elementType
-
-
Constructor Summary
Constructors Constructor Description ArrayTable(java.lang.reflect.Type elementType, RelProtoDataType protoRowType, com.google.common.base.Supplier<ArrayTable.Content> supplier)
Creates an ArrayTable.
-
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
.RelDataType
getRowType(RelDataTypeFactory typeFactory)
Returns this table's row type.Statistic
getStatistic()
Returns a provider of statistics about this table.private static <E> java.util.List<E>
permuteList(java.util.List<E> list, int[] sources)
Enumerable<java.lang.Object[]>
scan(DataContext root)
Returns an enumerator over the rows in this Table.private static <T> Pair<java.lang.Object,T>
toPair(java.lang.Object dataSet)
-
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, toString, wait, wait, wait
-
Methods inherited from interface org.apache.calcite.schema.Table
getJdbcTableType, isRolledUp, rolledUpColumnValidInsideAgg
-
-
-
-
Field Detail
-
protoRowType
private final RelProtoDataType protoRowType
-
supplier
private final com.google.common.base.Supplier<ArrayTable.Content> supplier
-
-
Constructor Detail
-
ArrayTable
ArrayTable(java.lang.reflect.Type elementType, RelProtoDataType protoRowType, com.google.common.base.Supplier<ArrayTable.Content> supplier)
Creates an ArrayTable.
-
-
Method Detail
-
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
-
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
-
scan
public Enumerable<java.lang.Object[]> scan(DataContext root)
Description copied from interface:ScannableTable
Returns an enumerator over the rows in this Table. Each row is represented as an array of its column values.- Specified by:
scan
in interfaceScannableTable
-
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
-
toPair
private static <T> Pair<java.lang.Object,T> toPair(java.lang.Object dataSet)
-
permuteList
private static <E> java.util.List<E> permuteList(java.util.List<E> list, int[] sources)
-
-