Skip to content

fix: support more java.time inputs in timestamp parsing - #4139

Merged
chenlica merged 3 commits into
apache:mainfrom
carloea2:fix/date_types
Dec 29, 2025
Merged

chenlica merged 3 commits into
apache:mainfrom
carloea2:fix/date_types

Conversation

@carloea2

@carloea2 carloea2 commented Dec 28, 2025 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

  • Added support in parseTimestamp(fieldValue: Any) for additional java.time input types:

    • LocalDateTime → Timestamp.valueOf(ldt)
    • Instant → Timestamp.from(inst)
    • OffsetDateTime → Timestamp.from(odt.toInstant)
    • ZonedDateTime → Timestamp.from(zdt.toInstant)
    • LocalDate → Timestamp.valueOf(ld.atStartOfDay())

Any related issues, documentation, discussions?

How was this PR tested?

  • Added unit tests covering the new java.time cases for timestamp parsing:

    • Positive cases for LocalDateTime, Instant, OffsetDateTime, ZonedDateTime, and LocalDate
    • Negative case verifying unsupported/invalid inputs throw AttributeTypeException

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

No

@carloea2 carloea2 changed the title v1 fix: Support more java.time inputs in timestamp parsing Dec 28, 2025
@chenlica
chenlica requested a review from bobbai00 December 28, 2025 20:18
@chenlica

Copy link
Copy Markdown
Contributor

@bobbai00 Please review this PR.

@bobbai00 bobbai00 changed the title fix: Support more java.time inputs in timestamp parsing fix: support more java.time inputs in timestamp parsing Dec 28, 2025

@bobbai00 bobbai00 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Left few minor comments

@carloea2

Copy link
Copy Markdown
Contributor Author

Thanks. Done.

@chenlica

Copy link
Copy Markdown
Contributor

@bobbai00 Can we merge this PR now?

@carloea2

Copy link
Copy Markdown
Contributor Author

@chenlica can you approve the workflows to run?

@chenlica

Copy link
Copy Markdown
Contributor

@carloea2 There is a failed check. Please look into it.

@carloea2

Copy link
Copy Markdown
Contributor Author

It should be fine now..

@carloea2

Copy link
Copy Markdown
Contributor Author

@chenlica Done.

@chenlica
chenlica merged commit acca01d into apache:main Dec 29, 2025
@chenlica

Copy link
Copy Markdown
Contributor

@carloea2 Please mention the related issue and close that issue as well.

@carloea2

carloea2 commented Dec 29, 2025 •

Copy link
Copy Markdown
Contributor Author

I do not have permission to close issues, can you do that? thanks

I also added the issue to the PR description.

@chenlica

Copy link
Copy Markdown
Contributor

I closed the issue.

carloea2 added a commit to carloea2/texera that referenced this pull request Jan 6, 2026
### What changes were proposed in this PR?

* Added support in `parseTimestamp(fieldValue: Any)` for additional
`java.time` input types:

  * `LocalDateTime` → `Timestamp.valueOf(ldt)`
  * `Instant` → `Timestamp.from(inst)`
  * `OffsetDateTime` → `Timestamp.from(odt.toInstant)`
  * `ZonedDateTime` → `Timestamp.from(zdt.toInstant)`
  * `LocalDate` → `Timestamp.valueOf(ld.atStartOfDay())`

### Any related issues, documentation, discussions?

* N/A.

### How was this PR tested?

* Added unit tests covering the new `java.time` cases for timestamp
parsing:

* Positive cases for `LocalDateTime`, `Instant`, `OffsetDateTime`,
`ZonedDateTime`, and `LocalDate`
* Negative case verifying unsupported/invalid inputs throw
`AttributeTypeException`

### Was this PR authored or co-authored using generative AI tooling?

No
SarahAsad23 pushed a commit to madisonmlin/texera that referenced this pull request May 20, 2026
### What changes were proposed in this PR?

* Added support in `parseTimestamp(fieldValue: Any)` for additional
`java.time` input types:

  * `LocalDateTime` → `Timestamp.valueOf(ldt)`
  * `Instant` → `Timestamp.from(inst)`
  * `OffsetDateTime` → `Timestamp.from(odt.toInstant)`
  * `ZonedDateTime` → `Timestamp.from(zdt.toInstant)`
  * `LocalDate` → `Timestamp.valueOf(ld.atStartOfDay())`

### Any related issues, documentation, discussions?

* N/A.

### How was this PR tested?

* Added unit tests covering the new `java.time` cases for timestamp
parsing:

* Positive cases for `LocalDateTime`, `Instant`, `OffsetDateTime`,
`ZonedDateTime`, and `LocalDate`
* Negative case verifying unsupported/invalid inputs throw
`AttributeTypeException`

### Was this PR authored or co-authored using generative AI tooling?

No
yangzhang75 pushed a commit to yangzhang75/texera that referenced this pull request Jun 22, 2026
### What changes were proposed in this PR?

* Added support in `parseTimestamp(fieldValue: Any)` for additional
`java.time` input types:

  * `LocalDateTime` → `Timestamp.valueOf(ldt)`
  * `Instant` → `Timestamp.from(inst)`
  * `OffsetDateTime` → `Timestamp.from(odt.toInstant)`
  * `ZonedDateTime` → `Timestamp.from(zdt.toInstant)`
  * `LocalDate` → `Timestamp.valueOf(ld.atStartOfDay())`

### Any related issues, documentation, discussions?

* N/A.

### How was this PR tested?

* Added unit tests covering the new `java.time` cases for timestamp
parsing:

* Positive cases for `LocalDateTime`, `Instant`, `OffsetDateTime`,
`ZonedDateTime`, and `LocalDate`
* Negative case verifying unsupported/invalid inputs throw
`AttributeTypeException`

### Was this PR authored or co-authored using generative AI tooling?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DateTime backend exception following User Defined Function

3 participants