use of com.hazelcast.jet.sql.impl.opt.logical.LogicalRel in project hazelcast by hazelcast.
the class OptimizerTestSupport method optimizePhysicalInternal.
private static Result optimizePhysicalInternal(String sql, OptimizerContext context) {
LogicalRel logicalRel = optimizeLogicalInternal(sql, context);
PhysicalRel physicalRel = (PhysicalRel) context.optimize(logicalRel, PhysicalRules.getRuleSet(), OptUtils.toPhysicalConvention(logicalRel.getTraitSet()));
return new Result(logicalRel, physicalRel);
}
use of com.hazelcast.jet.sql.impl.opt.logical.LogicalRel in project hazelcast by hazelcast.
the class OptimizerTestSupport method optimizeLogicalInternal.
private static LogicalRel optimizeLogicalInternal(String sql, OptimizerContext context) {
QueryParseResult parseResult = context.parse(sql);
RelNode rel = context.convert(parseResult.getNode()).getRel();
return (LogicalRel) context.optimize(rel, LogicalRules.getRuleSet(), OptUtils.toLogicalConvention(rel.getTraitSet()));
}
use of com.hazelcast.jet.sql.impl.opt.logical.LogicalRel in project hazelcast by hazelcast.
the class CalciteSqlOptimizer method optimize.
private PhysicalRel optimize(QueryParameterMetadata parameterMetadata, RelNode rel, OptimizerContext context, boolean isCreateJob) {
context.setParameterMetadata(parameterMetadata);
context.setRequiresJob(isCreateJob);
boolean fineLogOn = logger.isFineEnabled();
if (fineLogOn) {
logger.fine("Before logical opt:\n" + RelOptUtil.toString(rel));
}
LogicalRel logicalRel = optimizeLogical(context, rel);
if (fineLogOn) {
logger.fine("After logical opt:\n" + RelOptUtil.toString(logicalRel));
}
detectStandaloneImposeOrder(logicalRel);
PhysicalRel physicalRel = optimizePhysical(context, logicalRel);
if (fineLogOn) {
logger.fine("After physical opt:\n" + RelOptUtil.toString(physicalRel));
}
return physicalRel;
}
Aggregations