Commit 139b0b4
authored
feat : support spark compatible int to timestamp cast (#20555)
## Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax. For example
`Closes #123` indicates that this PR will close issue #123.
-->
- Closes #20554
Ref : #20555
## Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly
in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand
your changes and offer better suggestions for fixes.
-->
## What changes are included in this PR?
1. Created a new cast scalar UDF to support int to timestamp casts
(spark compatible). The goal is to leverage this is as an entry point
for all spark compatible / df incompatible casts
<!--
There is no need to duplicate the description in the issue here but it
is sometimes worth providing a summary of the individual changes in this
PR.
-->
## Are these changes tested?
1. Yes (through series of unit tests testing various edge cases like
overflow , null input etc)
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
3. Serve as another way to document the expected behavior of the code
If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?
-->
## Are there any user-facing changes?
1. Yes. We are bringing in ability to leverage spark compatible cast
operations in DF through `spark_cast` as a first step. Next step would
be to make changes to the planner to leverage spark compatible cast
instead of regular cast operations
<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.
-->
<!--
If there are any breaking changes to public APIs, please add the `api
change` label.
-->1 parent 78820c5 commit 139b0b4
3 files changed
Lines changed: 928 additions & 2 deletions
File tree
- datafusion
- spark/src/function/conversion
- sqllogictest/test_files/spark/conversion
0 commit comments