Skip to content

Commit 75f9542

Browse files
committed
HIVE-29342: Iceberg: [V3] Display initial and write defaults in describe formatted column output
1 parent 1246e83 commit 75f9542

4 files changed

Lines changed: 534 additions & 6 deletions

File tree

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
-- Mask random uuid
2+
--! qt:replace:/(\s+uuid\s+)\S+(\s*)/$1#Masked#$2/
3+
-- Mask a random snapshot id
4+
--! qt:replace:/(\s+current-snapshot-id\s+)\S+(\s*)/$1#Masked#/
5+
-- Mask added file size
6+
--! qt:replace:/(\S\"added-files-size\\\":\\\")(\d+)(\\\")/$1#Masked#$3/
7+
-- Mask total file size
8+
--! qt:replace:/(\S\"total-files-size\\\":\\\")(\d+)(\\\")/$1#Masked#$3/
9+
-- Mask current-snapshot-timestamp-ms
10+
--! qt:replace:/(\s+current-snapshot-timestamp-ms\s+)\S+(\s*)/$1#Masked#$2/
11+
12+
CREATE TABLE ice_parq (
13+
id INT)
14+
STORED BY ICEBERG stored as parquet
15+
TBLPROPERTIES ('format-version'='3');
16+
17+
INSERT INTO ice_parq (id) VALUES (1);
18+
19+
ALTER TABLE ice_parq ADD COLUMNS (point STRUCT<x:INT, y:INT> DEFAULT 'x:100,y:99',
20+
name STRING DEFAULT 'unknown',
21+
age INT DEFAULT 25);
22+
23+
INSERT INTO ice_parq (id) VALUES (2);
24+
25+
SELECT * FROM ice_parq ORDER BY id;
26+
27+
DESCRIBE FORMATTED ice_parq;
28+
29+
DESCRIBE FORMATTED ice_parq id;
30+
DESCRIBE FORMATTED ice_parq point;
31+
DESCRIBE FORMATTED ice_parq name;
32+
DESCRIBE FORMATTED ice_parq age;
33+
34+
CREATE TABLE ice_orc (
35+
id INT)
36+
STORED BY ICEBERG stored as orc
37+
TBLPROPERTIES ('format-version'='3');
38+
39+
INSERT INTO ice_orc (id) VALUES (1);
40+
41+
ALTER TABLE ice_orc ADD COLUMNS (point STRUCT<x:INT, y:INT> DEFAULT 'x:100,y:99',
42+
name STRING DEFAULT 'unknown',
43+
age INT DEFAULT 25);
44+
45+
INSERT INTO ice_orc (id) VALUES (2);
46+
47+
SELECT * FROM ice_orc ORDER BY id;
48+
49+
DESCRIBE FORMATTED ice_orc;
50+
51+
DESCRIBE FORMATTED ice_orc id;
52+
DESCRIBE FORMATTED ice_orc point;
53+
DESCRIBE FORMATTED ice_orc name;
54+
DESCRIBE FORMATTED ice_orc age;

0 commit comments

Comments
 (0)