chandu-1101 commented on issue #8333:
URL: https://github.com/apache/iceberg/issues/8333#issuecomment-1683714428

   I checked the schemas and there is no datatype called long in it. The 
schemas match perfectly. The same were also shared previously. 
   
   To narrow down the issue i tried the below and see that the issue comes in 
when there is `update` in the sql statement. Even if I try to update only 1 
string column i still get the `ClassCastException`
   
   If i change the merge query to the below then all is good. I tried this by 
running with out the limit. Stil it worked good. The schemas of the `select .. 
limit 100` match with the schema of `x11`.
   
   ```
   sess.sql(""" MERGE INTO x11  t 
                    using ( select * from cdc limit 100)  u 
                    on t.cdc_oid = u.cdc_oid 
   
                      when not matched then insert * """)
   ```
   
   But if i change the same to below
   
   ```
   sess.sql(""" MERGE INTO x11 t 
                    using ( select * from cdc limit 100)  u 
                    on t.cdc_oid = u.cdc_oid
                      when matched then update set t.cdc_pk = '' 
                      when not matched then insert * """)
   
   ```
   
   Then the merge fails with an exception (`Caused by: 
java.lang.ClassCastException: org.apache.spark.unsafe.types.UTF8String cannot 
be cast to java.lang.Long`)
   
   
   When i compare the schemas of `cdc_oid` for both x11 and cdc they are both 
string-s. 
   
   
   


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