anishshri-db commented on code in PR #45360: URL: https://github.com/apache/spark/pull/45360#discussion_r1514964881
########## sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/RocksDB.scala: ########## @@ -246,25 +246,35 @@ class RocksDB( colFamilyNameToHandleMap.contains(colFamilyName) } - private def verifyColFamilyExists(colFamilyName: String): Unit = { - if (useColumnFamilies && !checkColFamilyExists(colFamilyName)) { - throw new RuntimeException(s"Column family with name=$colFamilyName does not exist") + private def verifyColFamilyExists(operationName: String, colFamilyName: String): Unit = { + if (colFamilyName != StateStore.DEFAULT_COL_FAMILY_NAME) { + if (!useColumnFamilies) { + throw StateStoreErrors.unsupportedOperationException(operationName, + "RocksDBStateStoreProvider and multiple column families disabled") + } + + if (!checkColFamilyExists(colFamilyName)) { + throw StateStoreErrors.unsupportedOperationOnMissingColumnFamily(operationName, + colFamilyName) + } } } /** * Create RocksDB column family, if not created already */ def createColFamilyIfAbsent(colFamilyName: String): Unit = { - if (colFamilyName == StateStore.DEFAULT_COL_FAMILY_NAME) { - throw new SparkUnsupportedOperationException( - errorClass = "_LEGACY_ERROR_TEMP_3197", - messageParameters = Map("colFamilyName" -> colFamilyName).toMap) + // Remove leading and trailing whitespaces + val cfName = colFamilyName.trim Review Comment: Modified to check and throw an exception if some invariants are not met for both the col family operations case and the creation/deletion case -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org