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/04/18 00:20:27 UTC

[GitHub] [arrow-rs] viirya opened a new pull request, #1583: Read/write nested dictionary under map in ipc stream reader/writer

viirya opened a new pull request, #1583:
URL: https://github.com/apache/arrow-rs/pull/1583

   # Which issue does this PR close?
   
   <!---
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes #1582.
   
   # Rationale for this change
    
    <!---
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
   -->
   
   # What changes are included in this PR?
   
   <!---
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   # Are there any user-facing changes?
   
   
   <!---
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!---
   If there are any breaking changes to public APIs, please add the `breaking change` label.
   -->
   


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


[GitHub] [arrow-rs] tustvold commented on a diff in pull request #1583: Read/write nested dictionary under map in ipc stream reader/writer

Posted by GitBox <gi...@apache.org>.
tustvold commented on code in PR #1583:
URL: https://github.com/apache/arrow-rs/pull/1583#discussion_r852816223


##########
arrow/src/ipc/reader.rs:
##########
@@ -1481,4 +1481,55 @@ mod tests {
         let output_batch = roundtrip_ipc_stream(&input_batch);
         assert_eq!(input_batch, output_batch);
     }
+
+    #[test]
+    fn test_roundtrip_stream_nested_dict_dict_in_map() {
+        let values = StringArray::from_iter_values(["a", "b", "c"]);
+        let keys = Int8Array::from_iter_values([0, 0, 1, 2, 0, 1]);
+        let dict_array = DictionaryArray::<Int8Type>::try_new(&keys, &values).unwrap();
+
+        let keys_array = Int32Array::from_iter_values([0, 0, 1, 2, 0, 1]);
+        let keys_field = Field::new("keys", DataType::Int32, false);
+        let values_field = Field::new_dict(
+            "values",
+            DataType::Dictionary(Box::new(DataType::Int8), Box::new(DataType::Utf8)),
+            false,

Review Comment:
   Could also test some NULLs



##########
arrow/src/ipc/reader.rs:
##########
@@ -1481,4 +1481,55 @@ mod tests {
         let output_batch = roundtrip_ipc_stream(&input_batch);
         assert_eq!(input_batch, output_batch);
     }
+
+    #[test]
+    fn test_roundtrip_stream_nested_dict_dict_in_map() {
+        let values = StringArray::from_iter_values(["a", "b", "c"]);
+        let keys = Int8Array::from_iter_values([0, 0, 1, 2, 0, 1]);
+        let dict_array = DictionaryArray::<Int8Type>::try_new(&keys, &values).unwrap();
+
+        let keys_array = Int32Array::from_iter_values([0, 0, 1, 2, 0, 1]);
+        let keys_field = Field::new("keys", DataType::Int32, false);

Review Comment:
   Might want to test dictionary encoded keys as well



##########
arrow/src/ipc/reader.rs:
##########
@@ -1481,4 +1481,55 @@ mod tests {
         let output_batch = roundtrip_ipc_stream(&input_batch);
         assert_eq!(input_batch, output_batch);
     }
+
+    #[test]
+    fn test_roundtrip_stream_nested_dict_dict_in_map() {

Review Comment:
   ```suggestion
       fn test_roundtrip_stream_nested_dict_of_map_of_dict() {
   ```



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


[GitHub] [arrow-rs] viirya commented on pull request #1583: Read/write nested dictionary under map in ipc stream reader/writer

Posted by GitBox <gi...@apache.org>.
viirya commented on PR #1583:
URL: https://github.com/apache/arrow-rs/pull/1583#issuecomment-1104192407

   Thank you @tustvold 


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


[GitHub] [arrow-rs] viirya commented on pull request #1583: Read/write nested dictionary under map in ipc stream reader/writer

Posted by GitBox <gi...@apache.org>.
viirya commented on PR #1583:
URL: https://github.com/apache/arrow-rs/pull/1583#issuecomment-1102917337

   Thank you @tustvold. Revised based on the suggestions.


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


[GitHub] [arrow-rs] tustvold commented on a diff in pull request #1583: Read/write nested dictionary under map in ipc stream reader/writer

Posted by GitBox <gi...@apache.org>.
tustvold commented on code in PR #1583:
URL: https://github.com/apache/arrow-rs/pull/1583#discussion_r853812149


##########
arrow/src/ipc/reader.rs:
##########
@@ -1483,23 +1483,33 @@ mod tests {
     }
 
     #[test]
-    fn test_roundtrip_stream_nested_dict_dict_in_map() {
-        let values = StringArray::from_iter_values(["a", "b", "c"]);
-        let keys = Int8Array::from_iter_values([0, 0, 1, 2, 0, 1]);
-        let dict_array = DictionaryArray::<Int8Type>::try_new(&keys, &values).unwrap();
-
-        let keys_array = Int32Array::from_iter_values([0, 0, 1, 2, 0, 1]);
-        let keys_field = Field::new("keys", DataType::Int32, false);
+    fn test_roundtrip_stream_nested_dict_of_map_of_dict() {
+        let values = StringArray::from(vec![Some("a"), None, Some("b"), Some("c")]);

Review Comment:
   Dictionaries store nulls in the keys and not the values, I'm not actually sure what this will do tbh



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


[GitHub] [arrow-rs] codecov-commenter commented on pull request #1583: Read/write nested dictionary under map in ipc stream reader/writer

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #1583:
URL: https://github.com/apache/arrow-rs/pull/1583#issuecomment-1100983993

   # [Codecov](https://codecov.io/gh/apache/arrow-rs/pull/1583?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1583](https://codecov.io/gh/apache/arrow-rs/pull/1583?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (14bc547) into [master](https://codecov.io/gh/apache/arrow-rs/commit/6bb6ed0a94361319fd393d45ed45f29b4e87685a?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (6bb6ed0) will **increase** coverage by `0.00%`.
   > The diff coverage is `76.19%`.
   
   ```diff
   @@           Coverage Diff           @@
   ##           master    #1583   +/-   ##
   =======================================
     Coverage   82.87%   82.87%           
   =======================================
     Files         193      193           
     Lines       55304    55348   +44     
   =======================================
   + Hits        45832    45870   +38     
   - Misses       9472     9478    +6     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/arrow-rs/pull/1583?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [arrow/src/datatypes/field.rs](https://codecov.io/gh/apache/arrow-rs/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXJyb3cvc3JjL2RhdGF0eXBlcy9maWVsZC5ycw==) | `54.62% <0.00%> (ø)` | |
   | [arrow/src/ipc/writer.rs](https://codecov.io/gh/apache/arrow-rs/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXJyb3cvc3JjL2lwYy93cml0ZXIucnM=) | `80.78% <50.00%> (-1.02%)` | :arrow_down: |
   | [arrow/src/ipc/reader.rs](https://codecov.io/gh/apache/arrow-rs/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXJyb3cvc3JjL2lwYy9yZWFkZXIucnM=) | `89.00% <100.00%> (+0.39%)` | :arrow_up: |
   | [arrow/src/datatypes/datatype.rs](https://codecov.io/gh/apache/arrow-rs/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXJyb3cvc3JjL2RhdGF0eXBlcy9kYXRhdHlwZS5ycw==) | `66.40% <0.00%> (-0.40%)` | :arrow_down: |
   | [arrow/src/compute/kernels/substring.rs](https://codecov.io/gh/apache/arrow-rs/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXJyb3cvc3JjL2NvbXB1dGUva2VybmVscy9zdWJzdHJpbmcucnM=) | `98.31% <0.00%> (ø)` | |
   | [arrow/src/compute/kernels/cast.rs](https://codecov.io/gh/apache/arrow-rs/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXJyb3cvc3JjL2NvbXB1dGUva2VybmVscy9jYXN0LnJz) | `95.74% <0.00%> (+<0.01%)` | :arrow_up: |
   | [parquet/src/column/writer.rs](https://codecov.io/gh/apache/arrow-rs/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldC9zcmMvY29sdW1uL3dyaXRlci5ycw==) | `92.42% <0.00%> (+<0.01%)` | :arrow_up: |
   | [parquet/src/file/properties.rs](https://codecov.io/gh/apache/arrow-rs/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldC9zcmMvZmlsZS9wcm9wZXJ0aWVzLnJz) | `95.76% <0.00%> (+0.01%)` | :arrow_up: |
   | [parquet/src/encodings/encoding.rs](https://codecov.io/gh/apache/arrow-rs/pull/1583/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGFycXVldC9zcmMvZW5jb2RpbmdzL2VuY29kaW5nLnJz) | `93.56% <0.00%> (+0.18%)` | :arrow_up: |
   | ... and [1 more](https://codecov.io/gh/apache/arrow-rs/pull/1583/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/arrow-rs/pull/1583?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/arrow-rs/pull/1583?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [6bb6ed0...14bc547](https://codecov.io/gh/apache/arrow-rs/pull/1583?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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


[GitHub] [arrow-rs] tustvold commented on a diff in pull request #1583: Read/write nested dictionary under map in ipc stream reader/writer

Posted by GitBox <gi...@apache.org>.
tustvold commented on code in PR #1583:
URL: https://github.com/apache/arrow-rs/pull/1583#discussion_r853812149


##########
arrow/src/ipc/reader.rs:
##########
@@ -1483,23 +1483,33 @@ mod tests {
     }
 
     #[test]
-    fn test_roundtrip_stream_nested_dict_dict_in_map() {
-        let values = StringArray::from_iter_values(["a", "b", "c"]);
-        let keys = Int8Array::from_iter_values([0, 0, 1, 2, 0, 1]);
-        let dict_array = DictionaryArray::<Int8Type>::try_new(&keys, &values).unwrap();
-
-        let keys_array = Int32Array::from_iter_values([0, 0, 1, 2, 0, 1]);
-        let keys_field = Field::new("keys", DataType::Int32, false);
+    fn test_roundtrip_stream_nested_dict_of_map_of_dict() {
+        let values = StringArray::from(vec![Some("a"), None, Some("b"), Some("c")]);

Review Comment:
   Dictionaries store nulls in the keys and not the values, I'm not actually sure what this will do tbh
   
   Edit: nvm apparently you can have nulls in the dictionary :exploding_head: 



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


[GitHub] [arrow-rs] tustvold merged pull request #1583: Read/write nested dictionary under map in ipc stream reader/writer

Posted by GitBox <gi...@apache.org>.
tustvold merged PR #1583:
URL: https://github.com/apache/arrow-rs/pull/1583


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