You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2023/06/18 10:58:22 UTC

[GitHub] [arrow-datafusion] alamb commented on issue #6701: `date_trunc(null)` results in a panic

alamb commented on issue #6701:
URL: https://github.com/apache/arrow-datafusion/issues/6701#issuecomment-1596100597

   > I've tried to remove the unwrap() like specify in the issue, but nano is an Option, so removing the unwrap just creates errors. So is it better to catch the error and return null or replacing unwrap() by unwrap_or_default() which return "1970-01-01T00:00:00"?
   
   I think what is needed is to ignore nulls (so that null comes out)
   
   something like `nano.map(|nano| truncate(nano))`
   
   So rather than `unwrap` use `map` to only do the calculation of `nano` is non null
   
   If you make a PR with some example code I can probably offer some more specific advice


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