use of com.hazelcast.jet.sql.impl.SqlPlanImpl.CreateJobPlan in project hazelcast by hazelcast.
the class CalciteSqlOptimizer method toCreateJobPlan.
private SqlPlan toCreateJobPlan(PlanKey planKey, QueryParseResult parseResult, OptimizerContext context, String query) {
SqlCreateJob sqlCreateJob = (SqlCreateJob) parseResult.getNode();
SqlNode source = sqlCreateJob.dmlStatement();
QueryParseResult dmlParseResult = new QueryParseResult(source, parseResult.getParameterMetadata(), false);
QueryConvertResult dmlConvertedResult = context.convert(dmlParseResult.getNode());
SqlPlanImpl dmlPlan = toPlan(null, parseResult.getParameterMetadata(), dmlConvertedResult.getRel(), dmlConvertedResult.getFieldNames(), context, dmlParseResult.isInfiniteRows(), true, query);
assert dmlPlan instanceof DmlPlan && ((DmlPlan) dmlPlan).getOperation() == Operation.INSERT;
return new CreateJobPlan(planKey, sqlCreateJob.jobConfig(), sqlCreateJob.ifNotExists(), (DmlPlan) dmlPlan, query, parseResult.isInfiniteRows(), planExecutor);
}
Aggregations