本文整理了Java中org.apache.calcite.runtime.Hook.propertyJ()
方法的一些代码示例,展示了Hook.propertyJ()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hook.propertyJ()
方法的具体详情如下:
包路径:org.apache.calcite.runtime.Hook
类名称:Hook
方法名:propertyJ
[英]Returns a function that, when a hook is called, will "return" a given value. (Because of the way hooks work, it "returns" the value by writing into a Holder.
[中]返回一个函数,当调用钩子时,该函数将“返回”给定值。(由于挂钩的工作方式,它通过写入持有者来“返回”值。
代码示例来源:origin: Qihoo360/Quicksql
/** Adds a property hook. */
public <V> AssertQuery withProperty(Hook hook, V value) {
return withHook(hook, Hook.propertyJ(value));
}
代码示例来源:origin: org.apache.calcite/calcite-core
/** Adds a property hook. */
public <V> AssertQuery withProperty(Hook hook, V value) {
return withHook(hook, Hook.propertyJ(value));
}
代码示例来源:origin: org.apache.calcite/calcite-core
public <V> Sql withProperty(Hook hook, V value) {
return withHook(hook, Hook.propertyJ(value));
}
代码示例来源:origin: Qihoo360/Quicksql
public <V> Sql withProperty(Hook hook, V value) {
return withHook(hook, Hook.propertyJ(value));
}
代码示例来源:origin: org.apache.calcite/calcite-core
@Test public <T> void testReduceCaseNullabilityChange() throws Exception {
HepProgram program = new HepProgramBuilder()
.addRuleInstance(ReduceExpressionsRule.FILTER_INSTANCE)
.addRuleInstance(ReduceExpressionsRule.PROJECT_INSTANCE)
.build();
try (Hook.Closeable a = Hook.REL_BUILDER_SIMPLIFY.add(Hook.propertyJ(false))) {
checkPlanning(program,
"select case when empno = 1 then 1 when 1 IS NOT NULL then 2 else null end as qx "
+ "from emp");
}
}
代码示例来源:origin: Qihoo360/Quicksql
final boolean b = value instanceof Boolean
&& (Boolean) value;
closer.add(Hook.ENABLE_BINDABLE.addThread(Hook.propertyJ(b)));
代码示例来源:origin: org.apache.calcite/calcite-core
final boolean b = value instanceof Boolean
&& (Boolean) value;
closer.add(Hook.ENABLE_BINDABLE.addThread(Hook.propertyJ(b)));
代码示例来源:origin: org.apache.drill.exec/drill-java-exec
public RelRoot toRel(final SqlNode validatedNode) {
if (planner == null) {
planner = new VolcanoPlanner(costFactory, settings);
planner.setExecutor(new DrillConstExecutor(functions, util, settings));
planner.clearRelTraitDefs();
planner.addRelTraitDef(ConventionTraitDef.INSTANCE);
planner.addRelTraitDef(DrillDistributionTraitDef.INSTANCE);
planner.addRelTraitDef(RelCollationTraitDef.INSTANCE);
}
if (cluster == null) {
initCluster();
}
final SqlToRelConverter sqlToRelConverter =
new SqlToRelConverter(new Expander(), validator, catalog, cluster, DrillConvertletTable.INSTANCE,
sqlToRelConverterConfig);
/*
* Sets value to false to avoid simplifying project expressions
* during creating new projects since it may cause changing data mode
* which causes to assertion errors during type validation
*/
Hook.REL_BUILDER_SIMPLIFY.add(Hook.propertyJ(false));
//To avoid unexpected column errors set a value of top to false
final RelRoot rel = sqlToRelConverter.convertQuery(validatedNode, false, false);
return rel.withRel(sqlToRelConverter.flattenTypes(rel.rel, true));
}
内容来源于网络,如有侵权,请联系作者删除!