EnricoMi commented on code in PR #45462:
URL: https://github.com/apache/arrow/pull/45462#discussion_r2404401595


##########
cpp/src/parquet/schema.cc:
##########
@@ -68,11 +68,25 @@ std::shared_ptr<ColumnPath> ColumnPath::FromDotString(const 
std::string& dotstri
 }
 
 std::shared_ptr<ColumnPath> ColumnPath::FromNode(const Node& node) {
+  return FromNode(node, false);
+}
+
+std::shared_ptr<ColumnPath> ColumnPath::FromNode(const Node& node, bool 
schema_path) {
   // Build the path in reverse order as we traverse the nodes to the top
   std::vector<std::string> rpath_;
   const Node* cursor = &node;
   // The schema node is not part of the ColumnPath
   while (cursor->parent()) {
+    if (schema_path &&
+        (
+            // nested fields in arrow schema do not know these intermediate 
nodes
+            cursor->parent()->converted_type() == ConvertedType::MAP ||
+            cursor->parent()->converted_type() == ConvertedType::LIST ||
+            (cursor->parent()->parent() &&
+             cursor->parent()->parent()->converted_type() == 
ConvertedType::LIST))) {
+      cursor = cursor->parent();
+      continue;
+    }

Review Comment:
   This specific logic has been removed. Lookup logic has been simplified to 
looking up column path or root column among the keys. No type-specific logic 
left.



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

Reply via email to