Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HIVE-26373: ClassCastException while inserting Avro data into Hbase table for nested struct with Timestamp #3418

Closed
wants to merge 6 commits into from

Conversation

soumyakanti3578
Copy link
Contributor

What changes were proposed in this pull request?

isPrimitive returns true for Timestamp

Why are the changes needed?

isPrimitive was returning false and because of that Timestamp type was not getting converted to LazyTimestamp

Does this PR introduce any user-facing change?

No

How was this patch tested?

mvn test -Dtest=TestHBaseCliDriver -Dtest.output.overwrite=true -Dqfile=hbase_avro_nested_timestamp.q

Copy link
Contributor

@zabetak zabetak left a comment

Choose a reason for hiding this comment

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

Most comments are minor but the incorrect results seems to be a serious one that needs futher investigation.

@zabetak
Copy link
Contributor

zabetak commented Jul 7, 2022

Hive has been always converting data from local time zone to UTC when writing and from UTC to local time zone when reading. I updated the way the the timestamp is stored in HBase (fc9bc94) to make it coherent with the way it is read by the query.

There are properties and Avro file metadata which can control if we want to perform the conversion or not (e.g., hive.avro.timestamp.skip.conversion) but these are not working at the moment for HBase (and basically anything that relies on AvroLazyObjectInspector). This is a bug that should be fixed but it is out of the scope of this PR.

Copy link
Contributor

@zabetak zabetak left a comment

Choose a reason for hiding this comment

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

LGTM, pending tests!

@zabetak zabetak closed this in 97d7630 Jul 8, 2022
DongWei-4 pushed a commit to DongWei-4/hive that referenced this pull request Oct 28, 2022
…le with Avro data (Soumyakanti Das reviewed by Stamatis Zampetakis)

Closes apache#3418
dengzhhu653 pushed a commit to dengzhhu653/hive that referenced this pull request Dec 15, 2022
…le with Avro data (Soumyakanti Das reviewed by Stamatis Zampetakis)

Closes apache#3418
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants