amaliujia commented on code in PR #36641:
URL: https://github.com/apache/spark/pull/36641#discussion_r896156559


##########
sql/core/src/main/scala/org/apache/spark/sql/internal/CatalogImpl.scala:
##########
@@ -250,8 +251,14 @@ class CatalogImpl(sparkSession: SparkSession) extends 
Catalog {
    * table/view. This throws an `AnalysisException` when no `Table` can be 
found.
    */
   override def getTable(tableName: String): Table = {
-    val tableIdent = 
sparkSession.sessionState.sqlParser.parseTableIdentifier(tableName)
-    getTable(tableIdent.database.orNull, tableIdent.table)
+    try {
+      val ident = 
sparkSession.sessionState.sqlParser.parseTableIdentifier(tableName)
+      getTable(ident.database.orNull, ident.table)
+    } catch {
+      case e: org.apache.spark.sql.catalyst.parser.ParseException =>
+        val ident = 
sparkSession.sessionState.sqlParser.parseMultipartIdentifier(tableName)

Review Comment:
   No. For arbitrary sequence it can breaks that by dots to a Seq of string.
   
   `sparkSession.sessionState.sqlParser.parseTableIdentifie` will throw 
exception when the input is not `b` or `a.b` thus beyond a table identifier 
which only considers DB and table name in OSS. 



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

Reply via email to