Repository navigation
feat(scan): batch read primary-key tables with dynamic buckets #499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| Written by Spark 3.5.3 with Paimon 1.3.2. | ||
|
|
||
| id:int not null v:string | ||
| primary key: id | ||
| bucket: -1 (dynamic bucket) | ||
| dynamic-bucket.target-row-num = 2 | ||
| deletion-vectors.enabled = true | ||
| file.format = parquet | ||
|
|
||
| CREATE TABLE dv (id INT, v STRING) | ||
| TBLPROPERTIES ('primary-key' = 'id', 'bucket' = '-1', 'deletion-vectors.enabled' = 'true', | ||
| 'file.format' = 'parquet', 'dynamic-bucket.target-row-num' = '2'); | ||
|
|
||
| INSERT INTO dv VALUES (1, 'a'), (2, 'b'), (3, 'x'), (4, 'y'), (5, 'z'); | ||
| -- snapshot 2: (1, a) (2, b) (3, x) (4, y) (5, z) | ||
| INSERT INTO dv VALUES (1, 'c'), (4, 'w'); | ||
| -- snapshot 4: (1, c) (2, b) (3, x) (4, w) (5, z) | ||
| DELETE FROM dv WHERE id IN (2, 5); | ||
| -- snapshot 6: (1, c) (3, x) (4, w) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for adding the test data and integration tests! However, even though the test data construction removes Tip: You can try making the |
||
|
|
||
| Keys are spread over several buckets, and each bucket keeps its own deletion vector index. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ÒåG |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| VGpÊ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Hô |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Oä»ð |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| WYù |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| { | ||
| "version" : 3, | ||
| "id" : 0, | ||
| "fields" : [ { | ||
| "id" : 0, | ||
| "name" : "id", | ||
| "type" : "INT NOT NULL" | ||
| }, { | ||
| "id" : 1, | ||
| "name" : "v", | ||
| "type" : "STRING" | ||
| } ], | ||
| "highestFieldId" : 1, | ||
| "partitionKeys" : [ ], | ||
| "primaryKeys" : [ "id" ], | ||
| "options" : { | ||
| "bucket" : "-1", | ||
| "owner" : "root", | ||
| "file.format" : "parquet", | ||
| "dynamic-bucket.target-row-num" : "2", | ||
| "deletion-vectors.enabled" : "true" | ||
| }, | ||
| "timeMillis" : 1792572933936 | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 6 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| "version" : 3, | ||
| "id" : 1, | ||
| "schemaId" : 0, | ||
| "baseManifestList" : "manifest-list-0014d5c7-8244-459c-ba6c-3e66042c6b22-0", | ||
| "baseManifestListSize" : 884, | ||
| "deltaManifestList" : "manifest-list-0014d5c7-8244-459c-ba6c-3e66042c6b22-1", | ||
| "deltaManifestListSize" : 990, | ||
| "changelogManifestList" : null, | ||
| "indexManifest" : "index-manifest-243d52b5-0cfc-4039-bf11-7436f05ebd99-0", | ||
| "commitUser" : "86f3fe45-aa7d-41e3-a32b-f49670b910da", | ||
| "commitIdentifier" : 9223372036854775807, | ||
| "commitKind" : "APPEND", | ||
| "timeMillis" : 1792572934818, | ||
| "logOffsets" : { }, | ||
| "totalRecordCount" : 5, | ||
| "deltaRecordCount" : 5, | ||
| "changelogRecordCount" : 0, | ||
| "nextRowId" : 0 | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| "version" : 3, | ||
| "id" : 2, | ||
| "schemaId" : 0, | ||
| "baseManifestList" : "manifest-list-0014d5c7-8244-459c-ba6c-3e66042c6b22-2", | ||
| "baseManifestListSize" : 990, | ||
| "deltaManifestList" : "manifest-list-0014d5c7-8244-459c-ba6c-3e66042c6b22-3", | ||
| "deltaManifestListSize" : 990, | ||
| "changelogManifestList" : null, | ||
| "indexManifest" : "index-manifest-243d52b5-0cfc-4039-bf11-7436f05ebd99-0", | ||
| "commitUser" : "86f3fe45-aa7d-41e3-a32b-f49670b910da", | ||
| "commitIdentifier" : 9223372036854775807, | ||
| "commitKind" : "COMPACT", | ||
| "timeMillis" : 1792572934825, | ||
| "logOffsets" : { }, | ||
| "totalRecordCount" : 5, | ||
| "deltaRecordCount" : 0, | ||
| "changelogRecordCount" : 0, | ||
| "nextRowId" : 0 | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| "version" : 3, | ||
| "id" : 3, | ||
| "schemaId" : 0, | ||
| "baseManifestList" : "manifest-list-19ad07c9-fcfc-4be6-b685-d6918922e81b-0", | ||
| "baseManifestListSize" : 1001, | ||
| "deltaManifestList" : "manifest-list-19ad07c9-fcfc-4be6-b685-d6918922e81b-1", | ||
| "deltaManifestListSize" : 991, | ||
| "changelogManifestList" : null, | ||
| "indexManifest" : "index-manifest-243d52b5-0cfc-4039-bf11-7436f05ebd99-0", | ||
| "commitUser" : "b110fa6e-4595-43c0-b479-8756f91b126b", | ||
| "commitIdentifier" : 9223372036854775807, | ||
| "commitKind" : "APPEND", | ||
| "timeMillis" : 1792572936021, | ||
| "logOffsets" : { }, | ||
| "totalRecordCount" : 7, | ||
| "deltaRecordCount" : 2, | ||
| "changelogRecordCount" : 0, | ||
| "nextRowId" : 0 | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| "version" : 3, | ||
| "id" : 4, | ||
| "schemaId" : 0, | ||
| "baseManifestList" : "manifest-list-19ad07c9-fcfc-4be6-b685-d6918922e81b-2", | ||
| "baseManifestListSize" : 1043, | ||
| "deltaManifestList" : "manifest-list-19ad07c9-fcfc-4be6-b685-d6918922e81b-3", | ||
| "deltaManifestListSize" : 991, | ||
| "changelogManifestList" : null, | ||
| "indexManifest" : "index-manifest-243d52b5-0cfc-4039-bf11-7436f05ebd99-0", | ||
| "commitUser" : "b110fa6e-4595-43c0-b479-8756f91b126b", | ||
| "commitIdentifier" : 9223372036854775807, | ||
| "commitKind" : "COMPACT", | ||
| "timeMillis" : 1792572936030, | ||
| "logOffsets" : { }, | ||
| "totalRecordCount" : 5, | ||
| "deltaRecordCount" : -2, | ||
| "changelogRecordCount" : 0, | ||
| "nextRowId" : 0 | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| "version" : 3, | ||
| "id" : 5, | ||
| "schemaId" : 0, | ||
| "baseManifestList" : "manifest-list-51b6b5dd-86de-4a97-9a90-86dc8382f85e-0", | ||
| "baseManifestListSize" : 1051, | ||
| "deltaManifestList" : "manifest-list-51b6b5dd-86de-4a97-9a90-86dc8382f85e-1", | ||
| "deltaManifestListSize" : 991, | ||
| "changelogManifestList" : null, | ||
| "indexManifest" : "index-manifest-243d52b5-0cfc-4039-bf11-7436f05ebd99-0", | ||
| "commitUser" : "9b190bb7-7a17-4f78-9035-60a019950355", | ||
| "commitIdentifier" : 9223372036854775807, | ||
| "commitKind" : "APPEND", | ||
| "timeMillis" : 1792572937421, | ||
| "logOffsets" : { }, | ||
| "totalRecordCount" : 7, | ||
| "deltaRecordCount" : 2, | ||
| "changelogRecordCount" : 0, | ||
| "nextRowId" : 0 | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| "version" : 3, | ||
| "id" : 6, | ||
| "schemaId" : 0, | ||
| "baseManifestList" : "manifest-list-51b6b5dd-86de-4a97-9a90-86dc8382f85e-2", | ||
| "baseManifestListSize" : 1091, | ||
| "deltaManifestList" : "manifest-list-51b6b5dd-86de-4a97-9a90-86dc8382f85e-3", | ||
| "deltaManifestListSize" : 991, | ||
| "changelogManifestList" : null, | ||
| "indexManifest" : "index-manifest-243d52b5-0cfc-4039-bf11-7436f05ebd99-0", | ||
| "commitUser" : "9b190bb7-7a17-4f78-9035-60a019950355", | ||
| "commitIdentifier" : 9223372036854775807, | ||
| "commitKind" : "COMPACT", | ||
| "timeMillis" : 1792572937428, | ||
| "logOffsets" : { }, | ||
| "totalRecordCount" : 3, | ||
| "deltaRecordCount" : -4, | ||
| "changelogRecordCount" : 0, | ||
| "nextRowId" : 0 | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Loosening this condition seems to also enable
KEY_DYNAMICin the cross-partition mode. Please confirm whether this scenario should be supported. If yes, please add the corresponding integration test.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, it seems
ResolveBucketModeshould distinguish betweenBucketMode.KEY_DYNAMICandBucketMode.HASH_DYNAMICbased oncrossPartitionUpdate.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we also add an integration test for the case without DV but requiring MOR? Since the DV switch on/off seems to be orthogonal to dynamic buckets.