Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/16352#discussion_r93385438
--- Diff: sql/core/src/main/scala/org/apache/spark/sql/api/r/SQLUtils.scala
---
@@ -276,11 +276,12 @@ private[sql] object SQLUtils extends Logging {
}
def getTableNames(sparkSession: SparkSession, databaseName: String):
Array[String] = {
- databaseName match {
- case n: String if n != null && n.trim.nonEmpty =>
- sparkSession.catalog.listTables(n).collect().map(_.name)
+ val db = databaseName match {
+ case _ if databaseName != null && databaseName.trim.nonEmpty =>
+ databaseName.trim
--- End diff --
uh... not sure whether we should support triming. So far, when we do
something like
```Scala
session.tableNames("default ")
```
It reports the error:
```
Database 'default ' not found;
```
---
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]