Skip to content

Over-eager symbol finding #1730

@thisisnic

Description

@thisisnic

We had a user issue reported on the Arrow repo in apache/arrow#47980 concerning symbol evaluation, but I think it might be a DuckDB bug; here's the relevant snippet of a reprex I made:

library(arrow)
library(dplyr)

tbl <- tibble::tibble(Quux = LETTERS)
arrow_tbl <- arrow_table(tbl)
duck_tbl <- arrow_tbl |> to_duckdb()

ltr <- list(quux="A")

# duckdb returns 0 rows
tbl |> rename_with(.fn = tolower) |> filter(quux == ltr$quux) |> collect()
#> # A tibble: 1 × 1
#>   quux 
#>   <chr>
#> 1 A
arrow_tbl |> rename_with(.fn = tolower) |> filter(quux == ltr$quux) |> collect()
#> # A tibble: 1 × 1
#>   quux 
#>   <chr>
#> 1 A
duck_tbl |> rename_with(.fn = tolower) |> filter(quux == ltr$quux) |> collect()
#> # A tibble: 0 × 1
#> # ℹ 1 variable: quux <chr>
> sessionInfo()
R version 4.5.1 (2025-06-13)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 24.04.3 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.12.0 
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.12.0  LAPACK version 3.12.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: Europe/London
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] dplyr_1.1.4  arrow_22.0.0

loaded via a namespace (and not attached):
 [1] vctrs_0.6.5       cli_3.6.5         knitr_1.50        rlang_1.1.6       xfun_0.53         processx_3.8.6    DBI_1.2.3         purrr_1.1.0       generics_0.1.4   
[10] assertthat_0.2.1  glue_1.8.0        bit_4.6.0         dbplyr_2.5.1      clipr_0.8.0       htmltools_0.5.8.1 ps_1.9.1          rmarkdown_2.30    evaluate_1.0.5   
[19] tibble_3.3.0      fastmap_1.2.0     yaml_2.3.10       lifecycle_1.0.4   duckdb_1.4.1      compiler_4.5.1    fs_1.6.6          blob_1.2.4        pkgconfig_2.0.3  
[28] rstudioapi_0.17.1 digest_0.6.37     R6_2.6.1          reprex_2.1.1      tidyselect_1.2.1  utf8_1.2.6        pillar_1.11.1     callr_3.7.6       magrittr_2.0.4   
[37] tools_4.5.1       withr_3.0.2       bit64_4.6.0-1    

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions