You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/10/27 17:24:32 UTC

[GitHub] [arrow-datafusion] alamb edited a comment on issue #1179: Comparisons to literal NULL don't work

alamb edited a comment on issue #1179:
URL: https://github.com/apache/arrow-datafusion/issues/1179#issuecomment-953146820


   > Hey @alamb did you start working on this?
   > I might otherwise check it out how this is handled - maybe before / in the weekend.
   
   Thanks @Dandandan  and @Jimexist  -- yes I have started working on this, and came up with something simple (#1181) and uncovered a bunch of other work 
   
   > To introduce ScalarValue::Null and use that instead for Value::Null.
   > Return DataType::Null as type for ScalarValue::Null
   > Implement the rest of changes in coercion as needed.
   
   Yes I agree that would be the ideal solution -- I tried a variant of that (basically made `ScalarValue::get_datatype()` return DataType::Null if `ScalarValue::is_null()` and taught the coercion logic about it for binary operators).  However, I have since abandoned that approach in the near term.
   
   The biggest problem I hit was that the arrow-rs cast kernels doesn't support casting from `Null` -> other_type -- I will be filing a ticket shortly for that.
   
   I also found that functions and binary expressions don't share the same coercion logic and that many other expressions / operators don't actually try to coerce their arguments at all (e.g. try running a query like `select case when NULL then 'foo' else 'bar' end;`)
   
   I'll also be filing tickets for those items as well


-- 
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-unsubscribe@arrow.apache.org

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