Tabnine Logo
CalciteConnectionProperty.camelName
Code IndexAdd Tabnine to your IDE (free)

How to use
camelName
method
in
org.apache.calcite.config.CalciteConnectionProperty

Best Java code snippets using org.apache.calcite.config.CalciteConnectionProperty.camelName (Showing top 20 results out of 315)

origin: apache/hive

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);
}
origin: apache/nifi

properties.put(CalciteConnectionProperty.LEX.camelName(), Lex.MYSQL_ANSI.name());
origin: apache/nifi

properties.put(CalciteConnectionProperty.LEX.camelName(), Lex.MYSQL_ANSI.name());
origin: org.apache.calcite/calcite-core

/** 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);
}
origin: Qihoo360/Quicksql

/** 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);
}
origin: org.apache.drill.exec/drill-java-exec

 /**
  * 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);
 }
}
origin: Qihoo360/Quicksql

PropBuilder set(CalciteConnectionProperty p, String v) {
 properties.setProperty(p.camelName(), v);
 return this;
}
origin: org.apache.calcite/calcite-core

PropBuilder set(CalciteConnectionProperty p, String v) {
 properties.setProperty(p.camelName(), v);
 return this;
}
origin: Qihoo360/Quicksql

/**
 * Initializes a container then calls user-specified code with a planner
 * and statement.
 *
 * @param action Callback containing user-specified code
 * @return Return value from action
 */
public static <R> R withPrepare(PrepareAction<R> action) {
 try {
  final Properties info = new Properties();
  if (action.config.getTypeSystem() != RelDataTypeSystem.DEFAULT) {
   info.setProperty(CalciteConnectionProperty.TYPE_SYSTEM.camelName(),
     action.config.getTypeSystem().getClass().getName());
  }
  Connection connection =
    DriverManager.getConnection("jdbc:calcite:", info);
  final CalciteServerStatement statement =
    connection.createStatement()
      .unwrap(CalciteServerStatement.class);
  return new CalcitePrepareImpl().perform(statement, action);
 } catch (Exception e) {
  throw new RuntimeException(e);
 }
}
origin: com.alibaba.blink/flink-sql-parser

private CalciteCatalogReader createCatalogReader() {
  SchemaPlus rootSchema = FlinkPlannerImpl.rootSchema(this.defaultSchema);
  Properties prop = new Properties();
  prop.setProperty(CalciteConnectionProperty.CASE_SENSITIVE.camelName(),
    String.valueOf(parserConfig.caseSensitive()));
  CalciteConnectionConfig connectionConfig = new CalciteConnectionConfigImpl(prop);
  return new CalciteCatalogReader(
    CalciteSchema.from(rootSchema),
    CalciteSchema.from(this.defaultSchema).path(null),
    this.typeFactory,
    connectionConfig);
}
origin: Qihoo360/Quicksql

private CalciteCatalogReader createCatalogReader() {
 final SchemaPlus rootSchema = rootSchema(defaultSchema);
 final Context context = config.getContext();
 final CalciteConnectionConfig connectionConfig;
 if (context != null) {
  connectionConfig = context.unwrap(CalciteConnectionConfig.class);
 } else {
  Properties properties = new Properties();
  properties.setProperty(CalciteConnectionProperty.CASE_SENSITIVE.camelName(),
      String.valueOf(parserConfig.caseSensitive()));
  connectionConfig = new CalciteConnectionConfigImpl(properties);
 }
 return new CalciteCatalogReader(
   CalciteSchema.from(rootSchema),
   CalciteSchema.from(defaultSchema).path(null),
   typeFactory, connectionConfig);
}
origin: org.apache.calcite/calcite-core

private CalciteCatalogReader createCatalogReader() {
 final SchemaPlus rootSchema = rootSchema(defaultSchema);
 final Context context = config.getContext();
 final CalciteConnectionConfig connectionConfig;
 if (context != null) {
  connectionConfig = context.unwrap(CalciteConnectionConfig.class);
 } else {
  Properties properties = new Properties();
  properties.setProperty(CalciteConnectionProperty.CASE_SENSITIVE.camelName(),
      String.valueOf(parserConfig.caseSensitive()));
  connectionConfig = new CalciteConnectionConfigImpl(properties);
 }
 return new CalciteCatalogReader(
   CalciteSchema.from(rootSchema),
   CalciteSchema.from(defaultSchema).path(null),
   typeFactory, connectionConfig);
}
origin: org.apache.calcite/calcite-druid

