MisterRaindrop commented on code in PR #127: URL: https://github.com/apache/iceberg-cpp/pull/127#discussion_r2173277246
########## src/iceberg/avro/avro_reader.cc: ########## @@ -96,11 +99,22 @@ class AvroBatchReader::Impl { // Validate field ids in the file schema. HasIdVisitor has_id_visitor; ICEBERG_RETURN_UNEXPECTED(has_id_visitor.Visit(file_schema)); + if (has_id_visitor.HasNoIds()) { - // TODO(gangwu): support applying field-ids based on name mapping - return NotImplemented("Avro file schema has no field IDs"); - } - if (!has_id_visitor.AllHaveIds()) { + // Apply field IDs based on name mapping if available + auto name_mapping_iter = options.properties.find("name_mapping"); Review Comment: Let me understand this. name_mapping in ReaderOptions ``` struct ReaderOptions { ... std::shared_ptr<class NameMapping> name_mapping; } ``` then user create reader options with name mapping, and if `options.name_mapping` have call `ApplyFieldIdsFromNameMapping(*options.name_mapping, file_schema.root()))` to parse? Do you mean this? @wgtmac -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org