本文整理汇总了Java中org.apache.calcite.plan.RelOptPredicateList.EMPTY属性的典型用法代码示例。如果您正苦于以下问题:Java RelOptPredicateList.EMPTY属性的具体用法?Java RelOptPredicateList.EMPTY怎么用?Java RelOptPredicateList.EMPTY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.calcite.plan.RelOptPredicateList
的用法示例。
在下文中一共展示了RelOptPredicateList.EMPTY属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPredicates
/** @see RelMetadataQuery#getPulledUpPredicates(RelNode) */
public RelOptPredicateList getPredicates(RelSubset r,
RelMetadataQuery mq) {
if (!Bug.CALCITE_1048_FIXED) {
return RelOptPredicateList.EMPTY;
}
final RexBuilder rexBuilder = r.getCluster().getRexBuilder();
RelOptPredicateList list = null;
for (RelNode r2 : r.getRels()) {
RelOptPredicateList list2 = mq.getPulledUpPredicates(r2);
if (list2 != null) {
list = list == null ? list2 : list.union(rexBuilder, list2);
}
}
return Util.first(list, RelOptPredicateList.EMPTY);
}
示例2: create
@Deprecated // to be removed before 2.0
public static RexProgramBuilder create(
RexBuilder rexBuilder,
final RelDataType inputRowType,
final List<RexNode> exprList,
final List<? extends RexNode> projectList,
final RexNode condition,
final RelDataType outputRowType,
boolean normalize,
boolean simplify_) {
RexSimplify simplify = null;
if (simplify_) {
simplify = new RexSimplify(rexBuilder, RelOptPredicateList.EMPTY, false,
RexUtil.EXECUTOR);
}
return new RexProgramBuilder(rexBuilder, inputRowType, exprList,
projectList, condition, outputRowType, normalize, simplify);
}
示例3: normalize
@Deprecated // to be removed before 2.0
public RexProgram normalize(RexBuilder rexBuilder, boolean simplify) {
final RelOptPredicateList predicates = RelOptPredicateList.EMPTY;
return normalize(rexBuilder, simplify
? new RexSimplify(rexBuilder, predicates, false, RexUtil.EXECUTOR)
: null);
}
示例4: setUp
@Before
public void setUp() {
typeFactory = new JavaTypeFactoryImpl(RelDataTypeSystem.DEFAULT);
rexBuilder = new RexBuilder(typeFactory);
RexExecutor executor =
new RexExecutorImpl(new DummyTestDataContext());
simplify =
new RexSimplify(rexBuilder, RelOptPredicateList.EMPTY, false, executor);
trueLiteral = rexBuilder.makeLiteral(true);
falseLiteral = rexBuilder.makeLiteral(false);
final RelDataType intType = typeFactory.createSqlType(SqlTypeName.INTEGER);
nullLiteral = rexBuilder.makeNullLiteral(intType);
unknownLiteral = rexBuilder.makeNullLiteral(trueLiteral.getType());
}
示例5: getAllPredicates
/**
* Extract predicates for a table scan.
*/
public RelOptPredicateList getAllPredicates(TableScan table, RelMetadataQuery mq) {
return RelOptPredicateList.EMPTY;
}
示例6: RelBuilder
protected RelBuilder(Context context, RelOptCluster cluster,
RelOptSchema relOptSchema) {
this.cluster = cluster;
this.relOptSchema = relOptSchema;
if (context == null) {
context = Contexts.EMPTY_CONTEXT;
}
this.simplify = Hook.REL_BUILDER_SIMPLIFY.get(true);
this.aggregateFactory =
Util.first(context.unwrap(RelFactories.AggregateFactory.class),
RelFactories.DEFAULT_AGGREGATE_FACTORY);
this.filterFactory =
Util.first(context.unwrap(RelFactories.FilterFactory.class),
RelFactories.DEFAULT_FILTER_FACTORY);
this.projectFactory =
Util.first(context.unwrap(RelFactories.ProjectFactory.class),
RelFactories.DEFAULT_PROJECT_FACTORY);
this.sortFactory =
Util.first(context.unwrap(RelFactories.SortFactory.class),
RelFactories.DEFAULT_SORT_FACTORY);
this.setOpFactory =
Util.first(context.unwrap(RelFactories.SetOpFactory.class),
RelFactories.DEFAULT_SET_OP_FACTORY);
this.joinFactory =
Util.first(context.unwrap(RelFactories.JoinFactory.class),
RelFactories.DEFAULT_JOIN_FACTORY);
this.semiJoinFactory =
Util.first(context.unwrap(RelFactories.SemiJoinFactory.class),
RelFactories.DEFAULT_SEMI_JOIN_FACTORY);
this.correlateFactory =
Util.first(context.unwrap(RelFactories.CorrelateFactory.class),
RelFactories.DEFAULT_CORRELATE_FACTORY);
this.valuesFactory =
Util.first(context.unwrap(RelFactories.ValuesFactory.class),
RelFactories.DEFAULT_VALUES_FACTORY);
this.scanFactory =
Util.first(context.unwrap(RelFactories.TableScanFactory.class),
RelFactories.DEFAULT_TABLE_SCAN_FACTORY);
this.matchFactory =
Util.first(context.unwrap(RelFactories.MatchFactory.class),
RelFactories.DEFAULT_MATCH_FACTORY);
final RexExecutor executor =
Util.first(context.unwrap(RexExecutor.class),
Util.first(cluster.getPlanner().getExecutor(), RexUtil.EXECUTOR));
final RelOptPredicateList predicates = RelOptPredicateList.EMPTY;
this.simplifier =
new RexSimplify(cluster.getRexBuilder(), predicates, false, executor);
this.simplifierUnknownAsFalse =
new RexSimplify(cluster.getRexBuilder(), predicates, true, executor);
}
示例7: RexSimplify
@Deprecated // to be removed before 2.0
public RexSimplify(RexBuilder rexBuilder, boolean unknownAsFalse,
RexExecutor executor) {
this(rexBuilder, RelOptPredicateList.EMPTY, unknownAsFalse, executor);
}
示例8: registerInternal
/**
* Registers an expression in the list of common sub-expressions, and
* returns a reference to that expression.
*
* <p>If an equivalent sub-expression already exists, creates another
* expression only if <code>force</code> is true.
*
* @param expr Expression to register
* @param force Whether to create a new sub-expression if an equivalent
* sub-expression exists.
*/
private RexLocalRef registerInternal(RexNode expr, boolean force) {
final RexSimplify simplify =
new RexSimplify(rexBuilder, RelOptPredicateList.EMPTY, false,
RexUtil.EXECUTOR);
expr = simplify.simplify(expr);
RexLocalRef ref;
final Pair<String, String> key;
if (expr instanceof RexLocalRef) {
key = null;
ref = (RexLocalRef) expr;
} else {
key = RexUtil.makeKey(expr);
ref = exprMap.get(key);
}
if (ref == null) {
if (validating) {
validate(
expr,
exprList.size());
}
// Add expression to list, and return a new reference to it.
ref = addExpr(expr);
exprMap.put(key, ref);
} else {
if (force) {
// Add expression to list, but return the previous ref.
addExpr(expr);
}
}
for (;;) {
int index = ref.index;
final RexNode expr2 = exprList.get(index);
if (expr2 instanceof RexLocalRef) {
ref = (RexLocalRef) expr2;
} else {
return ref;
}
}
}
示例9: Fixture
public Fixture() {
typeFactory = new JavaTypeFactoryImpl(RelDataTypeSystem.DEFAULT);
rexBuilder = new RexBuilder(typeFactory);
boolRelDataType = typeFactory.createJavaType(Boolean.class);
intRelDataType = typeFactory.createJavaType(Integer.class);
decRelDataType = typeFactory.createJavaType(Double.class);
longRelDataType = typeFactory.createJavaType(Long.class);
shortDataType = typeFactory.createJavaType(Short.class);
byteDataType = typeFactory.createJavaType(Byte.class);
floatDataType = typeFactory.createJavaType(Float.class);
charDataType = typeFactory.createJavaType(Character.class);
dateDataType = typeFactory.createJavaType(Date.class);
timestampDataType = typeFactory.createJavaType(Timestamp.class);
timeDataType = typeFactory.createJavaType(Time.class);
stringDataType = typeFactory.createJavaType(String.class);
bl = ref(0, this.boolRelDataType);
i = ref(1, intRelDataType);
dec = ref(2, decRelDataType);
lg = ref(3, longRelDataType);
sh = ref(4, shortDataType);
by = ref(5, byteDataType);
fl = ref(6, floatDataType);
ch = ref(7, charDataType);
d = ref(8, dateDataType);
ts = ref(9, timestampDataType);
t = ref(10, timeDataType);
str = ref(11, stringDataType);
rowType = typeFactory.builder()
.add("bool", this.boolRelDataType)
.add("int", intRelDataType)
.add("dec", decRelDataType)
.add("long", longRelDataType)
.add("short", shortDataType)
.add("byte", byteDataType)
.add("float", floatDataType)
.add("char", charDataType)
.add("date", dateDataType)
.add("timestamp", timestampDataType)
.add("time", timeDataType)
.add("string", stringDataType)
.build();
final Holder<RexExecutorImpl> holder = Holder.of(null);
Frameworks.withPrepare(
new Frameworks.PrepareAction<Void>() {
public Void apply(RelOptCluster cluster,
RelOptSchema relOptSchema,
SchemaPlus rootSchema,
CalciteServerStatement statement) {
DataContext dataContext =
Schemas.createDataContext(statement.getConnection(), rootSchema);
holder.set(new RexExecutorImpl(dataContext));
return null;
}
});
executor = holder.get();
simplify =
new RexSimplify(rexBuilder, RelOptPredicateList.EMPTY, false,
executor);
checker = new RexImplicationChecker(rexBuilder, executor, rowType);
}