HeartSaVioR commented on code in PR #54083:
URL: https://github.com/apache/spark/pull/54083#discussion_r2772276390
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/RocksDBStateStoreSuite.scala:
##########
@@ -1766,6 +1778,41 @@ class RocksDBStateStoreSuite extends
StateStoreSuiteBase[RocksDBStateStoreProvid
}
}
+ test("validate rocksdb values iterator correctness - blind merge with
operator version 2") {
+ withSQLConf(
+ SQLConf.STATE_STORE_MIN_DELTAS_FOR_SNAPSHOT.key -> "1",
+ SQLConf.STATE_STORE_ROCKSDB_MERGE_OPERATOR_VERSION.key -> "2") {
+
+ tryWithProviderResource(newStoreProvider(useColumnFamilies = true,
+ useMultipleValuesPerKey = true)) { provider =>
+ val store = provider.getStore(0)
+ // We do blind merge than put against non-existing key.
+ // Note that this is only safe with merge operator version 2.
+ merge(store, "a", 0, 1)
+
+ val iterator0 = store.valuesIterator(dataToKeyRow("a", 0))
+
+ assert(iterator0.hasNext)
+ assert(valueRowToData(iterator0.next()) === 1)
+ assert(!iterator0.hasNext)
+
+ merge(store, "a", 0, 2)
Review Comment:
https://github.com/apache/spark/pull/54083/commits/959b0d6416b1ba7208c4e3152e898921512ec435
Addressed.
--
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]