use of 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);
}
use of 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);
}
use of 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);
}
use of 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);
}
use of 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);
}
Aggregations