datafusion icon indicating copy to clipboard operation
datafusion copied to clipboard

`to_char(.., null)` should be NULL, not `..`

Open alamb opened this issue 1 year ago • 2 comments

The newly added to_char's null handling is not quite correct -- specifically when the format string is null, the output should be null, but now it returns the first argument

Goal is to make to_char do what postgres does:

          Postgres seems to think this should be null
postgres=# select to_char(interval '1 day', null);
 to_char
---------

(1 row)

Originally posted by @alamb in https://github.com/apache/arrow-datafusion/pull/9181#discussion_r1487974457

alamb avatar Feb 13 '24 14:02 alamb

There are existing tests in timestamp.slt, this should simply be a matter of updating the code (see #9181) -- I think this would be a good first issue

alamb avatar Feb 13 '24 14:02 alamb

take

manoj-inukolunu avatar Feb 14 '24 08:02 manoj-inukolunu

@manoj-inukolunu Are you still working on this? (If not, could you please un-assign yourself. I'd like to attempt the fix for this issue)

tinfoil-knight avatar Mar 11 '24 20:03 tinfoil-knight

Hey so sorry not working on it right now , swamped with work .

manoj-inukolunu avatar Mar 13 '24 05:03 manoj-inukolunu

unassign

manoj-inukolunu avatar Mar 13 '24 05:03 manoj-inukolunu

take

tinfoil-knight avatar Mar 13 '24 10:03 tinfoil-knight