-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-54824] Add support for multiGet and deleteRange for Rocksdb State Store #53583
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: master
Are you sure you want to change the base?
[SPARK-54824] Add support for multiGet and deleteRange for Rocksdb State Store #53583
Conversation
| val valuesList = db.multiGetAsList(readOptions, keysList) | ||
|
|
||
| // Convert to Array[Array[Byte]] in one line | ||
| valuesList.toArray(new Array[Array[Byte]](valuesList.size())) |
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.
This will invoke another copy ? can we leave it as java.util.List ?
| colFamilyName: String = StateStore.DEFAULT_COL_FAMILY_NAME): UnsafeRow | ||
|
|
||
| def multiGet(keys: Array[UnsafeRow], colFamilyName: String): Iterator[UnsafeRow] = { | ||
| keys.iterator.map(key => get(key, colFamilyName)) |
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.
Why not just do the override in HDFSProvider for this ?
| tryWithProviderResource( | ||
| newStoreProvider( | ||
| keySchemaWithRangeScan, | ||
| RangeKeyScanStateEncoderSpec(keySchemaWithRangeScan, Seq(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.
Should we enforce in the code that deleteRange will only work for range scan encoder ?
| } | ||
| } | ||
|
|
||
| test("multiGet - batch retrieval of multiple keys") { |
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.
Lets add the test for HDFS provider also in case we plan to support it ?
What changes were proposed in this pull request?
Add support for multiGet and deleteRange for Rocksdb State Store
Why are the changes needed?
For some streaming operators, using multiGet and deleteRange can improve the read/write performance.
Does this PR introduce any user-facing change?
No
How was this patch tested?
UT
Was this patch authored or co-authored using generative AI tooling?
No