Skip to content

Add VARCHAR ↔ TIMESTAMPUTC cast support#1992

Open
Mariamalmesfer wants to merge 1 commit into
ts_ntz_ibmfrom
ts-ntz-cast-string
Open

Add VARCHAR ↔ TIMESTAMPUTC cast support#1992
Mariamalmesfer wants to merge 1 commit into
ts_ntz_ibmfrom
ts-ntz-cast-string

Conversation

@Mariamalmesfer
Copy link
Copy Markdown
Collaborator

@Mariamalmesfer Mariamalmesfer commented May 5, 2026

Add CastOperator for TimestampUtcType. Supports casting from/to VARCHAR — parsing ignores timezone in the input string and formatting skips session timezone. Registered through CustomTypeFactory under "TIMESTAMP UTC".

@Mariamalmesfer
Copy link
Copy Markdown
Collaborator Author

Hi @rui-mo, can you take a look at this? If it looks good, I have a draft corresponding Gluten PR ready to open. apache/gluten#12066

Copy link
Copy Markdown

@rui-mo rui-mo left a comment

Choose a reason for hiding this comment

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

Please extend the implementation in https://github.com/facebookincubator/velox/blob/main/velox/expression/CastExpr.h to support VARCHAR <-> TIMESTAMP, rather than introducing a custom cast function. Also, please open two separate PRs in Meta/Velox.

} // namespace

void registerTimestampUtcCasts() {
registerCustomType(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Timestamp UTC is not a custom type, but a basic type. Please do not follow the TimestampNTZ type implementation.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants