-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Relational: Anti-join with IS DISTINCT FROM
#8
Comments
This works in the client, so this is a bug in the r-client
will take a look |
Whoops, seems like a true duckdb bug. The macro is causing the problem it looks like.
The error is thrown on line in file |
I can send a PR to fix this after duckdb/duckdb#8979 gets merged, we're just missing a case there |
Works now (we need con <- DBI::dbConnect(duckdb::duckdb())
experimental <- FALSE
invisible(
DBI::dbExecute(con, "CREATE MACRO \"___eq_na_matches_na\"(x, y) AS (x IS NOT DISTINCT FROM y)")
)
df1 <- data.frame(a = 1:3)
df2 <- data.frame(a = 1L)
rel1 <- duckdb:::rel_from_df(con, df1, experimental = experimental)
rel2 <- duckdb:::rel_set_alias(rel1, "lhs")
rel3 <- duckdb:::rel_from_df(con, df2, experimental = experimental)
rel4 <- duckdb:::rel_set_alias(rel3, "rhs")
rel5 <- duckdb:::rel_join(
rel2,
rel4,
list(
duckdb:::expr_function(
"___eq_na_matches_na",
list(duckdb:::expr_reference("a", rel2), duckdb:::expr_reference("a", rel4))
)
),
"anti"
)
rel5
#> DuckDB Relation:
#> ---------------------
#> --- Relation Tree ---
#> ---------------------
#> Join REGULAR ANTI ___eq_na_matches_na(lhs.a, rhs.a)
#> r_dataframe_scan(0x106f9fed8)
#> r_dataframe_scan(0x106fe3730)
#>
#> ---------------------
#> -- Result Columns --
#> ---------------------
#> - a (INTEGER)
duckdb:::rel_to_altrep(rel5)
#> a
#> 1 2
#> 2 3 Created on 2023-11-08 with reprex v2.0.2 |
What happens?
Supporting this might lead to faster execution in duckplyr.
To Reproduce
Needs duckdb/duckdb#8600.
Created on 2023-08-17 with reprex v2.0.2
OS:
macOS aarch64
DuckDB Version:
0ff709bdc628ea24111265eb66d74220ce3bb6df
DuckDB Client:
R
Full Name:
Kirill Müller
Affiliation:
cynkra GmbH
Have you tried this on the latest
master
branch?I have tested with a master build
Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?
The text was updated successfully, but these errors were encountered: