rahil-c commented on code in PR #18432:
URL: https://github.com/apache/hudi/pull/18432#discussion_r3033715904


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/sql/hudi/analysis/HoodieSparkBaseAnalysis.scala:
##########
@@ -310,6 +327,55 @@ case class ResolveReferences(spark: SparkSession) extends 
Rule[LogicalPlan]
       sparkAdapter.getCatalystPlanUtils.unapplyMergeIntoTable(plan)
   }
 
+  private def resolveTableToDf(tableName: String): DataFrame = {
+    if (tableName.contains(StoragePath.SEPARATOR)) {
+      spark.read.format("hudi").load(tableName)
+    } else {

Review Comment:
   @yihua Actually it seems that `spark.table(tableName)` can resolve multipart 
indentifier. However will add the exception to make it more clear.
   ```
   private def resolveTableToDf(tableName: String): DataFrame = {
       try {
         if (tableName.contains(StoragePath.SEPARATOR)) {
           spark.read.format("hudi").load(tableName)
         } else {
           // spark.table() supports multi-part identifiers (e.g. 
catalog.db.table)
           spark.table(tableName)
         }
       } catch {
         case e: Exception => throw new HoodieAnalysisException(
           s"hudi_vector_search: unable to resolve table '$tableName': 
${e.getMessage}")
       }
     }
   
   ```



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

Reply via email to