Visitar URL original
[GLUTEN-10134][VL] Map try_make_timestamp to Velox's try_make_timestamp by rdtr · Pull Request #13188 · apache/gluten · GitHub
Skip to content

[GLUTEN-10134][VL] Map try_make_timestamp to Velox's try_make_timestamp - #13188

Open
rdtr wants to merge 1 commit into
apache:mainfrom
rdtr:make-timestamp-try
Open

rdtr wants to merge 1 commit into
apache:mainfrom
rdtr:make-timestamp-try

Conversation

@rdtr

@rdtr rdtr commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

What changes are proposed in this pull request?

try_make_timestamp and try_make_timestamp_ltz become MakeTimestamp with failOnError = false, which returns NULL for invalid input even in ANSI mode. Gluten mapped every MakeTimestamp to Velox's make_timestamp, which throws when ANSI mode is enabled, so with spark.gluten.sql.ansiFallback.enabled=false these functions threw instead of returning NULL.

This PR maps MakeTimestamp with failOnError = false and a TIMESTAMP result to Velox's try_make_timestamp, which never throws for invalid input. Velox registers try_make_timestamp for TIMESTAMP results only, so TIMESTAMP_NTZ results keep the current mapping.

Related issue: #10134 (TryMakeTimestampLTZExpressionBuilder)

How was this patch tested?

Added a test to ArithmeticAnsiValidateSuite (ANSI mode on, ANSI fallback off, Spark 4.0+): try_make_timestamp and try_make_timestamp_ltz return NULL for an invalid month and run in Velox, while make_timestamp still throws. Passed on Spark 4.1. Without the change, the new test fails.

Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 5.5)

try_make_timestamp and try_make_timestamp_ltz become MakeTimestamp with
failOnError = false, which returns NULL for invalid input even in ANSI
mode. Gluten mapped every MakeTimestamp to Velox's make_timestamp, which
throws when ANSI mode is enabled.

Map MakeTimestamp with failOnError = false and a TIMESTAMP result to
Velox's try_make_timestamp, which never throws for invalid input.
@github-actions github-actions Bot added CORE works for Gluten Core VELOX labels Oct 3, 2026
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CORE works for Gluten Core VELOX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant