anishshri-db commented on code in PR #47778:
URL: https://github.com/apache/spark/pull/47778#discussion_r1719155218


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/RocksDBStateStoreProvider.scala:
##########
@@ -62,17 +60,19 @@ private[sql] class RocksDBStateStoreProvider
         valueSchema: StructType,
         keyStateEncoderSpec: KeyStateEncoderSpec,
         useMultipleValuesPerKey: Boolean = false,
-        isInternal: Boolean = false): Unit = {
-      val newColFamilyId = 
ColumnFamilyUtils.createColFamilyIfAbsent(colFamilyName, isInternal)
+        isInternal: Boolean = false): Short = {
+      val newColFamilyId = rocksDB.createColFamilyIfAbsent(colFamilyName, 
isInternal)
 
       keyValueEncoderMap.putIfAbsent(colFamilyName,
-        (RocksDBStateEncoder.getKeyEncoder(keyStateEncoderSpec, 
useColumnFamilies, newColFamilyId),
-         RocksDBStateEncoder.getValueEncoder(valueSchema, 
useMultipleValuesPerKey)))
+        (RocksDBStateEncoder.getKeyEncoder(keyStateEncoderSpec, 
useColumnFamilies,
+          Some(newColFamilyId)), 
RocksDBStateEncoder.getValueEncoder(valueSchema,
+          useMultipleValuesPerKey)))
+      newColFamilyId
     }
 
     override def get(key: UnsafeRow, colFamilyName: String): UnsafeRow = {
       verify(key != null, "Key cannot be null")
-      ColumnFamilyUtils.verifyColFamilyOperations("get", colFamilyName)
+      rocksDB.verifyColFamilyOperations("get", colFamilyName)

Review Comment:
   we can refactor this a little bit right ? we don't need to call into the 
store. just move those functions to the provider ?



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