github-actions[bot] commented on code in PR #69171:
URL: https://github.com/apache/doris/pull/69171#discussion_r4296299676


##########
be/src/format/parquet/schema_desc.cpp:
##########
@@ -316,12 +317,8 @@ std::pair<DataTypePtr, bool> 
FieldDescriptor::convert_to_doris_type(
     } else if (logicalType.__isset.JSON) {
         ans.first = DataTypeFactory::instance().create_data_type(TYPE_STRING, 
nullable);
     } else if (logicalType.__isset.UUID) {
-        if (_enable_mapping_varbinary) {
-            ans.first = 
DataTypeFactory::instance().create_data_type(TYPE_VARBINARY, nullable, -1,
-                                                                     -1, 16);
-        } else {
-            ans.first = 
DataTypeFactory::instance().create_data_type(TYPE_STRING, nullable);
-        }
+        // The raw-binary default must not override UUID's existing 
canonical-text contract.
+        ans.first = DataTypeFactory::instance().create_data_type(TYPE_STRING, 
nullable);

Review Comment:
   [P1] Preserve raw UUID bytes for schema-declared BINARY columns
   
   This shared parser also serves Hive `BINARY` columns, which map to 
`VARBINARY` with binary mapping enabled. Registering the existing 
`uuid_plain.parquet` fixture as a Hive table with `u BINARY` makes id=1's 
sixteen zero bytes take `UUIDStringConverter` and then 
`VarBinaryConverter<STRING,VARBINARY>`, so `LENGTH(u)` changes from 16 to 36 
and `HEX(u)` contains the canonical UUID's ASCII bytes. Only Iceberg enables 
`preserve_binary_uuid`. The companion V2 change similarly emits `UUID`, but the 
mapper's UUID-to-VARBINARY cast is rejected by `create_varbinary_wrapper`, 
which accepts only STRING; annotated ORC binary targets have the same gap. 
Preserve a raw carrier for explicitly declared binary targets or add a 
bytes-preserving conversion, and cover Hive BINARY plus nested children with 
both scanner versions. This is distinct from the fixed ENUM TVF/CTAS issue.



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