Aaaaaaron commented on a change in pull request #1495:
URL: https://github.com/apache/calcite/pull/1495#discussion_r457800490
##########
File path: core/src/main/java/org/apache/calcite/sql2rel/RelFieldTrimmer.java
##########
@@ -697,14 +699,22 @@ public TrimResult trimFields(
/**
* Variant of {@link #trimFields(RelNode, ImmutableBitSet, Set)} for
- * {@link org.apache.calcite.rel.core.SetOp} (including UNION and UNION ALL).
+ * {@link org.apache.calcite.rel.core.SetOp} (Only UNION ALL is supported).
+ * @deprecated Use {@link #trimFields(Union, ImmutableBitSet, Set)}.
*/
+ @Deprecated // to be removed before 2.0
public TrimResult trimFields(
SetOp setOp,
ImmutableBitSet fieldsUsed,
Set<RelDataTypeField> extraFields) {
final RelDataType rowType = setOp.getRowType();
final int fieldCount = rowType.getFieldCount();
+
+ // Trim fields only for UNION ALL
+ if (setOp.kind != SqlKind.UNION || !setOp.all) {
Review comment:
We handle union below, this condition here seems weird.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]