本文整理汇总了Java中org.apache.calcite.rex.RexCall.isA方法的典型用法代码示例。如果您正苦于以下问题:Java RexCall.isA方法的具体用法?Java RexCall.isA怎么用?Java RexCall.isA使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.calcite.rex.RexCall
的用法示例。
在下文中一共展示了RexCall.isA方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitCall
import org.apache.calcite.rex.RexCall; //导入方法依赖的package包/类
@Override public RexNode visitCall(RexCall rexCall) {
if (rexCall.isA(SqlKind.CAST)) {
RexNode input = rexCall.getOperands().get(0).accept(this);
RelDataType targetType = removeDistinct(rexCall.getType());
return rexBuilder.makeCast(
targetType,
input);
}
if (!rexCall.isA(SqlKind.COMPARISON)) {
return super.visitCall(rexCall);
}
RexNode lhs = rexCall.getOperands().get(0);
if (!lhs.getType().isStruct()) {
// NOTE jvs 9-Mar-2005: Calls like IS NULL operate
// on the representative null indicator. Since it comes
// first, we don't have to do any special translation.
return super.visitCall(rexCall);
}
// NOTE jvs 22-Mar-2005: Likewise, the null indicator takes
// care of comparison null semantics without any special casing.
return flattenComparison(
rexBuilder,
rexCall.getOperator(),
rexCall.getOperands());
}
示例2: visitCall
import org.apache.calcite.rex.RexCall; //导入方法依赖的package包/类
public Double visitCall(RexCall call) {
Double distinctRowCount;
Double rowCount = mq.getRowCount(rel);
if (call.isA(SqlKind.MINUS_PREFIX)) {
distinctRowCount = cardOfProjExpr(mq, rel, call.getOperands().get(0));
} else if (call.isA(ImmutableList.of(SqlKind.PLUS, SqlKind.MINUS))) {
Double card0 = cardOfProjExpr(mq, rel, call.getOperands().get(0));
if (card0 == null) {
return null;
}
Double card1 = cardOfProjExpr(mq, rel, call.getOperands().get(1));
if (card1 == null) {
return null;
}
distinctRowCount = Math.max(card0, card1);
} else if (call.isA(ImmutableList.of(SqlKind.TIMES, SqlKind.DIVIDE))) {
distinctRowCount =
NumberUtil.multiply(
cardOfProjExpr(mq, rel, call.getOperands().get(0)),
cardOfProjExpr(mq, rel, call.getOperands().get(1)));
// TODO zfong 6/21/06 - Broadbase has code to handle date
// functions like year, month, day; E.g., cardinality of Month()
// is 12
} else {
if (call.getOperands().size() == 1) {
distinctRowCount = cardOfProjExpr(mq, rel, call.getOperands().get(0));
} else {
distinctRowCount = rowCount / 10;
}
}
return numDistinctVals(distinctRowCount, rowCount);
}
示例3: isConstructor
import org.apache.calcite.rex.RexCall; //导入方法依赖的package包/类
private boolean isConstructor(RexNode rexNode) {
// TODO jvs 11-Feb-2005: share code with SqlToRelConverter
if (!(rexNode instanceof RexCall)) {
return false;
}
RexCall call = (RexCall) rexNode;
return call.getOperator().getName().equalsIgnoreCase("row")
|| (call.isA(SqlKind.NEW_SPECIFICATION));
}
示例4: canExpand
import org.apache.calcite.rex.RexCall; //导入方法依赖的package包/类
public boolean canExpand(RexCall call) {
return call.isA(SqlKind.REINTERPRET)
&& call.operands.get(0).isA(SqlKind.REINTERPRET);
}