Convertlet that converts
and
.
Definition at line 1333 of file StandardConvertletTable.java.
RexNode org.apache.calcite.sql2rel.StandardConvertletTable.GreatestConvertlet.convertCall |
( |
SqlRexContext |
cx, |
|
|
SqlCall |
call |
|
) |
| |
|
inline |
Definition at line 1334 of file StandardConvertletTable.java.
References run_benchmark_import.type.
1349 final RexBuilder rexBuilder = cx.getRexBuilder();
1350 final RelDataType
type = cx.getValidator().getValidatedNodeType(call);
1351 final SqlBinaryOperator op;
1352 switch (call.getKind()) {
1354 op = SqlStdOperatorTable.GREATER_THAN;
1357 op = SqlStdOperatorTable.LESS_THAN;
1360 throw new AssertionError();
1363 cx, call.getOperandList(), SqlOperandTypeChecker.Consistency.NONE);
1364 final List<RexNode> list =
new ArrayList<>();
1365 final List<RexNode> orList =
new ArrayList<>();
1366 for (RexNode expr : exprs) {
1367 orList.add(rexBuilder.makeCall(SqlStdOperatorTable.IS_NULL, expr));
1369 list.add(RexUtil.composeDisjunction(rexBuilder, orList));
1370 list.add(rexBuilder.makeNullLiteral(
type));
1371 for (
int i = 0; i < exprs.size() - 1; i++) {
1372 RexNode expr = exprs.get(i);
1373 final List<RexNode> andList =
new ArrayList<>();
1374 for (
int j = i + 1; j < exprs.size(); j++) {
1375 final RexNode expr2 = exprs.get(j);
1376 andList.add(rexBuilder.makeCall(op, expr, expr2));
1378 list.add(RexUtil.composeConjunction(rexBuilder, andList));
1381 list.add(exprs.get(exprs.size() - 1));
1382 return rexBuilder.makeCall(
type, SqlStdOperatorTable.CASE, list);
static List< RexNode > convertExpressionList(SqlRexContext cx, List< SqlNode > nodes, SqlOperandTypeChecker.Consistency consistency)
The documentation for this class was generated from the following file: