sahnib commented on code in PR #44961:
URL: https://github.com/apache/spark/pull/44961#discussion_r1480664465


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/RocksDB.scala:
##########
@@ -316,6 +321,25 @@ class RocksDB(
     }
   }
 
+  def merge(key: Array[Byte], value: Array[Byte],
+            colFamilyName: String = StateStore.DEFAULT_COL_FAMILY_NAME): Unit 
= {
+    verifyColFamilyExists(colFamilyName)
+
+    if (conf.trackTotalNumberOfRows) {
+      val oldValue = db.get(colFamilyNameToHandleMap(colFamilyName), 
readOptions, key)
+      if (oldValue == null) {
+        numKeysOnWritingVersion += 1
+      }
+    }
+    db.merge(colFamilyNameToHandleMap(colFamilyName), writeOptions, key, value)
+
+    if (useColumnFamilies) {
+      changelogWriter.foreach(_.merge(key, value, colFamilyName))
+    } else {
+      changelogWriter.foreach(_.merge(key, value))

Review Comment:
   I agree we probably won't use it in near future, but I don't see a reason to 
restrict it only to column families. The changes work as expected, and can be 
used for `default` column family in future if need arises. 



-- 
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]

Reply via email to