anishshri-db commented on code in PR #45038:
URL: https://github.com/apache/spark/pull/45038#discussion_r1480570588
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/RocksDBStateStoreProvider.scala:
##########
@@ -48,54 +50,86 @@ private[sql] class RocksDBStateStoreProvider
override def version: Long = lastVersion
- override def createColFamilyIfAbsent(colFamilyName: String): Unit = {
+ override def createColFamilyIfAbsent(
+ colFamilyName: String,
+ keySchema: StructType,
+ numColsPrefixKey: Int,
+ valueSchema: StructType): Unit = {
verify(colFamilyName != StateStore.DEFAULT_COL_FAMILY_NAME,
s"Failed to create column family with reserved_name=$colFamilyName")
+ verify(useColumnFamilies, "Column families are not supported in this
store")
rocksDB.createColFamilyIfAbsent(colFamilyName)
+ encoderMapLock.synchronized {
+ keyEncoderMap.getOrElseUpdate(colFamilyName,
+ RocksDBStateEncoder.getKeyEncoder(keySchema, numColsPrefixKey))
+
+ valueEncoderMap.getOrElseUpdate(colFamilyName,
+ RocksDBStateEncoder.getValueEncoder(valueSchema))
+ }
Review Comment:
If the entry exists, then we won't replace it actually with the current
changes. But on restart, this can happen. However, for the col family case - we
need to decide interaction with state schema compatibility checker anyway. So
will prefer to do this in a separate PR
--
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]