nbenn opened a new issue, #1145:
URL: https://github.com/apache/arrow-adbc/issues/1145
Given that `adbc_statement_execute_query() ` returns `result$rows_affected`
I was expecting that the following call to `adbc_statement_execute_query()`
would return 8 instead of 0.
```r
library(adbcdrivermanager)
# Use the driver manager to connect to a database
db <- adbc_database_init(adbcsqlite::adbcsqlite(), uri = ":memory:")
con <- adbc_connection_init(db)
write_adbc(datasets::swiss, con, "swiss", temporary = TRUE)
as.data.frame(
read_adbc(con, "SELECT COUNT(*) AS n FROM swiss WHERE Agriculture < 20")
)
#> n
#> 1 8
stmt <- adbc_statement_init(con)
adbc_statement_set_sql_query(stmt, "DELETE FROM swiss WHERE Agriculture <
20")
adbc_statement_execute_query(stmt)
#> [1] 0
```
If value (such as an array stream) is passed, the returned value changes to
-1.
```r
library(adbcdrivermanager)
# Use the driver manager to connect to a database
db <- adbc_database_init(adbcsqlite::adbcsqlite(), uri = ":memory:")
con <- adbc_connection_init(db)
write_adbc(datasets::swiss, con, "swiss", temporary = TRUE)
as.data.frame(
read_adbc(con, "SELECT COUNT(*) AS n FROM swiss WHERE Agriculture < 20")
)
#> n
#> 1 8
stmt <- adbc_statement_init(con)
adbc_statement_set_sql_query(stmt, "DELETE FROM swiss WHERE Agriculture <
20")
res <- nanoarrow::nanoarrow_allocate_array_stream()
adbc_statement_execute_query(stmt, res)
#> [1] -1
```
1. Should `adbc_statement_execute_query()` not return the same value
irrespective of whether something is passed as `stream` or not?
2. More generally, is it ok for the SQLite driver to say I does not know the
number of rows affected for such a statement?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]