neilconway opened a new pull request, #21208:
URL: https://github.com/apache/datafusion/pull/21208

   ## Which issue does this PR close?
   
   - Closes #21205.
   - Closes #21206.
   
   ## Rationale for this change
   
   This PR fixes two separate bugs in query decorrelation:
   
   1. When removing duplicate filters when pulling up `IN` subqueries, an 
operator precedence typo meant that we would consider two filters to be 
duplicates even if they involved different operators (e.g., `=` and `>`).
   2. When generating the `CASE` used to implement "count bug" handling, we 
generated identifiers that were not qualified by the alias of the subquery, 
which could have resulted in identifier conflicts with the parent query.
   
   The first issue could result in incorrect query results; the second would 
only cause spurious errors, as far as I can see.
   
   ## What changes are included in this PR?
   
   * Fix both bugs
   * Add SLT tests
   * Add a `debug_assert!` to document/check that `remove_duplicated_filter` is 
called with a commutative operator
   
   ## Are these changes tested?
   
   Yes.
   
   ## Are there any user-facing changes?
   
   Yes, in the sense that they both fix user-visible bugs.
   


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