[Bug]: In the MergeInto statement, if a subquery is used for the source table, it cannot correctly identify whether the condition contains the primary key. #3436
Labels
type:bug
Something isn't working
What happened?
When using the MergeInto statement, if you execute the filter method after obtaining the references attribute from the Expression object, the Attribute attribute you get will be the column names in the on clause, and you won't be able to correctly obtain the specific columns in the alias table.
Here is an example:
In this way, I will get an UnsupportedOperationException. Exception message is "The condition {'a.id, 'b.id} is not allowed because it is not a primary key."
In org.apache.amoro.spark.sql.catalyst.analysis.ResolveMergeIntoMixedFormatTableReferences#checkConditionIsPrimaryKey if using cond.references then i'll get 'a.id with 'b.id,not id#1 or id#2.
Affects Versions
0.7.1
What table formats are you seeing the problem on?
No response
What engines are you seeing the problem on?
No response
How to reproduce
No response
Relevant log output
Anything else
No response
Are you willing to submit a PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: