jorgecarleitao commented on a change in pull request #702:
URL: https://github.com/apache/arrow-rs/pull/702#discussion_r692722052



##########
File path: arrow/src/json/reader.rs
##########
@@ -3140,6 +3148,41 @@ mod tests {
         assert_eq!(batch.num_rows(), 3);
     }
 
+    #[test]
+    fn test_json_read_binary_structs() {
+        let schema = Schema::new(vec![Field::new("c1", DataType::Binary, 
true)]);
+        let decoder = Decoder::new(Arc::new(schema), 1024, None);
+        let batch = decoder
+            .next_batch(
+                &mut vec![
+                    Ok(serde_json::json!({
+                        "c1": "₁₂₃",
+                    })),
+                    Ok(serde_json::json!({
+                        "c1": "foo",
+                    })),
+                ]
+                .into_iter(),
+            )
+            .unwrap()
+            .unwrap();
+        let data = batch.columns().iter().collect::<Vec<_>>();
+
+        let schema = Schema::new(vec![Field::new("c1", DataType::Binary, 
true)]);
+        let binary_values = BinaryArray::from(vec![
+            "\u{2081}\u{2082}\u{2083}".as_bytes(),

Review comment:
       ```suggestion
               "₁₂₃".as_bytes(),
   ```

##########
File path: arrow/src/array/array.rs
##########
@@ -668,7 +668,7 @@ mod tests {
                 "entry",
                 DataType::Struct(vec![
                     Field::new("key", DataType::Utf8, false),
-                    Field::new("key", DataType::Int32, true),
+                    Field::new("value", DataType::Int32, true),

Review comment:
       why this?




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