use of org.apache.calcite.adapter.elasticsearch.ElasticsearchTable in project drill by apache.
the class ElasticPlanTransformer method visit.
/**
* Replaces rowType of RelOptTable by rowType obtained from ElasticsearchTable.
*/
@Override
public RelNode visit(TableScan other) {
RelOptTableImpl table = (RelOptTableImpl) other.getTable();
ElasticsearchTable elasticsearchTable = Objects.requireNonNull(table.unwrap(ElasticsearchTable.class), "ElasticSearch table cannot be null");
RelDataType rowType = elasticsearchTable.getRowType(other.getCluster().getTypeFactory());
mapField = rowType.getFieldList().get(0);
return new DrillElasticsearchTableScan(other.getCluster(), other.getTraitSet(), table.copy(rowType), elasticsearchTable, rowType);
}
Aggregations