public final class Schemas extends Object
| Modifier and Type | Method and Description |
|---|---|
static CalcitePrepare.ConvertResult |
convert(CalciteConnection connection,
CalciteSchema schema,
List<String> schemaPath,
String sql)
Parses and validates a SQL query and converts to relational algebra.
|
static DataContext |
createDataContext(Connection connection) |
static Enumerable<Object[]> |
enumerable(FilterableTable table,
DataContext root)
Returns an
Enumerable over the rows of
a given table, not applying any filters, representing each row as an object
array. |
static Enumerable<Object[]> |
enumerable(ProjectableFilterableTable table,
DataContext root)
Returns an
Enumerable over the rows of
a given table, not applying any filters and projecting all columns,
representing each row as an object array. |
static Enumerable<Object[]> |
enumerable(ScannableTable table,
DataContext root)
Returns an
Enumerable over the rows of
a given table, representing each row as an object array. |
static Expression |
expression(SchemaPlus schema)
Returns the expression for a schema.
|
static List<CalciteSchema.LatticeEntry> |
getLatticeEntries(CalciteSchema schema)
Returns the lattices defined in a schema.
|
static List<Lattice> |
getLattices(CalciteSchema schema)
Returns the lattices defined in a schema.
|
static List<CalciteSchema.TableEntry> |
getStarTables(CalciteSchema schema)
Returns the star tables defined in a schema.
|
static CalcitePrepare.Context |
makeContext(CalciteConnection connection,
CalciteSchema schema,
List<String> schemaPath,
com.google.common.collect.ImmutableMap<CalciteConnectionProperty,String> propValues) |
static CalcitePrepare.ParseResult |
parse(CalciteConnection connection,
CalciteSchema schema,
List<String> schemaPath,
String sql)
Parses and validates a SQL query.
|
static CalcitePrepare.CalciteSignature<Object> |
prepare(CalciteConnection connection,
CalciteSchema schema,
List<String> schemaPath,
String sql,
com.google.common.collect.ImmutableMap<CalciteConnectionProperty,String> map)
Prepares a SQL query for execution.
|
static RelProtoDataType |
proto(ScalarFunction function)
Returns an implementation of
RelProtoDataType
that asks a given scalar function for its return type with a given type
factory. |
static RelProtoDataType |
proto(Table table)
Returns an implementation of
RelProtoDataType
that asks a given table for its row type with a given type factory. |
static <E> Queryable<E> |
queryable(DataContext root,
Class<E> clazz,
Iterable<? extends String> names)
Returns a
Queryable, given a fully-qualified table name as an
iterable. |
static <E> Queryable<E> |
queryable(DataContext root,
Class<E> clazz,
String... names)
Returns a
Queryable, given a fully-qualified table name. |
static <E> Queryable<E> |
queryable(DataContext root,
SchemaPlus schema,
Class<E> clazz,
String tableName)
Returns a
Queryable, given a schema and table name. |
static CalciteSchema.FunctionEntry |
resolve(RelDataTypeFactory typeFactory,
String name,
Collection<CalciteSchema.FunctionEntry> functionEntries,
List<RelDataType> argumentTypes) |
static CalciteSchema |
subSchema(CalciteSchema schema,
List<String> names) |
static Expression |
subSchemaExpression(SchemaPlus schema,
String name,
Class type)
Returns the expression for a sub-schema.
|
static Table |
table(DataContext root,
String... names)
Returns an
Enumerable over object
arrays, given a fully-qualified table name which leads to a
ScannableTable. |
static Expression |
tableExpression(SchemaPlus schema,
Type elementType,
String tableName,
Class clazz)
Returns the expression to access a table within a schema.
|
static String |
uniqueTableName(CalciteSchema schema,
String base)
Generates a table name that is unique within the given schema.
|
static Expression |
unwrap(Expression call,
Class type)
Converts a schema expression to a given type by calling the
SchemaPlus.unwrap(Class) method. |
public static CalciteSchema.FunctionEntry resolve(RelDataTypeFactory typeFactory, String name, Collection<CalciteSchema.FunctionEntry> functionEntries, List<RelDataType> argumentTypes)
public static Expression expression(SchemaPlus schema)
public static Expression subSchemaExpression(SchemaPlus schema, String name, Class type)
public static Expression unwrap(Expression call, Class type)
SchemaPlus.unwrap(Class) method.public static Expression tableExpression(SchemaPlus schema, Type elementType, String tableName, Class clazz)
public static DataContext createDataContext(Connection connection)
public static <E> Queryable<E> queryable(DataContext root, Class<E> clazz, String... names)
Queryable, given a fully-qualified table name.public static <E> Queryable<E> queryable(DataContext root, Class<E> clazz, Iterable<? extends String> names)
Queryable, given a fully-qualified table name as an
iterable.public static <E> Queryable<E> queryable(DataContext root, SchemaPlus schema, Class<E> clazz, String tableName)
Queryable, given a schema and table name.public static Enumerable<Object[]> enumerable(ScannableTable table, DataContext root)
Enumerable over the rows of
a given table, representing each row as an object array.public static Enumerable<Object[]> enumerable(FilterableTable table, DataContext root)
Enumerable over the rows of
a given table, not applying any filters, representing each row as an object
array.public static Enumerable<Object[]> enumerable(ProjectableFilterableTable table, DataContext root)
Enumerable over the rows of
a given table, not applying any filters and projecting all columns,
representing each row as an object array.public static Table table(DataContext root, String... names)
Enumerable over object
arrays, given a fully-qualified table name which leads to a
ScannableTable.public static CalcitePrepare.ParseResult parse(CalciteConnection connection, CalciteSchema schema, List<String> schemaPath, String sql)
public static CalcitePrepare.ConvertResult convert(CalciteConnection connection, CalciteSchema schema, List<String> schemaPath, String sql)
public static CalcitePrepare.CalciteSignature<Object> prepare(CalciteConnection connection, CalciteSchema schema, List<String> schemaPath, String sql, com.google.common.collect.ImmutableMap<CalciteConnectionProperty,String> map)
public static CalcitePrepare.Context makeContext(CalciteConnection connection, CalciteSchema schema, List<String> schemaPath, com.google.common.collect.ImmutableMap<CalciteConnectionProperty,String> propValues)
public static RelProtoDataType proto(Table table)
RelProtoDataType
that asks a given table for its row type with a given type factory.public static RelProtoDataType proto(ScalarFunction function)
RelProtoDataType
that asks a given scalar function for its return type with a given type
factory.public static List<CalciteSchema.TableEntry> getStarTables(CalciteSchema schema)
schema - Schemapublic static List<Lattice> getLattices(CalciteSchema schema)
schema - Schemapublic static List<CalciteSchema.LatticeEntry> getLatticeEntries(CalciteSchema schema)
schema - Schemapublic static CalciteSchema subSchema(CalciteSchema schema, List<String> names)
public static String uniqueTableName(CalciteSchema schema, String base)
Copyright © 2012–2015 The Apache Software Foundation. All rights reserved.