cloud-fan commented on code in PR #57468:
URL: https://github.com/apache/spark/pull/57468#discussion_r3675495403


##########
sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/SparkMetadataOperationSuite.scala:
##########
@@ -55,7 +56,10 @@ class SparkMetadataOperationSuite extends 
HiveThriftServer2TestBase {
         checkResult(metaData.getSchemas(null, pattern), dbs ++ dbDflts)
       }
 
-      Seq("db%", "db*") foreach { pattern =>
+      // Note: "db*" was removed because `*` is not a valid JDBC wildcard 
character
+      // (only `%` and `_` are); on the DSv2 SupportsNamespaces path it is 
treated as a

Review Comment:
   JDBC pattern matching should treat characters other than `%` and `_` 
literally, but `patternToRegex` leaves Java regex metacharacters unescaped. As 
a result, `db*` matches schemas named `db` or `dbb`, while a bare `*` throws a 
pattern error; the current `db1`/`db2` fixture only hides this. Please quote 
regex metacharacters in `patternToRegex` while preserving the `%`/`_` 
translations, and add `db`/`dbb` counterexamples here.



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