Skip to content

Commit

Permalink
Fix "Binder Error: Referenced table not found!"
Browse files Browse the repository at this point in the history
  • Loading branch information
multimeric committed Nov 16, 2023
1 parent 15a0dd3 commit 1103a4b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions R/metadata.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ SAMPLE_DATABASE_URL <- single_line_str(
#'
#' @importFrom DBI dbConnect
#' @importFrom duckdb duckdb
#' @importFrom dbplyr sql
#' @importFrom dplyr tbl
#' @importFrom httr progress
#' @importFrom cli cli_alert_info hash_sha256
#' @importFrom glue glue
#'
#' @details
#'
Expand Down Expand Up @@ -162,10 +164,13 @@ get_metadata <- function(
progress(type = "down", con = stderr())
)
}


# Since dbplyr 2.4.0, raw file paths aren't handled very well
# See: https://github.com/duckdb/duckdb-r/issues/38
select <- glue("FROM read_parquet('{db_path}')") |> sql()
table <- duckdb() |>
dbConnect(drv = _, read_only = TRUE) |>
tbl(db_path)
tbl(select)
cache$metadata_table[[hash]] <- table
table
}
Expand Down

0 comments on commit 1103a4b

Please sign in to comment.