Gabriel39 commented on code in PR #65784:
URL: https://github.com/apache/doris/pull/65784#discussion_r3610467204
##########
be/src/format/table/table_schema_change_helper.cpp:
##########
@@ -556,25 +587,26 @@ Status
TableSchemaChangeHelper::BuildTableInfoUtil::by_parquet_field_id_with_nam
const auto& parquet_fields_schema = parquet_field_desc.get_fields_schema();
std::map<int32_t, size_t> file_column_id_idx_map;
- bool all_have_field_id = true;
+ // Iceberg considers the schema ID-bearing when any field has an ID;
requiring all IDs would
+ // discard authoritative matches merely because an unrelated sibling is
ID-less.
+ bool has_field_id = false;
for (size_t idx = 0; idx < parquet_fields_schema.size(); idx++) {
- if (parquet_fields_schema[idx].field_id == -1) {
- all_have_field_id = false;
- break;
+ if (parquet_fields_schema[idx].field_id != -1) {
+ has_field_id = true;
+
file_column_id_idx_map.emplace(parquet_fields_schema[idx].field_id, idx);
}
- file_column_id_idx_map.emplace(parquet_fields_schema[idx].field_id,
idx);
}
std::map<std::string, size_t> file_column_name_idx_map;
- if (!all_have_field_id) {
+ if (!has_field_id) {
file_column_name_idx_map =
build_lowercase_field_name_idx_map(parquet_fields_schema);
}
for (const auto& table_field : table_schema.fields) {
const auto& table_column_name = table_field.field_ptr->name;
size_t file_column_idx = 0;
bool matched = false;
- if (all_have_field_id) {
+ if (has_field_id) {
Review Comment:
Fixed in b4909eb6c09. The V1 Parquet mapping now applies the same unique
descendant-field-ID wrapper discovery at the root and at every struct recursion
depth, while keeping ORC unchanged. Added the requested actual V1 reader result
test for mixed roots (id#1 plus s(no id)<a#2>); it reads the nested value 42.
--
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]