-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HIVE-28586 Support write order for Iceberg tables at CREATE TABLE
Change-Id: Ia9a0a92d19d33693887137c797e0662088a314db
- Loading branch information
Showing
20 changed files
with
5,804 additions
and
5,278 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
iceberg/iceberg-handler/src/test/queries/positive/iceberg_create_sorted_table.q
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
set hive.llap.io.enabled=true; | ||
set hive.vectorized.execution.enabled=true; | ||
set hive.optimize.shared.work.merge.ts.schema=true; | ||
|
||
|
||
create table ice_orc_sorted (id int, text string) write ordered by id desc nulls first, text asc nulls last stored by iceberg stored as orc; | ||
|
||
insert into ice_orc_sorted values (3, "3"),(2, "2"),(4, "4"),(5, "5"),(1, "1"),(2, "3"),(3,null),(2,null),(null,"a"); | ||
|
||
describe formatted ice_orc_sorted; | ||
describe extended ice_orc_sorted; | ||
|
||
select * from ice_orc_sorted; | ||
|
96 changes: 96 additions & 0 deletions
96
iceberg/iceberg-handler/src/test/results/positive/llap/iceberg_create_sorted_table.q.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
PREHOOK: query: create table ice_orc_sorted (id int, text string) write ordered by id desc nulls first, text asc nulls last stored by iceberg stored as orc | ||
PREHOOK: type: CREATETABLE | ||
PREHOOK: Output: database:default | ||
PREHOOK: Output: default@ice_orc_sorted | ||
POSTHOOK: query: create table ice_orc_sorted (id int, text string) write ordered by id desc nulls first, text asc nulls last stored by iceberg stored as orc | ||
POSTHOOK: type: CREATETABLE | ||
POSTHOOK: Output: database:default | ||
POSTHOOK: Output: default@ice_orc_sorted | ||
PREHOOK: query: insert into ice_orc_sorted values (3, "3"),(2, "2"),(4, "4"),(5, "5"),(1, "1"),(2, "3"),(3,null),(2,null),(null,"a") | ||
PREHOOK: type: QUERY | ||
PREHOOK: Input: _dummy_database@_dummy_table | ||
PREHOOK: Output: default@ice_orc_sorted | ||
POSTHOOK: query: insert into ice_orc_sorted values (3, "3"),(2, "2"),(4, "4"),(5, "5"),(1, "1"),(2, "3"),(3,null),(2,null),(null,"a") | ||
POSTHOOK: type: QUERY | ||
POSTHOOK: Input: _dummy_database@_dummy_table | ||
POSTHOOK: Output: default@ice_orc_sorted | ||
PREHOOK: query: describe formatted ice_orc_sorted | ||
PREHOOK: type: DESCTABLE | ||
PREHOOK: Input: default@ice_orc_sorted | ||
POSTHOOK: query: describe formatted ice_orc_sorted | ||
POSTHOOK: type: DESCTABLE | ||
POSTHOOK: Input: default@ice_orc_sorted | ||
# col_name data_type comment | ||
id int | ||
text string | ||
|
||
# Detailed Table Information | ||
Database: default | ||
#### A masked pattern was here #### | ||
Retention: 0 | ||
#### A masked pattern was here #### | ||
Table Type: EXTERNAL_TABLE | ||
Table Parameters: | ||
COLUMN_STATS_ACCURATE {\"BASIC_STATS\":\"true\",\"COLUMN_STATS\":{\"id\":\"true\",\"text\":\"true\"}} | ||
EXTERNAL TRUE | ||
SORTBUCKETCOLSPREFIX TRUE | ||
bucketing_version 2 | ||
current-schema {\"type\":\"struct\",\"schema-id\":0,\"fields\":[{\"id\":1,\"name\":\"id\",\"required\":false,\"type\":\"int\"},{\"id\":2,\"name\":\"text\",\"required\":false,\"type\":\"string\"}]} | ||
current-snapshot-id 7320236589871429354 | ||
current-snapshot-summary {\"added-data-files\":\"1\",\"added-records\":\"9\",\"added-files-size\":\"373\",\"changed-partition-count\":\"1\",\"total-records\":\"9\",\"total-files-size\":\"373\",\"total-data-files\":\"1\",\"total-delete-files\":\"0\",\"total-position-deletes\":\"0\",\"total-equality-deletes\":\"0\",\"iceberg-version\":\"Apache Iceberg 1.6.1 (commit 8e9d59d299be42b0bca9461457cd1e95dbaad086)\"} | ||
current-snapshot-timestamp-ms 1731506391808 | ||
default-sort-order {\"order-id\":1,\"fields\":[{\"transform\":\"identity\",\"source-id\":1,\"direction\":\"desc\",\"null-order\":\"nulls-first\"},{\"transform\":\"identity\",\"source-id\":2,\"direction\":\"asc\",\"null-order\":\"nulls-last\"}]} | ||
format-version 2 | ||
iceberg.orc.files.only true | ||
iceberg.write-order {\"order-id\":1,\"fields\":[{\"transform\":\"identity\",\"source-id\":1,\"direction\":\"desc\",\"null-order\":\"nulls-first\"},{\"transform\":\"identity\",\"source-id\":2,\"direction\":\"asc\",\"null-order\":\"nulls-last\"}]} | ||
#### A masked pattern was here #### | ||
numFiles 1 | ||
numRows 9 | ||
parquet.compression zstd | ||
#### A masked pattern was here #### | ||
rawDataSize 0 | ||
serialization.format 1 | ||
snapshot-count 1 | ||
storage_handler org.apache.iceberg.mr.hive.HiveIcebergStorageHandler | ||
table_type ICEBERG | ||
totalSize #Masked# | ||
#### A masked pattern was here #### | ||
uuid fb098a98-2597-4f22-b933-27b71f674f08 | ||
write.delete.mode merge-on-read | ||
write.format.default orc | ||
write.merge.mode merge-on-read | ||
write.update.mode merge-on-read | ||
|
||
# Storage Information | ||
SerDe Library: org.apache.iceberg.mr.hive.HiveIcebergSerDe | ||
InputFormat: org.apache.iceberg.mr.hive.HiveIcebergInputFormat | ||
OutputFormat: org.apache.iceberg.mr.hive.HiveIcebergOutputFormat | ||
Compressed: No | ||
Sort Columns: [FieldSchema(name:id, type:int, comment:Transform: identity, Sort direction: DESC, Null sort order: NULLS_FIRST), FieldSchema(name:text, type:string, comment:Transform: identity, Sort direction: ASC, Null sort order: NULLS_LAST)] | ||
PREHOOK: query: describe extended ice_orc_sorted | ||
PREHOOK: type: DESCTABLE | ||
PREHOOK: Input: default@ice_orc_sorted | ||
POSTHOOK: query: describe extended ice_orc_sorted | ||
POSTHOOK: type: DESCTABLE | ||
POSTHOOK: Input: default@ice_orc_sorted | ||
id int | ||
text string | ||
|
||
#### A masked pattern was here #### | ||
PREHOOK: query: select * from ice_orc_sorted | ||
PREHOOK: type: QUERY | ||
PREHOOK: Input: default@ice_orc_sorted | ||
#### A masked pattern was here #### | ||
POSTHOOK: query: select * from ice_orc_sorted | ||
POSTHOOK: type: QUERY | ||
POSTHOOK: Input: default@ice_orc_sorted | ||
#### A masked pattern was here #### | ||
NULL a | ||
5 5 | ||
4 4 | ||
3 3 | ||
3 NULL | ||
2 2 | ||
2 3 | ||
2 NULL | ||
1 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.