diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/RocksDBStateStoreProvider.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/RocksDBStateStoreProvider.scala index 93706d24f343c..11cb0eb95b000 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/RocksDBStateStoreProvider.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/RocksDBStateStoreProvider.scala @@ -398,9 +398,11 @@ private[sql] class RocksDBStateStoreProvider val avroEnc = getAvroEnc( stateStoreEncoding, avroEncCacheKey, keyStateEncoderSpec, valueSchema) - if (useColumnFamilies) { + val columnFamilyInfo = if (useColumnFamilies) { defaultColFamilyId = Some(rocksDB.createColFamilyIfAbsent(StateStore.DEFAULT_COL_FAMILY_NAME)) - val columnFamilyInfo = Some(ColumnFamilyInfo(colFamilyName, defaultColFamilyId.get)) + Some(ColumnFamilyInfo(colFamilyName, defaultColFamilyId.get)) + } else { + None } val provider = RocksDBStateStoreProvider.this