kasakrisz commented on code in PR #6360:
URL: https://github.com/apache/hive/pull/6360#discussion_r2960012253


##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveRelDecorrelator.java:
##########
@@ -461,16 +458,6 @@ public Frame decorrelateRel(Sort rel) {
             frame.corDefOutputs);
   }
 
-  /**
-   * Rewrites a {@link Values}.
-   *
-   * @param rel Values to be rewritten
-   */
-  public Frame decorrelateRel(Values rel) {
-    // There are no inputs, so rel does not need to be changed.
-    return null;
-  }
-

Review Comment:
   Yes. We need these rules.
   The query in the test added along with these rules
   ```
   SELECT id FROM t1 WHERE NULL IN (SELECT NULL FROM t2 where t1.id = t2.id);
   ```
    has a plan
   ```
   HiveProject(id=[$0])
     LogicalCorrelate(correlation=[$cor0], joinType=[semi], 
requiredColumns=[{}])
       HiveTableScan(table=[[default, t1]], table:alias=[t1])
       HiveValues(tuples=[[]])
   ```
   The decorrelator doesn't find any `CorrelateId` in the right (Values) and 
abort decorrelation
   
https://github.com/apache/hive/blob/d55885ee5ef5036c3371ccd46cd46fa20715a58e/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveRelDecorrelator.java#L1241-L1253
   



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to