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 2021/08/20 07:40:35 UTC

[GitHub] [arrow-rs] nevi-me commented on a change in pull request #702: Support binary data type in `build_struct_array`.

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



##########
File path: arrow/src/json/reader.rs
##########
@@ -1225,6 +1225,14 @@ impl Decoder {
                             })
                             .collect::<StringArray>(),
                     ) as ArrayRef),
+                    DataType::Binary => Ok(Arc::new(
+                        rows.iter()
+                            .map(|row| {
+                                let maybe_value = row.get(field.name());
+                                maybe_value.and_then(|value| value.as_str())

Review comment:
       I thought `value.as_str()` would return an error if the binary data can't be converted to UTF8, but then we probably wouldn't be able to read the file in that case.
   
   Just an observation, no action needed

##########
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:
       An oversight on my end, should have been "value"




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