Class GeodeTable
- java.lang.Object
-
- org.apache.calcite.schema.impl.AbstractTable
-
- org.apache.calcite.adapter.java.AbstractQueryableTable
-
- org.apache.calcite.adapter.geode.rel.GeodeTable
-
- All Implemented Interfaces:
QueryableTable
,Table
,TranslatableTable
,Wrapper
public class GeodeTable extends AbstractQueryableTable implements TranslatableTable
Table based on a Geode Region
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GeodeTable.GeodeQueryable<T>
Implementation ofQueryable
based on aGeodeTable
.
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.Logger
LOGGER
private java.lang.String
regionName
private RelDataType
rowType
-
Fields inherited from class org.apache.calcite.adapter.java.AbstractQueryableTable
elementType
-
-
Constructor Summary
Constructors Constructor Description GeodeTable(org.apache.geode.cache.Region<?,?> region)
-
Method Summary
All 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.Enumerable<java.lang.Object>
query(org.apache.geode.cache.GemFireCache clientCache, java.util.List<java.util.Map.Entry<java.lang.String,java.lang.Class>> fields, java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> selectFields, java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> aggregateFunctions, java.util.List<java.lang.String> groupByFields, java.util.List<java.lang.String> predicates, java.util.List<java.lang.String> orderByFields, java.lang.Long limit)
Executes an OQL query on the underlying table.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, getStatistic, 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, getStatistic, isRolledUp, rolledUpColumnValidInsideAgg
-
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
regionName
private final java.lang.String regionName
-
rowType
private final RelDataType rowType
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
query
public Enumerable<java.lang.Object> query(org.apache.geode.cache.GemFireCache clientCache, java.util.List<java.util.Map.Entry<java.lang.String,java.lang.Class>> fields, java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> selectFields, java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> aggregateFunctions, java.util.List<java.lang.String> groupByFields, java.util.List<java.lang.String> predicates, java.util.List<java.lang.String> orderByFields, java.lang.Long limit)
Executes an OQL query on the underlying table.Called by the
GeodeTable.GeodeQueryable
which in turn is called via the generated code.- Parameters:
clientCache
- Geode client cachefields
- List of fields to projectpredicates
- A list of predicates which should be used in the query- Returns:
- Enumerator of results
-
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
-
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
-
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
-
-