amaliujia commented on code in PR #37000:
URL: https://github.com/apache/spark/pull/37000#discussion_r907948285
##########
sql/core/src/main/scala/org/apache/spark/sql/internal/CatalogImpl.scala:
##########
@@ -208,8 +209,18 @@ class CatalogImpl(sparkSession: SparkSession) extends
Catalog {
*/
@throws[AnalysisException]("table does not exist")
override def listColumns(tableName: String): Dataset[Column] = {
- val tableIdent =
sparkSession.sessionState.sqlParser.parseTableIdentifier(tableName)
- listColumns(tableIdent)
+ // calling `sqlParser.parseTableIdentifier` to parse tableName. If it
contains only table name
+ // and optionally contains a database name(thus a TableIdentifier), then
we look up the table in
+ // sessionCatalog. Otherwise we try `sqlParser.parseMultipartIdentifier`
to have a sequence of
+ // string as the qualified identifier and resolve the table through SQL
analyzer.
+ try {
+ val tableIdent =
sparkSession.sessionState.sqlParser.parseTableIdentifier(tableName)
+ listColumns(tableIdent)
Review Comment:
Similarly as `getTable`:
https://github.com/apache/spark/blob/b88cabb754073e69ce82fd561e6eac15046e633e/sql/core/src/main/scala/org/apache/spark/sql/internal/CatalogImpl.scala#L260
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]