vbhanuchander-lang commented on PR #17079:
URL: https://github.com/apache/iceberg/pull/17079#issuecomment-5518399054

   @thswlsqls same as #17080 — the stale bot closed this on 28 Aug without 
anyone reviewing it, and
   the bug is still on `main`. I reproduced the failure and confirmed your fix 
resolves it.
   
   **Reproduced on `main` (`8ea7d00`, 3 Sep).** Converting a UUID column with
   `write.format.default=parquet` and handing the result to the Parquet writer:
   
   ```
   >>> convertUUID returned: [B
   java.lang.ClassCastException: class [B cannot be cast to class java.util.UUID
   ```
   
   With your patch applied, the same path gives:
   
   ```
   >>> convertUUID returned: java.util.UUID
   >>> parquet write OK, bytes=500
   ```
   
   **Your diagnosis of why is right.** `ParquetValueWriters.uuids()` returns a
   `PrimitiveWriter<UUID>` and does the byte conversion itself, so the `byte[]` 
branch in
   `convertUUID()` hands it the wrong type. The branch matched the writer 
contract until #11904
   changed it; `kafka-connect` was not updated to follow. ORC and Avro were 
never affected because
   that branch only fired for Parquet, which is also why removing it cannot 
regress them.
   
   The full `iceberg-kafka-connect` module is green with the patch, 134 tests.
   
   One thing a reviewer should know, since it is not obvious from the thread: 
the alternative approach
   in #16654 (precompute the UUID-as-bytes flag) was closed unmerged on 8 Aug, 
so this is the only live
   proposal for #17076.
   
   I would add that `testUUIDConversionWithParquet` as it stands only asserts 
what the converter
   returns, so it passes on a converter that still cannot write. A test that 
actually appends through
   `Parquet.write(...)` would pin the contract that broke here — I am happy to 
hand you the one I used
   above if you want it, or leave it as a follow-up.
   
   @bryanck could this be reopened? The change is @thswlsqls'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