| ==== |
| ---- QUERY |
| # Tests using a larger table. |
| create table if not exists orders_insert_test like tpch_parquet.orders |
| location '$FILESYSTEM_PREFIX/test-warehouse/$DATABASE.db/orders_insert_table'; |
| insert overwrite table orders_insert_test select * from tpch.orders |
| ---- RESULTS |
| : 1500000 |
| ==== |
| ---- QUERY |
| select count(distinct o_orderkey) from orders_insert_test |
| ---- TYPES |
| bigint |
| ---- RESULTS |
| 1500000 |
| ==== |
| ---- QUERY |
| select count(distinct o_orderstatus) from orders_insert_test |
| ---- TYPES |
| bigint |
| ---- RESULTS |
| 3 |
| ==== |
| ---- QUERY |
| select count(distinct o_orderdate) from orders_insert_test |
| ---- TYPES |
| bigint |
| ---- RESULTS |
| 2406 |
| ==== |
| ---- QUERY |
| select distinct o_orderpriority from orders_insert_test |
| ---- TYPES |
| string |
| ---- RESULTS |
| '1-URGENT' |
| '2-HIGH' |
| '3-MEDIUM' |
| '4-NOT SPECIFIED' |
| '5-LOW' |
| ==== |
| ---- QUERY |
| select o_shippriority, count(1) from orders_insert_test group by 1 |
| ---- TYPES |
| int,bigint |
| ---- RESULTS |
| 0,1500000 |
| ==== |
| ---- QUERY |
| select count(distinct o_comment) from orders_insert_test |
| ---- TYPES |
| bigint |
| ---- RESULTS |
| 1482071 |
| ==== |
| ---- QUERY |
| # Test to verify that huge (larger than 64k) values can be written, see IMPALA-1705 |
| create table if not exists test_insert_huge_vals (s string) stored as parquet |
| location '$FILESYSTEM_PREFIX/test-warehouse/$DATABASE.db/test_insert_huge_vals'; |
| # Large rows are possible in this query, so we bump up the max row size. |
| set max_row_size=1048576; |
| insert overwrite table test_insert_huge_vals |
| select cast(l_orderkey as string) from tpch.lineitem |
| union select group_concat(concat(s_name, s_address, s_phone)) from tpch.supplier |
| union select group_concat(concat(s_name, s_address, s_phone, s_name)) from tpch.supplier |
| ---- RESULTS |
| : 1500002 |
| ==== |
| ---- QUERY |
| # Verify the values written to test_insert_huge_vals were as expected by counting |
| # the results of an inner join of that table with the same query used in the insert. |
| # Increase spillable buffer size to fit the large values on right side of hash join. |
| set min_spillable_buffer_size=1m; |
| select count(*) from |
| (select cast(l_orderkey as string) s from tpch.lineitem union |
| select group_concat(concat(s_name, s_address, s_phone)) from tpch.supplier union |
| select group_concat(concat(s_name, s_address, s_phone, s_name)) from tpch.supplier |
| ) t1 |
| join test_insert_huge_vals t2 on t1.s = t2.s |
| ---- RESULTS |
| 1500002 |
| ==== |
| ---- QUERY |
| # IMPALA-8257: Test that we can write multiple pages of empty strings. |
| create table if not exists test_insert_empty_strings stored as parquet |
| location '$FILESYSTEM_PREFIX/test-warehouse/$DATABASE.db/test_insert_empty_strings' |
| as select "" from tpch_parquet.lineitem; |
| select count(*) from test_insert_empty_strings |
| ---- RESULTS |
| 6001215 |
| ==== |