YannByron commented on code in PR #6264:
URL: https://github.com/apache/hudi/pull/6264#discussion_r942000073


##########
hudi-spark-datasource/hudi-spark3-common/src/main/scala/org/apache/spark/sql/HoodieSpark3CatalystPlanUtils.scala:
##########
@@ -52,8 +57,56 @@ abstract class HoodieSpark3CatalystPlanUtils extends 
HoodieCatalystPlansUtils {
     }
   }
 
-  override def toTableIdentifier(relation: UnresolvedRelation): 
TableIdentifier = {
-    relation.multipartIdentifier.asTableIdentifier
+  override def resolve(spark: SparkSession, relation: UnresolvedRelation): 
Option[CatalogTable] = {

Review Comment:
   @alexeykudinkin both `UnresolvedRelation` and `UnresolvedTable` call 
`resolveOperatorsUpWithPruning` to make itself and it's children to apply the 
Rule.
   
![image](https://user-images.githubusercontent.com/10036681/183813122-93e16d66-15d1-4307-ae1b-149d67b0e000.png)
   
   But for the sql `insert into target_table select col1, col2 from 
source_table`, only `select col1, col2 from source_table` as the query of 
`InsertIntoStatement` is it's child, `target_table` as the table of 
`InsertIntoStatement` is not. So the table LogicalPlan can't be applied by 
`ResolvedRelation` or `ResolvedTable`.
   
![image](https://user-images.githubusercontent.com/10036681/183814152-b043b4b0-013b-4ddd-8c52-b7f8f51aeeee.png)
   



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