Skip to content

HIVE-29770: Iceberg: Return VARIANT values as JSON over the HS2 Thrift protocol - #6644

Open
deniskuzZ wants to merge 1 commit into
apache:masterfrom
deniskuzZ:HIVE-29770
Open

HIVE-29770: Iceberg: Return VARIANT values as JSON over the HS2 Thrift protocol#6644
deniskuzZ wants to merge 1 commit into
apache:masterfrom
deniskuzZ:HIVE-29770

Conversation

@deniskuzZ

Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

Why are the changes needed?

Does this PR introduce any user-facing change?

How was this patch tested?

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.

Should the new type get a new version? Note that I don't understand how this client interface versioning works.

(1, parse_json('{"name": "John", "age": 30}')),
(2, parse_json('[1, 2, 3]')),
(3, parse_json('"plain string"')),
(4, parse_json('42'));

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.

Can Hive create VARIANTs from other types?
An interesting case is BINARY. Impala and Trino base64 encodes it, but you can't just create it by parsing JSON

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hive can only create variants from JSON text (parse_json), so binary variants can't be authored in Hive SQL, but Hive fully understands them on the read side, and renders them exactly the way Trino does (base64).

parse_json is the only variant constructor Hive registers. It's the same-named, same-semantics function as Spark's. There is no CAST(x AS VARIANT) in Hive yet

@sonarqubecloud

Copy link
Copy Markdown

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