Github user yhuai commented on a diff in the pull request:
https://github.com/apache/spark/pull/12104#discussion_r58426294
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/InMemoryCatalog.scala
---
@@ -48,7 +48,7 @@ class InMemoryCatalog extends ExternalCatalog {
private val catalog = new scala.collection.mutable.HashMap[String,
DatabaseDesc]
private def filterPattern(names: Seq[String], pattern: String):
Seq[String] = {
- val regex = pattern.replaceAll("\\*", ".*").r
+ val regex = pattern.replaceAll("\\.\\*", "\\*").replaceAll("\\*",
"\\.\\*").r
--- End diff --
Looks like Hive's doc does not really match its implementation. I also took
a look at postgres
(http://www.postgresql.org/docs/9.1/static/app-psql.html#APP-PSQL-PATTERNS) and
impala
(http://www.cloudera.com/documentation/archive/impala/2-x/2-1-x/topics/impala_show.html#show_functions_unique_1).
`*` will be interpreted as `.*` in regex. Also, looking at our current
implementation, we do not really have a super clear syntax for the pattern. I
feel it will be better to decide the syntax first and then make the change.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]