yaooqinn commented on a change in pull request #29834:
URL: https://github.com/apache/spark/pull/29834#discussion_r494171538



##########
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:
       Thanks @juliuszsompolski 
   
   The java doc makes sense to me.
   
   FYI, the current behavior in hive treats "" as wildcard,
   
   ```java
     /**
      * Convert wildchars and escape sequence of schema pattern from JDBC 
format to datanucleous/regex
      * The schema pattern treats empty string also as wildchar
      */
   
   ```
   
https://github.com/apache/hive/blob/14e3f19d027858a6f36ea6d41a3e8e45625f91bf/service/src/java/org/apache/hive/service/cli/operation/MetadataOperation.java#L75
   
   We followed the hive behavior so far after we inlined the hive codes and 
before we made our own meta operations.
   
   But now, "" is treated as wildcard for all schemas except ”global_temp“.
   
   I guess we should either make it not a wildcard at all as JDBC API doc says 
or make it as same as null just like hive 
   
   




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

Reply via email to