ammarchalifah opened a new issue, #15349:
URL: https://github.com/apache/iceberg/issues/15349

   ### Apache Iceberg version
   
   None
   
   ### Query engine
   
   None
   
   ### Please describe the bug 🐞
   
   I have a target table & input table, both are written in Iceberg. Based on 
the manifest, the partition spec of target table is:
   ```
   
"partition-specs":[{"spec-id":0,"fields":[{"name":"collected_date","transform":"identity","source-id":29,"field-id":1000},{"name":"user_id_bucket","transform":"bucket[32]","source-id":2,"field-id":1001}]}]
   ```
   
   And partition spec of input table is 
   ```
   
"partition-specs":[{"spec-id":0,"fields":[{"name":"collected_date","transform":"identity","source-id":29,"field-id":1000},{"name":"user_id_bucket","transform":"bucket[32]","source-id":2,"field-id":1001}]}]
   ```
   
   The field `user_id` is originally a string column, but the bucketed value 
turns to Integer. I'm running SPJ by doing a `MERGE INTO` with join on `user_id`
   ```
   MERGE INTO target AS t
           USING source AS s
           ON t.post_id = s.post_id AND t.user_id = s.user_id
           WHEN MATCHED AND (t.collected_at IS NULL OR t.collected_at <= 
s.collected_at)
               THEN UPDATE SET *
           WHEN NOT MATCHED
               THEN INSERT *
   ```
   
   The `MERGE INTO` fails with this error
   ```
   pyspark.errors.exceptions.captured.IllegalArgumentException: Wrong class, 
expected java.lang.CharSequence, but was java.lang.Integer, for object: 1
   ```
   
   Here's the trace
   ```
   2026-02-17 15:06:12,666 - job - ERROR - Error: Wrong class, expected 
java.lang.CharSequence, but was java.lang.Integer, for object: 1
   Traceback (most recent call last):
     File 
"/mnt/yarn/usercache/hadoop/appcache/application_1771340623606_0001/container_1771340623606_0001_01_000001/pyspark.zip/pyspark/sql/session.py",
 line 1631, in sql
     File 
"/mnt/yarn/usercache/hadoop/appcache/application_1771340623606_0001/container_1771340623606_0001_01_000001/py4j-0.10.9.7-src.zip/py4j/java_gateway.py",
 line 1322, in __call__
     File 
"/mnt/yarn/usercache/hadoop/appcache/application_1771340623606_0001/container_1771340623606_0001_01_000001/pyspark.zip/pyspark/errors/exceptions/captured.py",
 line 185, in deco
   pyspark.errors.exceptions.captured.IllegalArgumentException: Wrong class, 
expected java.lang.CharSequence, but was java.lang.Integer, for object: 1
   ```
   
   ### Willingness to contribute
   
   - [ ] I can contribute a fix for this bug independently
   - [x] I would be willing to contribute a fix for this bug with guidance from 
the Iceberg community
   - [ ] I cannot contribute a fix for this bug at this time


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