Skip to content

HIVE-30020: Fix TIMESTAMP WITH LOCAL TIME ZONE data loss and read failure on ORC tables - #6761

Open
vikramahuja1001 wants to merge 1 commit into
apache:masterfrom
vikramahuja1001:HIVE-30020-ORCFix
Open

HIVE-30020: Fix TIMESTAMP WITH LOCAL TIME ZONE data loss and read failure on ORC tables#6761
vikramahuja1001 wants to merge 1 commit into
apache:masterfrom
vikramahuja1001:HIVE-30020-ORCFix

Conversation

@vikramahuja1001

@vikramahuja1001 vikramahuja1001 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Fix TIMESTAMP WITH LOCAL TIME ZONE data loss and read failure on ORC tables

Why are the changes needed?

Check https://issues.apache.org/jira/browse/HIVE-30020 for more details

Does this PR introduce any user-facing change?

No

How was this patch tested?

Added a new test case(.q file)

@vikramahuja1001

Copy link
Copy Markdown
Contributor Author

Can you help in reviewing this PR as per your availability?
cc @ayushtkn , @zabetak , @zhangbutao , @deniskuzZ , @dengzhhu653

vector.time[rowId] = timestampTZ.toEpochMilli();
vector.nanos[rowId] = timestampTZ.getNanos();
break;
}

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.

default case is not handled for primitive category due to that the data is getting written in this case. Handle default case and throw exception so that the error will come while writing the data itself for unsupported/unhandled primitive type.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done, thanks for pointing it out

.getPrimitiveJavaObject(obj).toSqlTimestamp());
break;
}
case TIMESTAMPLOCALTZ: {

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.

It looks indentation problem for this block, please check and fix.

@vikramahuja1001 vikramahuja1001 Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I am not able to understand why indentation is being flagged here. Indentation level is same as other case statements above and below. Can you take a look once?


insert into timestampltz_orc_format select * from timestampltz_formats;

SELECT * FROM timestampltz_orc_format; No newline at end of file

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.

Adding ORDER BY clause to the select query is resulting an exception with the patch, please check.

@vikramahuja1001 vikramahuja1001 Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes rightly pointed, ORDER BY clause is giving an exception. To fix that will require a lot of changes, which are separate from the scope of this PR. I have raised a follow up JIRA and will work on that as well, hope that's fine.
JIRA ID: https://issues.apache.org/jira/browse/HIVE-30042

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.

I am ok with handling this scenario in a separate JIRA mentioned above. But I request you to add proper details with exception in the description section of the JIRA. Thanks.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure, will do.

@vikramahuja1001

Copy link
Copy Markdown
Contributor Author

Thanks for reviewing this PR @mdayakar . I have raised a follow up JIRA to fix the order by query clause as well and will raise a PR for that as well.

@sonarqubecloud

Copy link
Copy Markdown

@mdayakar mdayakar 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. Pending tests.

@vikramahuja1001

Copy link
Copy Markdown
Contributor Author

@mdayakar , could you please merge this PR as well?

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.

3 participants