ITADN

Parquet date filters

#2307Openlab1702 创建于 2026-04-01
L
lab1702commented
There seems to be an issue with filtering on date columns in parquet files in duckdb-r versions after 1.4.4 I created scripts for Ubuntu 24.04 using p3m.dev package manager to both replicate the issue and demonstrate how it worked in 1.4.4 and posted them in a repo here: [https://github.com/lab1702/duckdb-r-parquet-issue](https://github.com/lab1702/duckdb-r-parquet-issue) In short, when running the query like this: library(duckdb) query <- "FROM 'test_data.parquet' WHERE test_date > today() - INTERVAL 7 DAY;" con <- dbConnect(duckdb()) df1 <- try(dbGetQuery(con, query)) df2 <- try(dbGetQuery(con, query)) dbDisconnect(con) print(df1) print(df2) On version 1.4.4 you will see two data frames printed, but on later versions only the second data frame has data and the first one has an error: ````text Loading required package: DBI Error in dbSendQuery(conn, statement, ...) : Binder Error: No function matches the given name and argument types 'age(DATE, INTERVAL)'. You might need to add explicit type casts. Candidate functions: age(TIMESTAMP) -> INTERVAL age(TIMESTAMP, TIMESTAMP) -> INTERVAL age(TIMESTAMP WITH TIME ZONE) -> INTERVAL age(TIMESTAMP WITH TIME ZONE, TIMESTAMP WITH TIME ZONE) -> INTERVAL LINE 1: FROM 'test_data.parquet' WHERE test_date > today() - INTERVAL 7 DAY; ^ ℹ Context: rapi_prepare ℹ Error type: BINDER [1] "Error in dbSendQuery(conn, statement, ...) : \n Binder Error: No function matches the given name and argument types 'age(DATE, INTERVAL)'. You might need to add explicit type casts.\n\tCandidate functions:\n\tage(TIMESTAMP) -> INTERVAL\n\tage(TIMESTAMP, TIMESTAMP) -> INTERVAL\n\tage(TIMESTAMP WITH TIME ZONE) -> INTERVAL\n\tage(TIMESTAMP WITH TIME ZONE, TIMESTAMP WITH TIME ZONE) -> INTERVAL\n\n\nLINE 1: FROM 'test_data.parquet' WHERE test_date > today() - INTERVAL 7 DAY;\n ^\n\033[34mℹ\033[39m Context: rapi_prepare\n\033[34mℹ\033[39m Error type: BINDER\n" attr(,"class") [1] "try-error" attr(,"condition") <error/rlang_error> Error in `dbSendQuery()`: ! Binder Error: No function matches the given name and argument types 'age(DATE, INTERVAL)'. You might need to add explicit type casts. Candidate functions: age(TIMESTAMP) -> INTERVAL age(TIMESTAMP, TIMESTAMP) -> INTERVAL age(TIMESTAMP WITH TIME ZONE) -> INTERVAL age(TIMESTAMP WITH TIME ZONE, TIMESTAMP WITH TIME ZONE) -> INTERVAL LINE 1: FROM 'test_data.parquet' WHERE test_date > today() - INTERVAL 7 DAY; ^ ℹ Context: rapi_prepare ℹ Error type: BINDER --- Backtrace: ▆ 1. ├─base::try(dbGetQuery(con, query)) 2. │ └─base::tryCatch(...) 3. │ └─base (local) tryCatchList(expr, classes, parentenv, handlers) 4. │ └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]]) 5. │ └─base (local) doTryCatch(return(expr), name, parentenv, handler) 6. ├─DBI::dbGetQuery(con, query) 7. └─DBI::dbGetQuery(con, query) 8. └─DBI (local) .local(conn, statement, ...) 9. ├─DBI::dbSendQuery(conn, statement, ...) 10. └─duckdb::dbSendQuery(conn, statement, ...) ```
0 条评论