Skip to content

Commit

Permalink
nix the custom head method
Browse files Browse the repository at this point in the history
  • Loading branch information
paleolimbot committed Aug 26, 2022
1 parent c2e1cf9 commit 43dec7f
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 13 deletions.
1 change: 0 additions & 1 deletion r/NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ S3method(dimnames,ArrowTabular)
S3method(head,ArrowDatum)
S3method(head,ArrowTabular)
S3method(head,Dataset)
S3method(head,ExecPlanReader)
S3method(head,RecordBatchReader)
S3method(head,Scanner)
S3method(head,arrow_dplyr_query)
Expand Down
9 changes: 0 additions & 9 deletions r/R/query-engine.R
Original file line number Diff line number Diff line change
Expand Up @@ -356,15 +356,6 @@ ExecPlanReader <- R6Class("ExecPlanReader",
)
)

# We need the head() of a ExecPlanReader to also be a ExecPlanReader
# because we need batches() and read_table() to evaluate in a way
# that supports user-defined functions.
#' @export
head.ExecPlanReader <- function(x, n = 6L, ...) {
head_reader <- NextMethod()
as_record_batch_reader(as_adq(head_reader))
}

do_exec_plan_substrait <- function(substrait_plan) {
if (is.string(substrait_plan)) {
substrait_plan <- substrait__internal__SubstraitFromJSON(substrait_plan)
Expand Down
3 changes: 0 additions & 3 deletions r/tests/testthat/test-query-engine.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,13 @@ test_that("ExecPlanReader evaluates nested exec plans lazily", {
expect_identical(reader$PlanStatus(), "PLAN_NOT_STARTED")

head_reader <- head(reader, 4)
expect_identical(head_reader$PlanStatus(), "PLAN_NOT_STARTED")
expect_identical(reader$PlanStatus(), "PLAN_NOT_STARTED")

expect_equal(
head_reader$read_table(),
arrow_table(a = 1:4)
)

expect_identical(head_reader$PlanStatus(), "PLAN_FINISHED")
expect_identical(reader$PlanStatus(), "PLAN_FINISHED")
})

Expand All @@ -58,7 +56,6 @@ test_that("ExecPlanReader evaluates head() lazily", {
arrow_table(a = 1:4)
)

expect_identical(head_reader$PlanStatus(), "PLAN_FINISHED")
expect_identical(reader$PlanStatus(), "PLAN_FINISHED")
})

Expand Down

0 comments on commit 43dec7f

Please sign in to comment.