jayzhan211 commented on PR #14283:
URL: https://github.com/apache/datafusion/pull/14283#issuecomment-2613677877

   In the unit test `issue_14277`, we can see that the `then` is 
`ScalarValue::Null`. What is the reason it is not `ScalarValue::In32(None)`?
   
   ```rust
   let then = Arc::new(Literal::new(ScalarValue::Null));
   ```
   
   I suggest adding this test to SLT since it runs end-to-end, ensuring the 
arguments passed through the function are as expected. For example, in this 
case, I think we should convert then from ScalarValue::Null to 
ScalarValue::Int32(None) rather than handling ScalarValue::Null—unless we find 
a test case in SLT that confirms we need to handle this scenario.
   
   Here is the example, and the `then_value` we got is `Scalar(Int32(NULL))` 
not `Scalar(NULL)`
   ```
   statement ok
   create table foo (a int, b int) as values (1, 2), (3, 4), (5, 6), (null, 
null), (6, null), (null, 7);
   
   query I
   SELECT CASE WHEN a is null THEN null ELSE b END FROM foo
   ----
   2
   4
   6
   NULL
   NULL
   NULL
   ```
   


-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to