[GLUTEN-4730][CH] feat: Support date_from_unix_date function: Add ClickHouse backend implementation#12410
Open
navaneethsujith09 wants to merge 5 commits into
Open
[GLUTEN-4730][CH] feat: Support date_from_unix_date function: Add ClickHouse backend implementation#12410navaneethsujith09 wants to merge 5 commits into
navaneethsujith09 wants to merge 5 commits into
Conversation
|
Run Gluten Clickhouse CI on x86 |
|
Failed to query issues imported from #12410: dial tcp 10.167.38.130:3306: connect: connection timed out |
|
Run Gluten Clickhouse CI on x86 |
…ith09/gluten into date-from-unix-date
|
Run Gluten Clickhouse CI on x86 |
lgbo-ustc
approved these changes
Jul 1, 2026
Contributor
|
|
Run Gluten Clickhouse CI on x86 |
Contributor
Author
|
@lgbo-ustc Ok, I think I have fixed the issue. Please let me know if anything else needs to be fixed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement SparkFunctionDateFromUnixDate in C++
Register function in CommonScalarFunctionParser
Add unit test in GlutenDateFunctionsSuite (Spark 3.5) for correctness
This enables Spark SQL queries using date_from_unix_date to work with the ClickHouse backend.
Implemented the feedback recieved from @taiyang-li
What changes are proposed in this pull request?
This pull request adds support for the date_from_unix_date function in the ClickHouse backend of Apache Gluten.
Specifically, it includes:
Implementation of the SparkFunctionDateFromUnixDate C++ function, which converts a unix date (number of days since epoch) to a Spark-compatible date.
Registration of the function in the ClickHouse function factory and the scalar function parser, enabling Substrait-to-ClickHouse translation.
Addition of unit tests in GlutenDateFunctionsSuite (Spark 3.5) to verify correctness and expected behavior.
How was this patch tested?
Added unit tests in gluten-ut/spark35/src/test/scala/org/apache/spark/sql/GlutenDateFunctionsSuite.scala to cover:
Typical values (e.g., date_from_unix_date(0) returns 1970-01-01)
Larger values (e.g., date_from_unix_date(1000) returns 1972-09-27)
Null handling (date_from_unix_date(null) returns null)
Ran the full test suite to ensure no regressions.
Was this patch authored or co-authored using generative AI tooling?
Generated-by Claude Opus 4.8
Related issue: #4730