humengyu2012 opened a new pull request #3912:
URL: https://github.com/apache/iceberg/pull/3912
Creating a iceberg table in hive like:
```sql
CREATE TABLE test_iceberg (
c1 int,
c2 int,
c3 string
)
PARTITIONED BY (c4 string)
STORED BY 'org.apache.iceberg.mr.hive.HiveIcebergStorageHandler'
TBLPROPERTIES (
'iceberg.identifier-fields' = 'c1,c2'
);
```
We could obtain an iceberg table:
```json
{
"format-version" : 1,
"table-uuid" : "7b05fa2b-9504-4ea2-8e24-5f760a101f2f",
"location" : "hdfs://xxx:8020/user/hive/warehouse/test_iceberg",
"last-updated-ms" : 1642454127758,
"last-column-id" : 4,
"schema" : {
"type" : "struct",
"schema-id" : 0,
"identifier-field-ids" : [ 1, 2 ],
"fields" : [ {
"id" : 1,
"name" : "c1",
"required" : true,
"type" : "int"
}, {
"id" : 2,
"name" : "c2",
"required" : true,
"type" : "int"
}, {
"id" : 3,
"name" : "c3",
"required" : false,
"type" : "string"
}, {
"id" : 4,
"name" : "c4",
"required" : false,
"type" : "string"
} ]
},
"current-schema-id" : 0,
"schemas" : [ {
"type" : "struct",
"schema-id" : 0,
"identifier-field-ids" : [ 1, 2 ],
"fields" : [ {
"id" : 1,
"name" : "c1",
"required" : true,
"type" : "int"
}, {
"id" : 2,
"name" : "c2",
"required" : true,
"type" : "int"
}, {
"id" : 3,
"name" : "c3",
"required" : false,
"type" : "string"
}, {
"id" : 4,
"name" : "c4",
"required" : false,
"type" : "string"
} ]
} ],
"partition-spec" : [ {
"name" : "c4",
"transform" : "identity",
"source-id" : 4,
"field-id" : 1000
} ],
"default-spec-id" : 0,
"partition-specs" : [ {
"spec-id" : 0,
"fields" : [ {
"name" : "c4",
"transform" : "identity",
"source-id" : 4,
"field-id" : 1000
} ]
} ],
"last-partition-id" : 1000,
"default-sort-order-id" : 0,
"sort-orders" : [ {
"order-id" : 0,
"fields" : [ ]
} ],
"properties" : {
"engine.hive.enabled" : "true",
"storage_handler" :
"org.apache.iceberg.mr.hive.HiveIcebergStorageHandler"
},
"current-snapshot-id" : -1,
"snapshots" : [ ],
"snapshot-log" : [ ],
"metadata-log" : [ ]
}
```
Although this feature is supported with json, it is too difficult for most
people to write a json string in hive sql.
--
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]