Skip to content

Can't cancel long-running queries #514

@krlmlr

Description

@krlmlr

Not in the RStudio IDE, not in the plain terminal. Hitting Ctrl + C when running this script will achieve nothing.

@hannes: I checked, we either need to call R_CheckUserInterrupt() periodically, or perhaps install our own signal handler and remove it for every single call to an R API. Is there a callback from duckdb that would be fired regularly from the main thread?

library(DBI)
con <- dbConnect(duckdb::duckdb())

dbExecute(con, "CREATE TABLE data AS SELECT unnest(generate_series(1, 100000)) AS a")
#> [1] 1e+05

system.time(dbGetQuery(con, "SELECT COUNT(*) FROM data JOIN data AS data2 ON data.a != data2.a"))
#>    user  system elapsed 
#>  10.027   0.060  10.514

dbDisconnect(con)

Created on 2024-10-19 with reprex v2.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancement

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions