yadavay-amzn commented on code in PR #57468:
URL: https://github.com/apache/spark/pull/57468#discussion_r3677055664
##########
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:
You're right. `patternToRegex` now escapes the regex metacharacters
(`\.[]{}()*+?^$|`) so only `%`/`_` stay as wildcards: `db*` and a bare `*` are
literals now (no match, no throw), while `db%`/`db_` still work. Added the
counterexamples to the suite (`db*`, `.*`, `db.`, `*` all return empty). One
knock-on: `SparkGetFunctionsOperation` was passing `patternToRegex(...)` into
`listFunctions`, which actually wants `filterPattern`'s `*`-wildcard semantics
(its tests use `overla*`), so escaping `*` would have broken it. I dropped the
`patternToRegex` call there and pass the pattern straight to `listFunctions`,
which is what it expected.
--
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]