You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "nenorbot (via GitHub)" <gi...@apache.org> on 2023/05/10 13:05:20 UTC

[GitHub] [arrow-datafusion] nenorbot commented on a diff in pull request #6307: Support null values in Avro string columns

nenorbot commented on code in PR #6307:
URL: https://github.com/apache/arrow-datafusion/pull/6307#discussion_r1189882463


##########
datafusion/core/src/datasource/file_format/avro.rs:
##########
@@ -350,6 +393,48 @@ mod tests {
         Ok(())
     }
 
+    #[tokio::test]
+    async fn read_null_binary_alltypes_plain_avro() -> Result<()> {
+        let session_ctx = SessionContext::new();
+        let state = session_ctx.state();
+        let task_ctx = state.task_ctx();
+        let projection = Some(vec![6]);
+        let exec =
+            get_exec(&state, "alltypes_nulls_plain.avro", projection, None).await?;
+
+        let batches = collect(exec, task_ctx).await?;

Review Comment:
   I tried that as well, however since we're explicitly checking for null values, the expected value would be something like
   
   ```
           let expected = vec![
               "+------------+",
               "| string_col |",
               "+------------+",
               "|            |",
               "+------------+",
           ];
   ```
   ... making it hard to differentiate between an empty string and null, so I opted to explicitly test via `Array#is_null`



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