Search in sources :

Example 1 with CalciteConnectionConfigImpl

use of org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.config.CalciteConnectionConfigImpl in project drill by apache.

the class DrillCalciteCatalogReader method getConnectionConfig.

/**
 * Creates {@link CalciteConnectionConfigImpl} instance with specified caseSensitive property.
 *
 * @param caseSensitive is case sensitive.
 * @return {@link CalciteConnectionConfigImpl} instance
 */
private static CalciteConnectionConfigImpl getConnectionConfig(boolean caseSensitive) {
    Properties properties = new Properties();
    properties.setProperty(CalciteConnectionProperty.CASE_SENSITIVE.camelName(), String.valueOf(caseSensitive));
    return new CalciteConnectionConfigImpl(properties);
}
Also used : CalciteConnectionConfigImpl(org.apache.calcite.config.CalciteConnectionConfigImpl) Properties(java.util.Properties)

Example 2 with CalciteConnectionConfigImpl

use of org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.config.CalciteConnectionConfigImpl in project flink by apache.

the class FlinkCalciteCatalogReaderTest method init.

@Before
public void init() {
    rootSchemaPlus = CalciteSchema.createRootSchema(true, false).plus();
    Properties prop = new Properties();
    prop.setProperty(CalciteConnectionProperty.CASE_SENSITIVE.camelName(), "false");
    CalciteConnectionConfigImpl calciteConnConfig = new CalciteConnectionConfigImpl(prop);
    catalogReader = new FlinkCalciteCatalogReader(CalciteSchema.from(rootSchemaPlus), Collections.emptyList(), typeFactory, calciteConnConfig);
}
Also used : CalciteConnectionConfigImpl(org.apache.calcite.config.CalciteConnectionConfigImpl) Properties(java.util.Properties) Before(org.junit.Before)

Example 3 with CalciteConnectionConfigImpl

use of org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.config.CalciteConnectionConfigImpl in project hazelcast by hazelcast.

the class CalciteConfiguration method toConnectionConfig.

public CalciteConnectionConfig toConnectionConfig() {
    Properties connectionProperties = new Properties();
    connectionProperties.put(CalciteConnectionProperty.CASE_SENSITIVE.camelName(), Boolean.toString(caseSensitive));
    connectionProperties.put(CalciteConnectionProperty.UNQUOTED_CASING.camelName(), unquotedCasing.toString());
    connectionProperties.put(CalciteConnectionProperty.QUOTED_CASING.camelName(), quotedCasing.toString());
    connectionProperties.put(CalciteConnectionProperty.QUOTING.camelName(), quoting.toString());
    // Disable materializations to avoid NPE described in https://github.com/hazelcast/hazelcast/issues/17554
    connectionProperties.put(CalciteConnectionProperty.MATERIALIZATIONS_ENABLED.camelName(), Boolean.toString(false));
    return new CalciteConnectionConfigImpl(connectionProperties);
}
Also used : CalciteConnectionConfigImpl(org.apache.calcite.config.CalciteConnectionConfigImpl) Properties(java.util.Properties)

Example 4 with CalciteConnectionConfigImpl

use of org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.config.CalciteConnectionConfigImpl in project hive by apache.

the class CalcitePlanner method createPlanner.

