deniskuzZ commented on code in PR #6644:
URL: https://github.com/apache/hive/pull/6644#discussion_r3663934435


##########
iceberg/iceberg-handler/src/test/queries/positive/variant_type_projection.q:
##########
@@ -0,0 +1,66 @@
+-- SORT_QUERY_RESULTS
+set hive.explain.user=false;
+
+drop table if exists variant_proj;
+
+CREATE EXTERNAL TABLE variant_proj (
+  id INT,
+  data VARIANT
+) STORED BY ICEBERG
+TBLPROPERTIES (
+  'format-version'='3'
+);
+
+INSERT INTO variant_proj VALUES
+(1, parse_json('{"name": "John", "age": 30}')),
+(2, parse_json('[1, 2, 3]')),
+(3, parse_json('"plain string"')),
+(4, parse_json('42'));

Review Comment:
   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



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to