Apply a boolean test to batches of data in an Andromeda table and terminate early

batchTest(tbl, fun, ..., batchSize = 1e+05)

Arguments

tbl

An Andromeda table (or any other 'DBI' table).

fun

A function where the first argument is a data frame and returns a logical value.

...

Additional parameters passed to fun.

batchSize

Number of rows to fetch at a time.

Value

Returns FALSE if any of the calls to the user-supplied function returned FALSE, else returns TRUE.

Details

This function applies a boolean test function to sets of data and terminates at the first FALSE.

Examples

andr <- andromeda(cars = cars)

fun <- function(x) {
  is.unsorted(x %>% select(speed) %>% collect())   
}

result <- batchTest(andr$cars, fun, batchSize = 25)

result
#> [1] FALSE
# [1] FALSE 

close(andr)