dmitry-chirkov-dremio opened a new pull request, #55609:
URL: https://github.com/apache/arrow/pull/55609

   ### Rationale for this change
   
   `ExprValidator` checks the value list of `IN` but not its input expression. 
An `IF` with an `int32` condition is rejected alone and accepted under `IN`. A 
null input crashes `Projector::Make` with SIGSEGV.
   
   ### What changes are included in this PR?
   
   This PR currently contains only the tests. On main, one of them fails and 
two crash with SIGSEGV. They are expected to fail until the fix commit is 
pushed. The fix is in `expr_validator.cc` and `node.h` and comes as the second 
commit.
   
   The fix: `ValidateInExpression` checks that the input and its type are not 
null, and visits the input. `InExpressionNode::ToString()` prints `null` for a 
null input, so the cache key does not crash before validation.
   
   ### Are these changes tested?
   
   Yes. The new tests cover invalid, null and untyped input for all `IN` value 
types, with `Projector::Make` and `Filter::Make`. They fail or crash before the 
fix and pass afterward.
   
   ### Are there any user-facing changes?
   
   `Make` now returns `ExpressionValidationError` for an `IN` with an invalid 
or null input. Before, it accepted it or crashed.
   
   **This PR contains a "Critical Fix".** It fixes a crash. `Projector::Make` 
and `Filter::Make` die with SIGSEGV (exit code 139) when the input expression 
of an `IN` node is null. The null pointer is dereferenced in 
`InExpressionNode::ToString()`, which the cache key calls before the validator 
runs. Both `Make` calls now return `ExpressionValidationError`.
   
   ### Was AI used for this PR?
   
   AI tools helped investigate the bug and write the fix, tests, and 
description.
   
   **PR code and description written by:**
   - [ ] Human
   - [x] AI
   
   **Reviewed before submission by:**
   - [ ] Human
   - [ ] AI
   - [ ] Not reviewed
   


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

Reply via email to