juliuszsompolski commented on a change in pull request #29834:
URL: https://github.com/apache/spark/pull/29834#discussion_r494156528
##########
File path:
sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetSchemasOperation.scala
##########
@@ -77,7 +77,8 @@ private[hive] class SparkGetSchemasOperation(
val globalTempViewDb =
sqlContext.sessionState.catalog.globalTempViewManager.database
val databasePattern =
Pattern.compile(CLIServiceUtils.patternToRegex(schemaName))
- if (databasePattern.matcher(globalTempViewDb).matches()) {
+ if (schemaName == null || schemaName.isEmpty ||
Review comment:
https://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html#getSchemas(java.lang.String,%20java.lang.String)
`schemaPattern - a schema name; must match the schema name as it is stored
in the database; null means schema name should not be used to narrow down the
search.`
This doc doesn't mention empty string, but if it's treated as a pattern, it
should default to empty string not matching anything.
schemaName == null is already handled to match everything in patternToRegex:
```
public static String patternToRegex(String pattern) {
if (pattern == null) {
return ".*";
} else {
```
So the current behaviour seems to be consistent with JDBC documentation?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]