public abstract class AbstractElasticsearchTable extends AbstractQueryableTable implements TranslatableTable
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractElasticsearchTable.ElasticsearchQueryable<T>
Implementation of
Queryable based on
a AbstractElasticsearchTable. |
| Modifier and Type | Field and Description |
|---|---|
protected String |
indexName |
protected String |
typeName |
elementType| Constructor and Description |
|---|
AbstractElasticsearchTable(String indexName,
String typeName)
Creates an ElasticsearchTable.
|
| Modifier and Type | Method and Description |
|---|---|
<T> Queryable<T> |
asQueryable(QueryProvider queryProvider,
SchemaPlus schema,
String tableName)
Converts this table into a
Queryable. |
protected abstract Enumerable<Object> |
find(String index,
List<String> ops,
List<Map.Entry<String,Class>> fields)
Executes a "find" operation on the underlying type.
|
RelDataType |
getRowType(RelDataTypeFactory relDataTypeFactory)
Returns this table's row type.
|
RelNode |
toRel(RelOptTable.ToRelContext context,
RelOptTable relOptTable)
Converts this table into a
relational expression. |
String |
toString() |
getElementType, getExpressiongetJdbcTableType, getStatistic, isRolledUp, rolledUpColumnValidInsideAgg, unwrapclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetJdbcTableType, getStatistic, isRolledUp, rolledUpColumnValidInsideAggpublic RelDataType getRowType(RelDataTypeFactory relDataTypeFactory)
TableThis 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 TablerelDataTypeFactory - Type factory with which to create the typepublic <T> Queryable<T> asQueryable(QueryProvider queryProvider, SchemaPlus schema, String tableName)
QueryableTableQueryable.asQueryable in interface QueryableTablepublic RelNode toRel(RelOptTable.ToRelContext context, RelOptTable relOptTable)
TranslatableTablerelational expression.toRel in interface TranslatableTableprotected abstract Enumerable<Object> find(String index, List<String> ops, List<Map.Entry<String,Class>> fields)
For example,
client.prepareSearch(index).setTypes(type)
.setSource("{\"fields\" : [\"state\"]}")
index - Elasticsearch indexops - List of operations represented as Json strings.fields - List of fields to project; or null to return mapCopyright © 2012–2018 The Apache Software Foundation. All rights reserved.