damokelis commented on PR #66790:
URL: https://github.com/apache/doris/pull/66790#issuecomment-5369430701

   Found while smoke-testing the DROP PARTITION / RENAME·TRUNCATE TABLE / 
append-only UPDATE-MERGE features on a production disaggregated-storage Doris 
cluster running this branch (commit base `2147f234`, images 
`fe/be-master-paimon2-2147f234-r9/r6`).
   
   **Symptom**: `UPDATE` against a Paimon primary-key table fails when the 
assignment is an un-cast decimal literal targeting a `DOUBLE`/`FLOAT` column:
   
   ```sql
   CREATE TABLE pk_orders (id BIGINT, region STRING, amount DOUBLE, dt DATE)
   ENGINE=paimon PARTITION BY LIST(dt)()
   PROPERTIES ('primary-key' = 'id,dt', 'bucket' = '4');
   
   INSERT INTO pk_orders VALUES (1,'east',100.0,DATE'2026-08-01'); -- succeeds
   
   UPDATE pk_orders SET amount = 999.0 WHERE id = 1; -- fails
   ```
   
   ```
   [JNI_ERROR]JNI exception in JniPaimonWriter::write: RuntimeException: 
PaimonJniWriter write failed: bytes=1272 | CAUSED BY: ClassCastException: class 
org.apache.paimon.data.Decimal cannot be cast to class java.lang.Double 
(org.apache.paimon.data.Decimal is in unnamed module of loader 
org.apache.doris.common.classloader.JniScannerClassLoader; java.lang.Double is 
in module java.base of loader 'boot...
   ```
   
   Workaround confirmed: explicit cast avoids it —
   ```sql
   UPDATE pk_orders SET amount = CAST(999.0 AS DOUBLE) WHERE id = 1; -- succeeds
   ```
   Failure is atomic — the target row/table is left untouched after the failed 
`UPDATE`, no partial write observed.
   
   **Scope check**: this looks distinct from the schema-drift issue `9c5c6ea9` 
already fixed (that one was about 
`PaimonWritePlanProvider#validateBoundColumns` rejecting writes due to a 
DECIMALV3 *type-name* mismatch between bind-time and execute-time schemas). 
Here the write is accepted and reaches the JNI writer, but the literal's 
inferred `DECIMALV3` runtime value is never converted to the target column's 
declared type before being handed to `JniPaimonWriter::write` — `INSERT ... 
VALUES (..., 999.0, ...)` into the same `DOUBLE` column works fine, so the gap 
seems specific to the `UPDATE` row-level-DML assignment-expression path (likely 
somewhere around `PaimonWritePlanProvider` / the JNI writer's value 
materialization, haven't pinned an exact file:line yet).
   
   Happy to help narrow this down further if useful — let me know if a minimal 
repro project/branch would help.
   


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