· 7 years ago · Jan 14, 2019, 05:38 PM
1CREATE TABLE if not exists tbl1
2(
3sess_id STRING
4, source_start_ts STRING
5, source_end_ts STRING
6,Node_String STRUCT < Node: STRING, Time_Spent:STRING,
7Txn_Type: STRING, Txn_Status: STRING, Call_Status: STRING >
8)
9 STORED AS ORC
10
11CREATE TABLE if not exists tbl2
12(
13 sess_id STRING
14,Col2 Array<STRUCT < Node: STRING,
15Time_Spent:STRING, Txn_Type: STRING, Txn_Status: STRING,
16Call_Status: STRING >>
17) STORED AS ORC
18
19insert into table tbl2
20select sess_id
21, collect_set(Node_String) as Col2
22from tbl1
23where sess_id = 'abc'
24group by sess_id