diff --git a/R/relational-duckdb.R b/R/relational-duckdb.R index b3139c9b..5af09280 100644 --- a/R/relational-duckdb.R +++ b/R/relational-duckdb.R @@ -15,6 +15,9 @@ get_default_duckdb_connection <- function() { } duckplyr_macros <- c( + # https://github.com/duckdb/duckdb-r/pull/156 + "___null" = "() AS CAST(NULL AS BOOLEAN)", + "<" = '(x, y) AS "r_base::<"(x, y)', "<=" = '(x, y) AS "r_base::<="(x, y)', ">" = '(x, y) AS "r_base::>"(x, y)', diff --git a/R/relational.R b/R/relational.R index 7d32bca1..cfd4ecf7 100644 --- a/R/relational.R +++ b/R/relational.R @@ -118,9 +118,10 @@ rel_translate <- function( switch(typeof(expr), character = , - logical = , integer = , double = relexpr_constant(expr), + # https://github.com/duckdb/duckdb-r/pull/156 + logical = if (is.na(expr)) relexpr_function("___null", list()) else relexpr_constant(expr), # symbol = { if (as.character(expr) %in% names_forbidden) {