zabetak opened a new pull request, #4253:
URL: https://github.com/apache/hive/pull/4253

   ### What changes were proposed in this pull request?
   1. Add new pruning rules to remove correlate when inputs are empty. 
   2. Refactor pruning rules for join to remove code duplication with the 
addition of new rules.
   
   ### Why are the changes needed?
   Avoid redundant occurrences of `LogicalCorrelate` in the plan that cannot be 
handled by the compiler and may lead to exceptions and complation failures.
   
   ### Does this PR introduce _any_ user-facing change?
   Fixes some queries that fail at compile time.
   
   ```sql
   EXPLAIN CBO SELECT id FROM t1 WHERE NULL IN (SELECT NULL FROM t2 where t1.id 
= t2.id);
   ```
   **Before**
   ```
   HiveProject(id=[$0])
     LogicalCorrelate(correlation=[$cor0], joinType=[semi], 
requiredColumns=[{}])
       HiveTableScan(table=[[default, t1]], table:alias=[t1])
       HiveValues(tuples=[[]])
   ```
   **After**
   ```
   HiveValues(tuples=[[]])
   ```
   
   
   ### How was this patch tested?
   ```
   mvn test -Dtest=TestMiniLlapLocalCliDriver -Dqfile_regex=.*subquery.*
   mvn test -Dtest=TestMiniLlapLocalCliDriver -Dqfile_regex=empty.*
   ```


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