use of org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.prepare.RelOptTableImpl 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