Creates a SOME sub-query. There is no ALL. For x comparison ALL (sub-query) use instead NOT (x inverse-comparison SOME (sub-query)). If comparison is > then negated-comparison is <=, and so forth. Also =SOME is rewritten into IN
(RelNode rel, ImmutableList<RexNode> nodes,
SqlQuantifyOperator op)
| 64 | * |
| 65 | * <p>Also =SOME is rewritten into IN */ |
| 66 | public static RexSubQuery some(RelNode rel, ImmutableList<RexNode> nodes, |
| 67 | SqlQuantifyOperator op) { |
| 68 | assert op.kind == SqlKind.SOME; |
| 69 | |
| 70 | if (op == SqlStdOperatorTable.SOME_EQ) { |
| 71 | return RexSubQuery.in(rel, nodes); |
| 72 | } |
| 73 | final RelDataType type = type(rel, nodes); |
| 74 | return new RexSubQuery(type, op, nodes, rel); |
| 75 | } |
| 76 | |
| 77 | static RelDataType type(RelNode rel, ImmutableList<RexNode> nodes) { |
| 78 | assert rel.getRowType().getFieldCount() == nodes.size(); |
no test coverage detected