You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/10/17 17:10:24 UTC

[GitHub] [arrow] lidavidm commented on a diff in pull request #14326: ARROW-14596: [C++][Python] Read table nested struct fields in columns

lidavidm commented on code in PR #14326:
URL: https://github.com/apache/arrow/pull/14326#discussion_r997315906


##########
python/pyarrow/tests/test_dataset.py:
##########
@@ -4787,3 +4787,31 @@ def test_write_dataset_with_scanner_use_projected_schema(tempdir):
         ds.write_dataset(
             scanner, tempdir, partitioning=["original_column"], format="ipc"
         )
+
+
+@pytest.mark.parametrize("format", ("ipc", "parquet"))
+def test_read_table_nested_columns(tempdir, format):
+    if format == "parquet":
+        pytest.importorskip("pyarrow.parquet")
+
+    table = pa.table({"user_id": ["abc123", "qrs456"],
+                      "a.dotted.field": [1, 2],
+                      "interaction": [
+        {"type": "click", "element": "button",
+         "values": [1, 2], "structs":[{"foo": "bar"}]},
+        {"type": "scroll", "element": "window",
+         "values": [3, 4], "structs":[{"fizz": "buzz"}]}
+    ]})

Review Comment:
   Is it worth adding nulls at various levels to ensure they come out right?



-- 
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: github-unsubscribe@arrow.apache.org

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