Search in sources :

Example 1 with LogicalRel

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);
}
Also used : PhysicalRel(com.hazelcast.jet.sql.impl.opt.physical.PhysicalRel) LogicalRel(com.hazelcast.jet.sql.impl.opt.logical.LogicalRel) QueryParseResult(com.hazelcast.jet.sql.impl.parse.QueryParseResult)

Example 2 with LogicalRel

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()));
}
Also used : RelNode(org.apache.calcite.rel.RelNode) LogicalRel(com.hazelcast.jet.sql.impl.opt.logical.LogicalRel) QueryParseResult(com.hazelcast.jet.sql.impl.parse.QueryParseResult)

Example 3 with LogicalRel

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;
}
Also used : SelectByKeyMapPhysicalRel(com.hazelcast.jet.sql.impl.opt.physical.SelectByKeyMapPhysicalRel) SinkMapPhysicalRel(com.hazelcast.jet.sql.impl.opt.physical.SinkMapPhysicalRel) DeleteByKeyMapPhysicalRel(com.hazelcast.jet.sql.impl.opt.physical.DeleteByKeyMapPhysicalRel) InsertMapPhysicalRel(com.hazelcast.jet.sql.impl.opt.physical.InsertMapPhysicalRel) UpdateByKeyMapPhysicalRel(com.hazelcast.jet.sql.impl.opt.physical.UpdateByKeyMapPhysicalRel) PhysicalRel(com.hazelcast.jet.sql.impl.opt.physical.PhysicalRel) LogicalRel(com.hazelcast.jet.sql.impl.opt.logical.LogicalRel)

Aggregations

LogicalRel (com.hazelcast.jet.sql.impl.opt.logical.LogicalRel)3 PhysicalRel (com.hazelcast.jet.sql.impl.opt.physical.PhysicalRel)2 QueryParseResult (com.hazelcast.jet.sql.impl.parse.QueryParseResult)2 DeleteByKeyMapPhysicalRel (com.hazelcast.jet.sql.impl.opt.physical.DeleteByKeyMapPhysicalRel)1 InsertMapPhysicalRel (com.hazelcast.jet.sql.impl.opt.physical.InsertMapPhysicalRel)1 SelectByKeyMapPhysicalRel (com.hazelcast.jet.sql.impl.opt.physical.SelectByKeyMapPhysicalRel)1 SinkMapPhysicalRel (com.hazelcast.jet.sql.impl.opt.physical.SinkMapPhysicalRel)1 UpdateByKeyMapPhysicalRel (com.hazelcast.jet.sql.impl.opt.physical.UpdateByKeyMapPhysicalRel)1 RelNode (org.apache.calcite.rel.RelNode)1