-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support converting column stats on row type to json in Delta Lake
- Loading branch information
Showing
10 changed files
with
136 additions
and
3 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
21 changes: 21 additions & 0 deletions
21
...trino-delta-lake/src/test/resources/databricks/json_stats_on_row_type/README.md
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,21 @@ | ||
Data generated using Databricks 10.4: | ||
|
||
```sql | ||
CREATE TABLE default.json_stats_on_row_type | ||
(struct_col struct<x bigint>, nested_struct_col struct<y struct<nested string>>) | ||
USING DELTA | ||
LOCATION 's3://bucket/table' | ||
TBLPROPERTIES ( | ||
delta.checkpointInterval = 2, | ||
delta.checkpoint.writeStatsAsJson = false, | ||
delta.checkpoint.writeStatsAsStruct = true | ||
); | ||
|
||
INSERT INTO default.json_stats_on_row_type SELECT named_struct('x', 1), named_struct('y', named_struct('nested', 'test')); | ||
INSERT INTO default.json_stats_on_row_type SELECT named_struct('x', NULL), named_struct('y', named_struct('nested', NULL)); | ||
|
||
ALTER TABLE default.json_stats_on_row_type SET TBLPROPERTIES ( | ||
'delta.checkpoint.writeStatsAsJson' = true, | ||
'delta.checkpoint.writeStatsAsStruct' = false | ||
); | ||
``` |
Binary file added
BIN
+15.1 KB
...rces/databricks/json_stats_on_row_type/_delta_log/00000000000000000002.checkpoint.parquet
Binary file not shown.
2 changes: 2 additions & 0 deletions
2
...src/test/resources/databricks/json_stats_on_row_type/_delta_log/00000000000000000002.json
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,2 @@ | ||
{"add":{"path":"part-00000-df481541-fe59-4af2-a37f-68a39a1e2a5d-c000.snappy.parquet","partitionValues":{},"size":1074,"modificationTime":1664924826000,"dataChange":true,"stats":"{\"numRecords\":1,\"minValues\":{\"struct_col\":{},\"nested_struct_col\":{\"y\":{}}},\"maxValues\":{\"struct_col\":{},\"nested_struct_col\":{\"y\":{}}},\"nullCount\":{\"struct_col\":{\"x\":1},\"nested_struct_col\":{\"y\":{\"nested\":1}}}}","tags":{"INSERTION_TIME":"1664924826000000","OPTIMIZE_TARGET_SIZE":"268435456"}}} | ||
{"commitInfo":{"timestamp":1664924826032,"userId":"7853186923043731","userName":"yuya.ebihara@starburstdata.com","operation":"WRITE","operationParameters":{"mode":"Append","partitionBy":"[]"},"notebook":{"notebookId":"2299734316069194"},"clusterId":"0620-043712-o6vqr39c","readVersion":1,"isolationLevel":"WriteSerializable","isBlindAppend":true,"operationMetrics":{"numFiles":"1","numOutputRows":"1","numOutputBytes":"1074"},"engineInfo":"Databricks-Runtime/10.4.x-scala2.12","txnId":"974a8474-26b8-42fc-a2c6-4d6af29109a2"}} |
2 changes: 2 additions & 0 deletions
2
...src/test/resources/databricks/json_stats_on_row_type/_delta_log/00000000000000000003.json
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,2 @@ | ||
{"metaData":{"id":"0e741658-b990-49a7-a25d-d148943b2f44","format":{"provider":"parquet","options":{}},"schemaString":"{\"type\":\"struct\",\"fields\":[{\"name\":\"struct_col\",\"type\":{\"type\":\"struct\",\"fields\":[{\"name\":\"x\",\"type\":\"long\",\"nullable\":true,\"metadata\":{}}]},\"nullable\":true,\"metadata\":{}},{\"name\":\"nested_struct_col\",\"type\":{\"type\":\"struct\",\"fields\":[{\"name\":\"y\",\"type\":{\"type\":\"struct\",\"fields\":[{\"name\":\"nested\",\"type\":\"string\",\"nullable\":true,\"metadata\":{}}]},\"nullable\":true,\"metadata\":{}}]},\"nullable\":true,\"metadata\":{}}]}","partitionColumns":[],"configuration":{"delta.checkpoint.writeStatsAsStruct":"false","delta.checkpoint.writeStatsAsJson":"true","delta.checkpointInterval":"2"},"createdTime":1664924821035}} | ||
{"commitInfo":{"timestamp":1664924827940,"userId":"7853186923043731","userName":"yuya.ebihara@starburstdata.com","operation":"SET TBLPROPERTIES","operationParameters":{"properties":"{\"delta.checkpoint.writeStatsAsJson\":\"true\",\"delta.checkpoint.writeStatsAsStruct\":\"false\"}"},"notebook":{"notebookId":"2299734316069194"},"clusterId":"0620-043712-o6vqr39c","readVersion":2,"isolationLevel":"WriteSerializable","isBlindAppend":true,"operationMetrics":{},"engineInfo":"Databricks-Runtime/10.4.x-scala2.12","txnId":"f37d7c4a-027d-4bf6-9bf3-0f26b919018c"}} |
1 change: 1 addition & 0 deletions
1
...lta-lake/src/test/resources/databricks/json_stats_on_row_type/_delta_log/_last_checkpoint
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 @@ | ||
{"version":2,"size":4} |
Binary file added
BIN
+1.15 KB
...son_stats_on_row_type/part-00000-4137b6c1-34fd-4926-a939-dc6a01571d9f-c000.snappy.parquet
Binary file not shown.
Binary file added
BIN
+1.05 KB
...son_stats_on_row_type/part-00000-df481541-fe59-4af2-a37f-68a39a1e2a5d-c000.snappy.parquet
Binary file not shown.