private CalciteAssert.AssertQuery approxQuery(URL url, String sql) {
 return CalciteAssert.that()
   .enable(enabled())
   .withModel(url)
   .with(CalciteConnectionProperty.APPROXIMATE_DISTINCT_COUNT.camelName(), true)
   .with(CalciteConnectionProperty.APPROXIMATE_TOP_N.camelName(), true)
   .with(CalciteConnectionProperty.APPROXIMATE_DECIMAL.camelName(), true)
   .query(sql);
}
origin: com.alibaba.blink/flink-sql-parser

  public static BlinkRelBuilder create(FrameworkConfig config) {
    JavaTypeFactory typeFactory = new JavaTypeFactoryImpl(config.getTypeSystem());

    VolcanoPlanner planner = new VolcanoPlanner(config.getCostFactory(), Contexts.empty());
    planner.setExecutor(config.getExecutor());
    planner.addRelTraitDef(ConventionTraitDef.INSTANCE);

    RelOptCluster cluster = RelOptCluster.create(planner, new RexBuilder(typeFactory));
    CalciteSchema calciteSchema = CalciteSchema.from(config.getDefaultSchema());
    Properties prop = new Properties();
    prop.setProperty(CalciteConnectionProperty.CASE_SENSITIVE.camelName(),
      String.valueOf(config.getParserConfig().caseSensitive()));
    CalciteConnectionConfig connectionConfig = new CalciteConnectionConfigImpl(prop);
    RelOptSchema relOptSchema = new CalciteCatalogReader(
      calciteSchema,
      CalciteSchema.from(config.getDefaultSchema()).path(null),
      typeFactory,
      connectionConfig);

    return new BlinkRelBuilder(config.getContext(), cluster, relOptSchema);
  }
}
origin: Qihoo360/Quicksql

/** Test case for
 * <a href="https://issues.apache.org/jira/browse/CALCITE-2323">[CALCITE-2323]
 * Validator should allow alternative nullCollations for ORDER BY in
 * OVER</a>. */
@Test public void testUserDefinedOrderByOver() {
 String sql = "select deptno,\n"
   + "  rank() over(partition by empno order by deptno)\n"
   + "from emp\n"
   + "order by row_number() over(partition by empno order by deptno)";
 Properties properties = new Properties();
 properties.setProperty(
   CalciteConnectionProperty.DEFAULT_NULL_COLLATION.camelName(),
   NullCollation.LOW.name());
 CalciteConnectionConfigImpl connectionConfig =
   new CalciteConnectionConfigImpl(properties);
 TesterImpl tester = new TesterImpl(getDiffRepos(), false, false, true, false,
   null, null, SqlToRelConverter.Config.DEFAULT,
   SqlConformanceEnum.DEFAULT, Contexts.of(connectionConfig));
 sql(sql).with(tester).ok();
}
origin: org.apache.calcite/calcite-core

/** Test case for
 * <a href="https://issues.apache.org/jira/browse/CALCITE-2323">[CALCITE-2323]
 * Validator should allow alternative nullCollations for ORDER BY in
 * OVER</a>. */
@Test public void testUserDefinedOrderByOver() {
 String sql = "select deptno,\n"
   + "  rank() over(partition by empno order by deptno)\n"
   + "from emp\n"
   + "order by row_number() over(partition by empno order by deptno)";
 Properties properties = new Properties();
 properties.setProperty(
   CalciteConnectionProperty.DEFAULT_NULL_COLLATION.camelName(),
   NullCollation.LOW.name());
 CalciteConnectionConfigImpl connectionConfig =
   new CalciteConnectionConfigImpl(properties);
 TesterImpl tester = new TesterImpl(getDiffRepos(), false, false, true, false,
   null, null, SqlToRelConverter.Config.DEFAULT,
   SqlConformanceEnum.DEFAULT, Contexts.of(connectionConfig));
 sql(sql).with(tester).ok();
}
origin: org.apache.calcite/calcite-druid

