Search in sources :

Example 1 with CreateJobPlan

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);
}
Also used : SqlCreateJob(com.hazelcast.jet.sql.impl.parse.SqlCreateJob) DmlPlan(com.hazelcast.jet.sql.impl.SqlPlanImpl.DmlPlan) QueryConvertResult(com.hazelcast.jet.sql.impl.parse.QueryConvertResult) CreateJobPlan(com.hazelcast.jet.sql.impl.SqlPlanImpl.CreateJobPlan) QueryParseResult(com.hazelcast.jet.sql.impl.parse.QueryParseResult) SqlNode(org.apache.calcite.sql.SqlNode)

Aggregations

CreateJobPlan (com.hazelcast.jet.sql.impl.SqlPlanImpl.CreateJobPlan)1 DmlPlan (com.hazelcast.jet.sql.impl.SqlPlanImpl.DmlPlan)1 QueryConvertResult (com.hazelcast.jet.sql.impl.parse.QueryConvertResult)1 QueryParseResult (com.hazelcast.jet.sql.impl.parse.QueryParseResult)1 SqlCreateJob (com.hazelcast.jet.sql.impl.parse.SqlCreateJob)1 SqlNode (org.apache.calcite.sql.SqlNode)1