MisterRaindrop commented on code in PR #127: URL: https://github.com/apache/iceberg-cpp/pull/127#discussion_r2174050358
########## src/iceberg/avro/avro_reader.cc: ########## @@ -195,6 +209,147 @@ class AvroBatchReader::Impl { return arrow_array; } + // Apply field IDs to Avro schema nodes based on name mapping + Status ApplyFieldIdsFromNameMapping(const ::avro::NodePtr& node, + const NameMapping& name_mapping) { + switch (node->type()) { + case ::avro::AVRO_RECORD: + return ApplyFieldIdsToRecord(node, name_mapping); + case ::avro::AVRO_ARRAY: + return ApplyFieldIdsToArray(node, name_mapping); + case ::avro::AVRO_MAP: + return ApplyFieldIdsToMap(node, name_mapping); + case ::avro::AVRO_UNION: + return ApplyFieldIdsToUnion(node, name_mapping); + case ::avro::AVRO_BOOL: + case ::avro::AVRO_INT: + case ::avro::AVRO_LONG: + case ::avro::AVRO_FLOAT: + case ::avro::AVRO_DOUBLE: + case ::avro::AVRO_STRING: + case ::avro::AVRO_BYTES: + case ::avro::AVRO_FIXED: + return {}; + case ::avro::AVRO_NULL: + case ::avro::AVRO_ENUM: + default: + return InvalidSchema("Unsupported Avro type for field ID application: {}", + static_cast<int>(node->type())); Review Comment: Do we need to make the changes? I noticed that the other code in the file also follows this style. -- 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