use of com.hazelcast.jet.sql.impl.SqlPlanImpl.ExplainStatementPlan in project hazelcast by hazelcast.
the class CalciteSqlOptimizer method toExplainStatementPlan.
private SqlPlan toExplainStatementPlan(PlanKey planKey, OptimizerContext context, QueryParseResult parseResult) {
SqlNode node = parseResult.getNode();
assert node instanceof SqlExplainStatement;
QueryConvertResult convertResult = context.convert(((SqlExplainStatement) node).getExplicandum());
PhysicalRel physicalRel = optimize(parseResult.getParameterMetadata(), convertResult.getRel(), context, false);
return new ExplainStatementPlan(planKey, physicalRel, planExecutor);
}
use of com.hazelcast.jet.sql.impl.SqlPlanImpl.ExplainStatementPlan in project hazelcast by hazelcast.
the class PlanExecutor method execute.
SqlResult execute(ExplainStatementPlan plan) {
Stream<String> planRows;
SqlRowMetadata metadata = new SqlRowMetadata(singletonList(new SqlColumnMetadata("rel", VARCHAR, false)));
InternalSerializationService serializationService = Util.getSerializationService(hazelcastInstance);
planRows = Arrays.stream(plan.getRel().explain().split(LE));
return new SqlResultImpl(QueryId.create(hazelcastInstance.getLocalEndpoint().getUuid()), new StaticQueryResultProducerImpl(planRows.map(rel -> new JetSqlRow(serializationService, new Object[] { rel })).iterator()), metadata, false);
}
Aggregations