private static RelOptPlanner createPlanner(HiveConf conf, Set<RelNode> corrScalarRexSQWithAgg, Set<RelNode> scalarAggNoGbyNoWin) {
    final Double maxSplitSize = (double) HiveConf.getLongVar(conf, HiveConf.ConfVars.MAPREDMAXSPLITSIZE);
    final Double maxMemory = (double) HiveConf.getLongVar(conf, HiveConf.ConfVars.HIVECONVERTJOINNOCONDITIONALTASKTHRESHOLD);
    HiveAlgorithmsConf algorithmsConf = new HiveAlgorithmsConf(maxSplitSize, maxMemory);
    HiveRulesRegistry registry = new HiveRulesRegistry();
    Properties calciteConfigProperties = new Properties();
    calciteConfigProperties.setProperty(CalciteConnectionProperty.TIME_ZONE.camelName(), conf.getLocalTimeZone().getId());
    calciteConfigProperties.setProperty(CalciteConnectionProperty.MATERIALIZATIONS_ENABLED.camelName(), Boolean.FALSE.toString());
    CalciteConnectionConfig calciteConfig = new CalciteConnectionConfigImpl(calciteConfigProperties);
    boolean isCorrelatedColumns = HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVE_STATS_CORRELATED_MULTI_KEY_JOINS);
    HivePlannerContext confContext = new HivePlannerContext(algorithmsConf, registry, calciteConfig, corrScalarRexSQWithAgg, scalarAggNoGbyNoWin, new HiveConfPlannerContext(isCorrelatedColumns));
    return HiveVolcanoPlanner.createPlanner(confContext);
}
Also used : CalciteConnectionConfigImpl(org.apache.calcite.config.CalciteConnectionConfigImpl) HivePlannerContext(org.apache.hadoop.hive.ql.optimizer.calcite.HivePlannerContext) HiveRulesRegistry(org.apache.hadoop.hive.ql.optimizer.calcite.rules.HiveRulesRegistry) CalciteConnectionConfig(org.apache.calcite.config.CalciteConnectionConfig) HiveConfPlannerContext(org.apache.hadoop.hive.ql.optimizer.calcite.HiveConfPlannerContext) QueryProperties(org.apache.hadoop.hive.ql.QueryProperties) Properties(java.util.Properties) HiveAlgorithmsConf(org.apache.hadoop.hive.ql.optimizer.calcite.cost.HiveAlgorithmsConf)

Example 5 with CalciteConnectionConfigImpl

use of org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.config.CalciteConnectionConfigImpl in project drill by axbaretto.

the class SqlConverter method getConnectionConfig.

/**
 * Creates {@link CalciteConnectionConfigImpl} instance with specified caseSensitive property.
 *
 * @param caseSensitive is case sensitive.
 * @return {@link CalciteConnectionConfigImpl} instance
 */
private static CalciteConnectionConfigImpl getConnectionConfig(boolean caseSensitive) {
    Properties properties = new Properties();
    properties.setProperty(CalciteConnectionProperty.CASE_SENSITIVE.camelName(), String.valueOf(caseSensitive));
    return new CalciteConnectionConfigImpl(properties);
}
Also used : CalciteConnectionConfigImpl(org.apache.calcite.config.CalciteConnectionConfigImpl) Properties(java.util.Properties)

Aggregations

Properties (java.util.Properties)13 CalciteConnectionConfigImpl (org.apache.calcite.config.CalciteConnectionConfigImpl)12 CalciteConnectionConfig (org.apache.calcite.config.CalciteConnectionConfig)4 Context (org.apache.calcite.plan.Context)4 RelOptPlanner (org.apache.calcite.plan.RelOptPlanner)2 HepProgram (org.apache.calcite.plan.hep.HepProgram)2 HepProgramBuilder (org.apache.calcite.plan.hep.HepProgramBuilder)2 CalciteCatalogReader (org.apache.calcite.prepare.CalciteCatalogReader)2 SchemaPlus (org.apache.calcite.schema.SchemaPlus)2 QueryProperties (org.apache.hadoop.hive.ql.QueryProperties)2 HiveConfPlannerContext (org.apache.hadoop.hive.ql.optimizer.calcite.HiveConfPlannerContext)2 HivePlannerContext (org.apache.hadoop.hive.ql.optimizer.calcite.HivePlannerContext)2 HiveAlgorithmsConf (org.apache.hadoop.hive.ql.optimizer.calcite.cost.HiveAlgorithmsConf)2 HiveRulesRegistry (org.apache.hadoop.hive.ql.optimizer.calcite.rules.HiveRulesRegistry)2 Test (org.junit.Test)2 StatementExecutionException (herddb.model.StatementExecutionException)1 ArrayList (java.util.ArrayList)1 CalciteConnectionConfigImpl (org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.config.CalciteConnectionConfigImpl)1 RelOptTable (org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.plan.RelOptTable)1 CalciteCatalogReader (org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.prepare.CalciteCatalogReader)1