MERGE INTO command doesn't select the correct primary key for tables created using CTAS, whereas it works for tables created using CREATE TABLE command.
I guess we are hitting this issue because the key generator class is set to SqlKeyGenerator for tables created using CTAS:
hoodie.properties for working use-case:
Whereas this doesn't work:
hoodie.properties for not working use-case (CTAS table):
This is a blocker for the dbt integration https://issues.apache.org/jira/browse/HUDI-2319
Please try to fix it as part of the 0.9.0 release so that the dbt integration can be unblocked.