-
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.
Update hudi test resource for hudi_non_part_cow table
The change is to make the schema sync with hudi_cow_pt_tbl.
- Loading branch information
1 parent
5f4e7b6
commit 261322f
Showing
10 changed files
with
109 additions
and
92 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Hudi Test Resources | ||
|
||
## Generating Hudi Resources | ||
|
||
Follow these steps to create the `hudi_non_part_cow` test table and utilize it for testing. `hudi_non_part_cow` resource is generated using `423` trino version. | ||
|
||
### Start the Hudi environment | ||
|
||
Execute the following command in the terminal to initiate the Hudi environment: | ||
|
||
```shell | ||
testing/bin/ptl env up --environment singlenode-hudi | ||
``` | ||
|
||
### Generate Resources | ||
|
||
* Open the `spark-sql` terminal and initiate the `spark-sql` shell in the `ptl-spark` container. | ||
* Execute the following Spark SQL queries to create the `hudi_non_part_cow` table: | ||
|
||
``` | ||
spark-sql> CREATE TABLE default.hudi_non_part_cow ( | ||
id bigint, | ||
name string, | ||
ts bigint, | ||
dt string, | ||
hh string | ||
) | ||
USING hudi | ||
TBLPROPERTIES ( | ||
type = 'cow', | ||
primaryKey = 'id', | ||
preCombineField = 'ts' | ||
) | ||
LOCATION 's3://test-bucket/hudi_non_part_cow'; | ||
spark-sql> INSERT INTO default.hudi_non_part_cow (id, name, ts, dt, hh) VALUES | ||
(1, 'a1', 1000, '2021-12-09', '10'), | ||
(2, 'a2', 2000, '2021-12-09', '11'); | ||
``` | ||
|
||
### Download Resources | ||
|
||
Download the `hudi_non_part_cow` table from the MinIO client http://localhost:9001/buckets/test-bucket/browse. | ||
|
||
### Use Resources | ||
|
||
Unzip the downloaded `hudi_non_part_cow.zip`. Remove any unnecessary files obtained after unzipping to prepare the resource for testing. |
50 changes: 0 additions & 50 deletions
50
...i/src/test/resources/hudi-testing-data/hudi_non_part_cow/.hoodie/20211217110514527.commit
This file was deleted.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
...i/src/test/resources/hudi-testing-data/hudi_non_part_cow/.hoodie/20231127051653361.commit
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,37 @@ | ||
{ | ||
"partitionToWriteStats" : { | ||
"" : [ { | ||
"fileId" : "05b0f4ec-00fb-49f2-a1e2-7f510f3da93b-0", | ||
"path" : "05b0f4ec-00fb-49f2-a1e2-7f510f3da93b-0_0-27-28_20231127051653361.parquet", | ||
"prevCommit" : "null", | ||
"numWrites" : 2, | ||
"numDeletes" : 0, | ||
"numUpdateWrites" : 0, | ||
"numInserts" : 2, | ||
"totalWriteBytes" : 435338, | ||
"totalWriteErrors" : 0, | ||
"tempPath" : null, | ||
"partitionPath" : "", | ||
"totalLogRecords" : 0, | ||
"totalLogFilesCompacted" : 0, | ||
"totalLogSizeCompacted" : 0, | ||
"totalUpdatedRecordsCompacted" : 0, | ||
"totalLogBlocks" : 0, | ||
"totalCorruptLogBlock" : 0, | ||
"totalRollbackBlocks" : 0, | ||
"fileSizeInBytes" : 435338, | ||
"minEventTime" : null, | ||
"maxEventTime" : null, | ||
"runtimeStats" : { | ||
"totalScanTime" : 0, | ||
"totalUpsertTime" : 0, | ||
"totalCreateTime" : 856 | ||
} | ||
} ] | ||
}, | ||
"compacted" : false, | ||
"extraMetadata" : { | ||
"schema" : "{\"type\":\"record\",\"name\":\"hudi_non_part_cow_record\",\"namespace\":\"hoodie.hudi_non_part_cow\",\"fields\":[{\"name\":\"id\",\"type\":[\"null\",\"long\"],\"default\":null},{\"name\":\"name\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"ts\",\"type\":[\"null\",\"long\"],\"default\":null},{\"name\":\"dt\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"hh\",\"type\":[\"null\",\"string\"],\"default\":null}]}" | ||
}, | ||
"operationType" : "UPSERT" | ||
} |
File renamed without changes.
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
23 changes: 13 additions & 10 deletions
23
...ino-hudi/src/test/resources/hudi-testing-data/hudi_non_part_cow/.hoodie/hoodie.properties
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 |
---|---|---|
@@ -1,14 +1,17 @@ | ||
#Properties saved on Fri Dec 17 11:05:14 UTC 2021 | ||
#Fri Dec 17 11:05:14 UTC 2021 | ||
hoodie.table.precombine.field=preComb | ||
hoodie.table.partition.fields= | ||
#Updated at 2023-11-27T05:16:58.380652Z | ||
#Mon Nov 27 05:16:58 UTC 2023 | ||
hoodie.table.type=COPY_ON_WRITE | ||
hoodie.table.metadata.partitions=files | ||
hoodie.table.precombine.field=ts | ||
hoodie.archivelog.folder=archived | ||
hoodie.populate.meta.fields=true | ||
hoodie.table.create.schema={"type"\:"record","name"\:"hudi_non_part_cow_record","namespace"\:"hoodie.hudi_non_part_cow","fields"\:[{"name"\:"_hoodie_commit_time","type"\:["string","null"]},{"name"\:"_hoodie_commit_seqno","type"\:["string","null"]},{"name"\:"_hoodie_record_key","type"\:["string","null"]},{"name"\:"_hoodie_partition_path","type"\:["string","null"]},{"name"\:"_hoodie_file_name","type"\:["string","null"]},{"name"\:"id","type"\:["long","null"]},{"name"\:"name","type"\:["string","null"]},{"name"\:"ts","type"\:["long","null"]},{"name"\:"dt","type"\:["string","null"]},{"name"\:"hh","type"\:["string","null"]}]} | ||
hoodie.timeline.layout.version=1 | ||
hoodie.table.version=3 | ||
hoodie.table.recordkey.fields=rowId | ||
hoodie.table.base.file.format=PARQUET | ||
hoodie.table.keygenerator.class=org.apache.hudi.keygen.NonpartitionedKeyGenerator | ||
hoodie.table.checksum=2968816715 | ||
hoodie.datasource.write.drop.partition.columns=false | ||
hoodie.table.recordkey.fields=id | ||
hoodie.table.name=hudi_non_part_cow | ||
hoodie.datasource.write.hive_style_partitioning=false | ||
hoodie.datasource.write.hive_style_partitioning=true | ||
hoodie.table.keygenerator.class=org.apache.hudi.keygen.NonpartitionedKeyGenerator | ||
hoodie.database.name=default | ||
hoodie.datasource.write.partitionpath.urlencode=false | ||
hoodie.table.version=5 |
4 changes: 2 additions & 2 deletions
4
...no-hudi/src/test/resources/hudi-testing-data/hudi_non_part_cow/.hoodie_partition_metadata
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#partition metadata | ||
#Fri Dec 17 11:05:23 UTC 2021 | ||
commitTime=20211217110514527 | ||
#Mon Nov 27 05:16:59 UTC 2023 | ||
commitTime=20231127051653361 | ||
partitionDepth=0 |
Binary file renamed
BIN
+426 KB
...6c47a0-0_0-6-11_20211217110514527.parquet → ...da93b-0_0-27-28_20231127051653361.parquet
Binary file not shown.