private void testCountWithApproxDistinct(boolean approx, String sql, String expectedExplain,
                     String expectedDruidQuery) {
 CalciteAssert.that()
   .enable(enabled())
   .withModel(FOODMART)
   .with(CalciteConnectionProperty.APPROXIMATE_DISTINCT_COUNT.camelName(), approx)
   .query(sql)
   .runs()
   .explainContains(expectedExplain)
   .queryContains(druidChecker(expectedDruidQuery));
}
origin: org.apache.calcite/calcite-druid

@Test
public void testExtractYearFilterExpression() {
 final String sql = "SELECT count(*) from \"foodmart\" WHERE"
     + " EXTRACT(YEAR from \"timestamp\") + 1 > 1997";
 final String filterPart1 = "'filter':{'type':'expression','expression':"
     + "'((timestamp_extract(\\'__time\\'";
 final String filterTimezoneName = "America/Los_Angeles";
 CalciteAssert.that()
   .enable(enabled())
   .withModel(FOODMART)
   .with(CalciteConnectionProperty.TIME_ZONE.camelName(), filterTimezoneName)
   .query(sql)
   .runs()
   .returnsOrdered("EXPR$0=86712")
   .queryContains(druidChecker(filterPart1, filterTimezoneName));
}
origin: org.apache.calcite/calcite-druid

@Test
public void testExtractMonthFilterExpression() {
 final String sql = "SELECT count(*) from \"foodmart\" WHERE"
     + " EXTRACT(MONTH from \"timestamp\") + 1 = 02";
 final String filterPart1 = "'filter':{'type':'expression','expression':"
     + "'((timestamp_extract(\\'__time\\'";
 final String filterTimezoneName = "America/Los_Angeles";
 CalciteAssert.that()
   .enable(enabled())
   .withModel(FOODMART)
   .with(CalciteConnectionProperty.TIME_ZONE.camelName(), filterTimezoneName)
   .query(sql)
   .runs()
   .returnsOrdered("EXPR$0=7043")
   .queryContains(druidChecker(filterPart1, filterTimezoneName, "MONTH", "== 2"));
}
origin: org.apache.calcite/calcite-druid

@Test public void testFloorToDateRangeWithTimeZone() {
 final String sql = "Select cast(floor(\"timestamp\" to MONTH) as timestamp) as t from "
   + "\"foodmart\" where floor(\"timestamp\" to MONTH) >= '1997-05-01 00:00:00 Asia/Kolkata' "
   + "and floor(\"timestamp\" to MONTH) < '1997-05-02 00:00:00 Asia/Kolkata' order by t"
   + " limit 1";
 final String druidQuery = "{\"queryType\":\"scan\",\"dataSource\":\"foodmart\",\"intervals\":"
   + "[\"1997-04-30T18:30:00.000Z/1997-05-31T18:30:00.000Z\"],\"virtualColumns\":[{\"type\":"
   + "\"expression\",\"name\":\"vc\",\"expression\":\"timestamp_parse";
 CalciteAssert.that()
   .enable(enabled())
   .withModel(FOODMART)
   .with(CalciteConnectionProperty.TIME_ZONE.camelName(), "Asia/Kolkata")
   .query(sql)
   .runs()
   .queryContains(druidChecker(druidQuery))
   .returnsOrdered("T=1997-05-01 00:00:00");
}
org.apache.calcite.configCalciteConnectionPropertycamelName

Popular methods of CalciteConnectionProperty

  • values
  • parse2
    Fixed version of org.apache.calcite.avatica.ConnectionConfigImpl#parseuntil we upgrade Avatica.
  • wrap
  • name

Popular in Java

  • Making http requests using okhttp
  • notifyDataSetChanged (ArrayAdapter)
  • setScale (BigDecimal)
  • getApplicationContext (Context)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Runner (org.openjdk.jmh.runner)
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now