public class ElasticsearchTable extends AbstractQueryableTable implements TranslatableTable
| Modifier and Type | Class and Description |
|---|---|
static class |
ElasticsearchTable.ElasticsearchQueryable<T>
Implementation of
Queryable based on
a ElasticsearchTable. |
| Modifier and Type | Field and Description |
|---|---|
private org.elasticsearch.client.Client |
client |
private String |
indexName |
private String |
typeName |
elementType| Constructor and Description |
|---|
ElasticsearchTable(org.elasticsearch.client.Client client,
String indexName,
String typeName)
Creates an ElasticsearchTable.
|
| Modifier and Type | Method and Description |
|---|---|
<T> Queryable<T> |
asQueryable(QueryProvider queryProvider,
SchemaPlus schema,
String tableName) |
private 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) |
RelNode |
toRel(RelOptTable.ToRelContext context,
RelOptTable relOptTable) |
String |
toString() |
getElementType, getExpressiongetJdbcTableType, getStatisticclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetJdbcTableType, getStatisticprivate final org.elasticsearch.client.Client client
private final String indexName
private final String typeName
public RelDataType getRowType(RelDataTypeFactory relDataTypeFactory)
getRowType in interface Tablepublic <T> Queryable<T> asQueryable(QueryProvider queryProvider, SchemaPlus schema, String tableName)
asQueryable in interface QueryableTablepublic RelNode toRel(RelOptTable.ToRelContext context, RelOptTable relOptTable)
toRel in interface TranslatableTableprivate 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–2017 The Apache Software Foundation. All rights reserved.