use of com.hazelcast.jet.sql.impl.schema.HazelcastSchema in project hazelcast by hazelcast.
the class OptimizerTestSupport method optimizeLogical.
protected RelNode optimizeLogical(String sql, HazelcastTable... tables) {
HazelcastSchema schema = schema(tables);
OptimizerContext context = context(schema);
return optimizeLogicalInternal(sql, context);
}
use of com.hazelcast.jet.sql.impl.schema.HazelcastSchema in project hazelcast by hazelcast.
the class OptimizerTestSupport method context.
private static OptimizerContext context(HazelcastSchema schema, QueryDataType... parameterTypes) {
OptimizerContext context = OptimizerContext.create(HazelcastSchemaUtils.createCatalog(schema), QueryUtils.prepareSearchPaths(null, null), emptyList(), 1, name -> null);
ParameterConverter[] parameterConverters = IntStream.range(0, parameterTypes.length).mapToObj(i -> new StrictParameterConverter(i, SqlParserPos.ZERO, parameterTypes[i])).toArray(ParameterConverter[]::new);
QueryParameterMetadata parameterMetadata = new QueryParameterMetadata(parameterConverters);
context.setParameterMetadata(parameterMetadata);
return context;
}
use of com.hazelcast.jet.sql.impl.schema.HazelcastSchema in project hazelcast by hazelcast.
the class OptimizerTestSupport method optimizeLogical.
protected RelNode optimizeLogical(String sql, boolean requiresJob, HazelcastTable... tables) {
HazelcastSchema schema = schema(tables);
OptimizerContext context = context(schema);
context.setRequiresJob(requiresJob);
return optimizeLogicalInternal(sql, context);
}
use of com.hazelcast.jet.sql.impl.schema.HazelcastSchema in project hazelcast by hazelcast.
the class OptimizerTestSupport method optimizePhysical.
protected Result optimizePhysical(String sql, List<QueryDataType> parameterTypes, HazelcastTable... tables) {
HazelcastSchema schema = schema(tables);
OptimizerContext context = context(schema, parameterTypes.toArray(new QueryDataType[0]));
return optimizePhysicalInternal(sql, context);
}
Aggregations