本文整理汇总了Java中org.apache.calcite.sql.SqlKind.NOT属性的典型用法代码示例。如果您正苦于以下问题:Java SqlKind.NOT属性的具体用法?Java SqlKind.NOT怎么用?Java SqlKind.NOT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.calcite.sql.SqlKind
的用法示例。
在下文中一共展示了SqlKind.NOT属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: popOpStackAndBuildFilter
private void popOpStackAndBuildFilter() {
// Parsing a special expression; handled holistically by the parent
if (holisticExpression > 0) {
return;
}
OpState currentOp = opStack.pop();
int size = currentOp.getChildren().size();
RexNode newFilter = null;
if (size >= 1) {
if (size == 1 && currentOp.getOp() instanceof SqlBinaryOperator) {
/* The only operator for which we allow partial pushes is AND.
* For all other operators we clear the children if one of the
* children is a no push.
*/
if (currentOp.getOp().getKind() == SqlKind.AND) {
newFilter = currentOp.getChildren().get(0);
for (OpState opState : opStack) {
if (opState.getOp().getKind() == SqlKind.NOT) {
//AND under NOT should not get pushed
newFilter = null;
}
}
}
} else {
newFilter = builder.makeCall(currentOp.getOp(), currentOp.getChildren());
}
}
if (newFilter != null) {
// add this new filter to my parent boolean operator's children
if (!opStack.isEmpty()) {
OpState parentOp = opStack.peek();
parentOp.addChild(newFilter);
} else {
resultCondition = newFilter;
}
}
}
示例2: notFn
/** Returns a function that applies NOT to its argument. */
public static Function<RexNode, RexNode> notFn(final RexBuilder rexBuilder) {
return new Function<RexNode, RexNode>() {
public RexNode apply(RexNode input) {
return input.isAlwaysTrue()
? rexBuilder.makeLiteral(false)
: input.isAlwaysFalse()
? rexBuilder.makeLiteral(true)
: input.getKind() == SqlKind.NOT
? ((RexCall) input).operands.get(0)
: rexBuilder.makeCall(SqlStdOperatorTable.NOT, input);
}
};
}