Skip to content

Commit

Permalink
chore: update to substrait v0.57.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kadinrabo committed Oct 2, 2024
1 parent f22b3d0 commit f9c61fe
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
2 changes: 2 additions & 0 deletions core/src/main/java/io/substrait/relation/Set.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ public abstract class Set extends AbstractRel implements HasExtension {
public static enum SetOp {
UNKNOWN(SetRel.SetOp.SET_OP_UNSPECIFIED),
MINUS_PRIMARY(SetRel.SetOp.SET_OP_MINUS_PRIMARY),
MINUS_PRIMARY_ALL(SetRel.SetOp.SET_OP_MINUS_PRIMARY_ALL),
MINUS_MULTISET(SetRel.SetOp.SET_OP_MINUS_MULTISET),
INTERSECTION_PRIMARY(SetRel.SetOp.SET_OP_INTERSECTION_PRIMARY),
INTERSECTION_MULTISET(SetRel.SetOp.SET_OP_INTERSECTION_MULTISET),
INTERSECTION_MULTISET_ALL(SetRel.SetOp.SET_OP_INTERSECTION_MULTISET_ALL),
UNION_DISTINCT(SetRel.SetOp.SET_OP_UNION_DISTINCT),
UNION_ALL(SetRel.SetOp.SET_OP_UNION_ALL);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,10 @@ public RelNode visit(Set set) throws RuntimeException {
var builder =
switch (set.getSetOp()) {
case MINUS_PRIMARY -> relBuilder.minus(false, numInputs);
case MINUS_MULTISET -> relBuilder.minus(true, numInputs);
case INTERSECTION_PRIMARY -> relBuilder.intersect(false, numInputs);
case INTERSECTION_MULTISET -> relBuilder.intersect(true, numInputs);
case MINUS_PRIMARY_ALL, MINUS_MULTISET -> relBuilder.minus(true, numInputs);
case INTERSECTION_PRIMARY, INTERSECTION_MULTISET -> relBuilder.intersect(
false, numInputs);
case INTERSECTION_MULTISET_ALL -> relBuilder.intersect(true, numInputs);
case UNION_DISTINCT -> relBuilder.union(false, numInputs);
case UNION_ALL -> relBuilder.union(true, numInputs);
case UNKNOWN -> throw new UnsupportedOperationException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,15 @@ public Rel visit(org.apache.calcite.rel.core.Union union) {
@Override
public Rel visit(org.apache.calcite.rel.core.Intersect intersect) {
var inputs = apply(intersect.getInputs());
var setOp = intersect.all ? Set.SetOp.INTERSECTION_MULTISET : Set.SetOp.INTERSECTION_PRIMARY;
var setOp =
intersect.all ? Set.SetOp.INTERSECTION_MULTISET_ALL : Set.SetOp.INTERSECTION_MULTISET;
return Set.builder().inputs(inputs).setOp(setOp).build();
}

@Override
public Rel visit(org.apache.calcite.rel.core.Minus minus) {
var inputs = apply(minus.getInputs());
var setOp = minus.all ? Set.SetOp.MINUS_MULTISET : Set.SetOp.MINUS_PRIMARY;
var setOp = minus.all ? Set.SetOp.MINUS_PRIMARY_ALL : Set.SetOp.MINUS_PRIMARY;
return Set.builder().inputs(inputs).setOp(setOp).build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public static String getSetQuery(Set.SetOp op, boolean multi) {
String opString =
switch (op) {
case MINUS_PRIMARY -> "EXCEPT";
case MINUS_MULTISET -> "EXCEPT ALL";
case INTERSECTION_PRIMARY -> "INTERSECT";
case INTERSECTION_MULTISET -> "INTERSECT ALL";
case MINUS_PRIMARY_ALL, MINUS_MULTISET -> "EXCEPT ALL";
case INTERSECTION_PRIMARY, INTERSECTION_MULTISET -> "INTERSECT";
case INTERSECTION_MULTISET_ALL -> "INTERSECT ALL";
case UNION_DISTINCT -> "UNION";
case UNION_ALL -> "UNION ALL";
case UNKNOWN -> throw new UnsupportedOperationException(
Expand Down

0 comments on commit f9c61fe

Please sign in to comment.