MartinKolbAtWork commented on PR #12227:
URL: https://github.com/apache/datafusion/pull/12227#issuecomment-2320255117
> Thanks @MartinKolbAtWork for your contribution
>
> I just checked we do have an issue with `to_date` function whereas the
`cast` works correctly
>
> ```
> > select extract(day from cast('9999-12-31' as date));
> +-------------------------------------------+
> | date_part(Utf8("DAY"),Utf8("9999-12-31")) |
> +-------------------------------------------+
> | 31.0 |
> +-------------------------------------------+
> 1 row(s) fetched.
> Elapsed 0.005 seconds.
>
> > select to_date('9999-12-31');
> Arrow error: Parser error: The dates that can be represented as
nanoseconds have to be between 1677-09-21T00:12:44.0 and
2262-04-11T23:47:16.854775804
> ```
>
> Perhaps we can use a the same implementation like CAST does(reuse it)
instead of creating a new impl
The main thing of "to_date" is that is supports supplying a format string.
As CAST does not support this, I don't think merging or re-using these two
implementations is an approach that should be pursued.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]