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/22 11:50:26 UTC

[GitHub] [arrow] nealrichardson commented on a diff in pull request #12950: ARROW-15312: [R][C++] filtering a Parquet dataset with is.na() misses some rows

nealrichardson commented on code in PR #12950:
URL: https://github.com/apache/arrow/pull/12950#discussion_r856153177


##########
r/tests/testthat/test-dataset.R:
##########
@@ -966,3 +966,29 @@ test_that("dataset to C-interface to arrow_dplyr_query with proj/filter", {
   # must clean up the pointer or we leak
   delete_arrow_array_stream(stream_ptr)
 })
+
+
+test_that("Filter parquet dataset with is.na ARROW-15312", {
+  ds_path <- make_temp_dir()
+
+  df <- tibble(x = 1:3, y = c(0L, 0L, NA_integer_), z = c(0L, 1L, NA_integer_))
+  write_dataset(df, ds_path)
+
+  # OK: Collect then filter: returns row 3, as expected
+  expect_identical(
+    open_dataset(ds_path) %>% collect() %>% filter(is.na(y)),
+    df %>% collect() %>% filter(is.na(y))
+  )
+
+  # ERROR: Filter then collect (on y) returns a tibble with no row

Review Comment:
   ```suggestion
     # Before the fix: Filter then collect (on y) returned a tibble with no row
   ```



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