Skip to content

Conversation

@uros-db
Copy link
Contributor

@uros-db uros-db commented Aug 18, 2025

What changes were proposed in this pull request?

In the PR, I propose to extend the try_make_timestamp_ltz function, and accept a date and time fields.

Syntax

try_make_timestamp_ltz(date[, time])

Arguments

  • date: A date expression.
  • time: A time expression.

Returns
A TIMESTAMP_LTZ.

Examples

> SELECT try_make_timestamp_ltz(DATE'2014-12-28', TIME'6:30:45.887');
 2014-12-28 06:30:45.887

Why are the changes needed?

Users will be able to create a timestamp with local time zone by combining a time and a date.

Does this PR introduce any user-facing change?

Yes, this extends try_make_timestamp_ltz to accept additional kinds of inputs.

How was this patch tested?

Added new e2e SQL tests in corresponding golden files.

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

No.

@github-actions github-actions bot added the SQL label Aug 18, 2025
@uros-db uros-db changed the title Support the time type by try_make_timestamp_ltz() [SPARK-53319][SQL] Support the time type by try_make_timestamp_ltz() Aug 18, 2025
@uros-db
Copy link
Contributor Author

uros-db commented Aug 27, 2025

Since this PR is essentially a sibling of #52062, @jcw024 please take a look.

@uros-db uros-db requested a review from jcw024 August 28, 2025 09:47
@jcw024
Copy link

jcw024 commented Aug 29, 2025

changes look good, but I see the build is failing. Seems like it could be a transient issue, can you try rerunning the build?

[info] org.apache.spark.sql.jdbc.v2.OracleIntegrationSuite *** ABORTED *** (10 minutes, 27 seconds)
[info]   The code passed to eventually never returned normally. Attempted 597 times over 10.013027888883332 minutes. Last failure message: ORA-12541: Cannot connect. No listener at host 10.1.0.179 port 46213. (CONNECTION_ID=tVMC8FrXRXCxzbqeGvL7pw==)

@uros-db
Copy link
Contributor Author

uros-db commented Aug 29, 2025

Docker Integration failure looks unrelated to these changes, re-running to confirm.

Copy link

@jcw024 jcw024 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes LGTM!

@jcw024
Copy link

jcw024 commented Aug 30, 2025

cc @cloud-fan for review

@uros-db
Copy link
Contributor Author

uros-db commented Oct 13, 2025

@cloud-fan Please review.

@cloud-fan
Copy link
Contributor

thanks, merging to master!

@cloud-fan cloud-fan closed this in 4a62f75 Oct 22, 2025
huangxiaopingRD pushed a commit to huangxiaopingRD/spark that referenced this pull request Nov 25, 2025
### What changes were proposed in this pull request?
In the PR, I propose to extend the `try_make_timestamp_ltz` function, and accept a date and time fields.

**Syntax**
```
try_make_timestamp_ltz(date[, time])
```

**Arguments**

- `date`: A date expression.
- `time`: A time expression.

**Returns**
A `TIMESTAMP_LTZ`.

Examples
```
> SELECT try_make_timestamp_ltz(DATE'2014-12-28', TIME'6:30:45.887');
 2014-12-28 06:30:45.887
```

### Why are the changes needed?
Users will be able to create a timestamp with local time zone by combining a time and a date.

### Does this PR introduce _any_ user-facing change?
Yes, this extends `try_make_timestamp_ltz` to accept additional kinds of inputs.

### How was this patch tested?
Added new e2e SQL tests in corresponding golden files.

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

Closes apache#52063 from uros-db/try_make_timestamp_ltz.

Lead-authored-by: Uros Bojanic <[email protected]>
Co-authored-by: Wenchen Fan <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants