difin commented on code in PR #6449:
URL: https://github.com/apache/hive/pull/6449#discussion_r3229458990


##########
iceberg/iceberg-handler/src/test/queries/positive/iceberg_native_view.q:
##########
@@ -0,0 +1,53 @@
+-- SORT_QUERY_RESULTS
+-- Mask random uuid
+--! qt:replace:/(\s+uuid\s+)\S+(\s*)/$1#Masked#$2/
+
+create database ice_native_view_db;
+use ice_native_view_db;
+
+create table src_ice (
+    first_name string, 
+    last_name string
+ )
+partitioned by (dept_id bigint)
+stored by iceberg stored as orc;
+
+INSERT INTO src_ice VALUES
+  ('fn1','ln1', 1),
+  ('fn2','ln2', 1),
+  ('fn3','ln3', 1),
+  ('fn4','ln4', 1),
+  ('fn5','ln5', 2),
+  ('fn6','ln6', 2),
+  ('fn7','ln7', 2);
+
+----------------------------------------------------------------
+-- Iceberg native view via TBLPROPERTIES before AS
+----------------------------------------------------------------
+
+create view v_ice tblproperties ('view-format'='iceberg') as select * from 
src_ice;
+select * from v_ice;
+desc formatted v_ice;
+drop view v_ice;
+
+----------------------------------------------------------------
+-- Native Iceberg view when default storage handler is Iceberg (no 
TBLPROPERTIES view-format)
+----------------------------------------------------------------
+
+set 
hive.default.storage.handler.class=org.apache.iceberg.mr.hive.HiveIcebergStorageHandler;
+
+create view v_def as select * from src_ice;
+select first_name, dept_id from v_def;
+desc formatted v_def;
+drop view v_def;
+
+----------------------------------------------------------------
+-- Classic Hive view when default storage handler is unset
+----------------------------------------------------------------
+
+set hive.default.storage.handler.class=;
+
+create view v_hive as select * from src_ice;
+select * from v_hive;
+desc formatted v_hive;
+drop view v_hive;

Review Comment:
   Done



-- 
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