hubgeter opened a new pull request, #70506:
URL: https://github.com/apache/doris/pull/70506

   ### Background
   
   Iceberg metadata tables expose decoded file bounds in `readable_metrics` and 
identity partition values in `partition` structs. The SDK represents logical 
UUID values as `java.util.UUID`, and Doris maps these fields to its native UUID 
type. The metadata scanner passes SDK values through a column adapter into the 
JNI vector.
   
   ### What problem does this PR solve?
   
   Issue Number: None
   Related PR: #68786 (native external UUID mappings), #65262 (metadata scan 
projection), #68985 (typed metadata adapters)
   PR Type: Bugfix
   
   Problem Summary:
   Queries selecting metadata structures containing non-null UUID bounds or 
partition values fail with `java.util.UUID cannot be cast to java.lang.String`. 
The metadata adapter inherits a UUID getter that parses `getString()`, while 
its string getter casts the SDK object to `String`. Override the UUID getter to 
return the existing SDK UUID directly, preserving the current vector encoding 
and recursive container handling. Most of the diff adds tests for SDK bounds, 
partitions, UUID bit boundaries, NULLs, containers and neighboring types.
   
   ### Details
   
   - **Frequency:** Whenever a selected metadata value reaches the UUID vector 
as a non-null SDK UUID. Bounds require the file metadata to contain UUID 
statistics; projecting unrelated scalar fields avoids this getter.
   - **Root cause:** `VectorColumn.appendValue()` calls 
`ColumnValue.getUuid()`, whose default implementation calls 
`UUID.fromString(getString())`. `IcebergSysTableColumnValue.getString()` then 
casts `java.util.UUID` to `String` before parsing can start.
   - **Why existing tests missed it:** Metadata adapter tests exercised 
timestamp precision and nested timestamp types, but did not pass SDK UUID 
values through the actual adapter and vector together.
   - **Fix:** Implement `IcebergSysTableColumnValue.getUuid()` as a direct UUID 
cast. The production change is six added lines including the import. NULL 
handling remains in the vector; structs, arrays and maps reuse the same 
adapter. No SDK, file format, protocol or native vector layout change is needed.
   - **Other paths and branches:** Ordinary native data-file reads are 
unchanged. Current `branch-4.2` at `1bb4a49bddc8a505003d2067cc56f0dc3432f23f` 
has the same native UUID mapping and missing metadata getter, so a backport is 
recommended. It uses `java-common` rather than `jni-spi`; test imports must be 
adapted and validated against its Iceberg 1.11.0 dependency. No branch-4.2 
runtime validation is claimed by this PR.
   - **Behavior change:** Metadata UUID values preserve their 128-bit value 
instead of failing a String cast. Other adapters retain the existing default 
UUID getter.
   
   ### Testing
   
   Local validation on master `e125ea858678fd2aea5ebf179359650aa77fabb6` plus 
this change:
   
   - Before changing production code, five UUID tests each reproduced the same 
`ClassCastException`, including SDK-decoded lower/upper bounds and an identity 
`PartitionData` value.
   - `run-fe-ut.sh --run 
'org.apache.doris.iceberg.*Test,org.apache.doris.jni.spi.vec.*Test'`: 29 tests 
passed, zero failures, errors or skips. A local Maven wrapper limited the 
script's reactor to `iceberg-metadata-scanner`, `jni-spi` and their required 
dependencies.
   - The six new tests cover readable metrics bounds, identity partitions, NULL 
values and parents, zero/all-one/high-bit UUIDs, all adapter constructors, list 
elements, map keys/values, mixed/reordered struct fields and binary output. 
Existing timestamp, vector and serialization tests also passed.
   - Maven `validate` with Checkstyle enabled on the scanner and required 
reactor modules: zero violations, including test sources. `git diff --check` 
passed.
   
   The bounds fixture uses actual SDK metrics decoding but does not create a 
Parquet data file. Live FE/BE metadata SQL, cross-process JNI and a full FE/BE 
build were not run. Remote CI is pending.
   
   ### Release note
   
   Fix Iceberg metadata scans failing on non-null UUID partition values and 
readable metrics bounds.
   
   ### Check List (For Author)
   
   - Behavior changed: Yes (see Details).
   - Does this need documentation: No.
   - Pre-submission status: Not ready: Draft, awaiting CI and human review; 
local component tests and style checks passed, with the integration limits 
described above.
   
   ### AI Disclosure
   
   - Tool: Codex (GPT-6).
   - Generated: Production change, unit tests and this PR description.
   - Human review: Pending.
   


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