Skip to content

Commit

Permalink
[CALCITE-5177] Query loses hint after decorrelation (minor follow-up)
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenada committed Jun 21, 2022
1 parent 9a102e7 commit 4a01c99
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions core/src/main/java/org/apache/calcite/plan/RelOptUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,10 @@ public static RelNode copyRelHints(RelNode originalRel, RelNode newRel) {
* or {@code newRel} directly if one of them are not {@link Hintable}
*/
public static RelNode copyRelHints(RelNode originalRel, RelNode newRel, boolean filterHints) {
if (originalRel == newRel && !filterHints) {
return originalRel;
}

if (originalRel instanceof Hintable
&& newRel instanceof Hintable
&& ((Hintable) originalRel).getHints().size() > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ protected final TrimResult dispatchTrimFields(
assert newFieldCount > 0 : "rel has no fields after trim: " + rel;
}
if (newRel.equals(rel)) {
return result(rel, mapping, rel);
return result(rel, mapping);
}
return trimResult;
}
Expand Down

0 comments on commit 4a01c99

Please sign in to comment.