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_CBO_STATS_CORRELATED_MULTI_KEY_JOINS); boolean heuristicMaterializationStrategy = HiveConf.getVar(conf, HiveConf.ConfVars.HIVE_MATERIALIZED_VIEW_REWRITING_SELECTION_STRATEGY).equals("heuristic"); HivePlannerContext confContext = new HivePlannerContext(algorithmsConf, registry, calciteConfig, corrScalarRexSQWithAgg, scalarAggNoGbyNoWin, new HiveConfPlannerContext(isCorrelatedColumns, heuristicMaterializationStrategy)); return HiveVolcanoPlanner.createPlanner(confContext); }
public <T> T parserFactory(Class<T> parserFactoryClass, T defaultParserFactory) { return CalciteConnectionProperty.PARSER_FACTORY.wrap(properties) .getPlugin(parserFactoryClass, defaultParserFactory); }
@Override protected Collection<ConnectionProperty> getConnectionProperties() { final List<ConnectionProperty> list = new ArrayList<>(); Collections.addAll(list, BuiltInConnectionProperty.values()); Collections.addAll(list, CalciteConnectionProperty.values()); return list; }
public PropEnv wrap(Properties properties) { return new PropEnv(parse2(properties, NAME_TO_PROPS), this); }
public SqlConformance conformance() { return CalciteConnectionProperty.CONFORMANCE.wrap(properties) .getEnum(SqlConformanceEnum.class); } }
@Override protected Collection<ConnectionProperty> getConnectionProperties() { final List<ConnectionProperty> list = new ArrayList<>(); Collections.addAll(list, BuiltInConnectionProperty.values()); Collections.addAll(list, CalciteConnectionProperty.values()); return list; }
public PropEnv wrap(Properties properties) { return new PropEnv(parse2(properties, NAME_TO_PROPS), this); }
properties.put(CalciteConnectionProperty.LEX.camelName(), Lex.MYSQL_ANSI.name());
public <T> T schemaFactory(Class<T> schemaFactoryClass, T defaultSchemaFactory) { return CalciteConnectionProperty.SCHEMA_FACTORY.wrap(properties) .getPlugin(schemaFactoryClass, defaultSchemaFactory); }
@Override protected Collection<ConnectionProperty> getConnectionProperties() { final List<ConnectionProperty> list = new ArrayList<ConnectionProperty>(); Collections.addAll(list, BuiltInConnectionProperty.values()); Collections.addAll(list, CalciteConnectionProperty.values()); return list; }
properties.put(CalciteConnectionProperty.LEX.camelName(), Lex.MYSQL_ANSI.name());
public boolean approximateDistinctCount() { return CalciteConnectionProperty.APPROXIMATE_DISTINCT_COUNT.wrap(properties) .getBoolean(); }
/** Returns a copy of this configuration with one property changed. */ public CalciteConnectionConfigImpl set(CalciteConnectionProperty property, String value) { final Properties properties1 = new Properties(properties); properties1.setProperty(property.camelName(), value); return new CalciteConnectionConfigImpl(properties1); }
public NullCollation defaultNullCollation() { return CalciteConnectionProperty.DEFAULT_NULL_COLLATION.wrap(properties) .getEnum(NullCollation.class, NullCollation.HIGH); }
/** Returns a copy of this configuration with one property changed. */ public CalciteConnectionConfigImpl set(CalciteConnectionProperty property, String value) { final Properties properties1 = new Properties(properties); properties1.setProperty(property.camelName(), value); return new CalciteConnectionConfigImpl(properties1); }
public <T> T schemaFactory(Class<T> schemaFactoryClass, T defaultSchemaFactory) { return CalciteConnectionProperty.SCHEMA_FACTORY.wrap(properties) .getPlugin(schemaFactoryClass, defaultSchemaFactory); }
/** * 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); } }
public SqlConformance conformance() { return CalciteConnectionProperty.CONFORMANCE.wrap(properties) .getEnum(SqlConformanceEnum.class); } }
PropBuilder set(CalciteConnectionProperty p, String v) { properties.setProperty(p.camelName(), v); return this; }
public boolean createMaterializations() { return CalciteConnectionProperty.CREATE_MATERIALIZATIONS.wrap(properties) .getBoolean(); }