bkietz commented on a change in pull request #7704:
URL: https://github.com/apache/arrow/pull/7704#discussion_r453241420



##########
File path: cpp/src/parquet/arrow/arrow_schema_test.cc
##########
@@ -644,6 +649,78 @@ TEST_F(TestConvertParquetSchema, 
ParquetRepeatedNestedSchema) {
   ASSERT_NO_FATAL_FAILURE(CheckFlatSchema(arrow_schema));
 }
 
+TEST_F(TestConvertParquetSchema, ColumnSubselection) {
+  std::vector<NodePtr> parquet_fields;
+  std::vector<std::shared_ptr<Field>> arrow_fields;
+  {
+    //   optional int32 leaf1;
+    //   repeated group outerGroup {
+    //     optional int32 leaf2;
+    //     repeated group innerGroup {
+    //       optional int32 leaf3;
+    //     }
+    //   }
+    parquet_fields.push_back(
+        PrimitiveNode::Make("leaf1", Repetition::OPTIONAL, 
ParquetType::INT32));
+    parquet_fields.push_back(GroupNode::Make(
+        "outerGroup", Repetition::REPEATED,
+        {PrimitiveNode::Make("leaf2", Repetition::OPTIONAL, 
ParquetType::INT32),
+         GroupNode::Make(
+             "innerGroup", Repetition::REPEATED,
+             {PrimitiveNode::Make("leaf3", Repetition::OPTIONAL, 
ParquetType::INT32)})}));
+
+    auto inner_group_fields = {::arrow::field("leaf3", INT32, true)};

Review comment:
       Re JSON util: I'm not convinced that would be significantly more concise 
than our (de-facto) DSL with `schema`, `field`, and friends. Here's what I'm 
thinking of:
   
   ```json
   {
     "leaf1": "int32",
     "outerGroup": {
       "nested": "struct",
       "fields": [{
         "leaf2": "int32",
         "innerGroup": {
           "nested": "list not null",
           "fields": [{
             "inner-erGroup": {
               "nested": "struct not null",
               "fields": {
                 "leaf3": "int32"
               }
             }
           }]
         }
       }]
     }
   }
   ```
   
   vs
   
   ```c++
   schema({
     field("leaf1", int32()),
     field("outerGroup", struct_({
       field("leaf2", int32()),
       field("innerGroup", list(
         field("inner-erGroup", struct_({
           field("leaf3", int32())
         }), false)
       ), false),
     }))
   })
   ```




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to