Github user gatorsmile commented on a diff in the pull request: https://github.com/apache/spark/pull/16352#discussion_r93300223 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala --- @@ -747,7 +747,7 @@ class SQLContext private[sql](val sparkSession: SparkSession) * @since 1.3.0 */ def tableNames(): Array[String] = { - sparkSession.catalog.listTables().collect().map(_.name) + sessionState.catalog.listTables(sessionState.catalog.getCurrentDatabase).map(_.table).toArray --- End diff -- The original one is using [`sparkSession.catalog.listTables`](https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/internal/CatalogImpl.scala#L83-L99); the new one is using [`sessionState.catalog.listTables`](https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala#L600-L632). The implementation of these two function calls are different. The later one is using [getTablesByPattern](https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java#L1371-L1381). To be honest, I did not notice the difference at the beginning. : )
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org