I've been reading into DuckDB recently and most of the examples involve having some sort of data already in an R session, then pushing that data into DuckDB.
Here is a basic example of that using the iris dataset;
library("DBI")
con = dbConnect(duckdb::duckdb(), ":memory:")
dbWriteTable(con, "iris_table", iris)
dbGetQuery(con, 'SELECT "Species", MIN("Sepal.Width") FROM iris_table GROUP BY "Species"')
Let's say I have data in a sql server table and want to directly write that data into a duck db.
Is there a way to do this?
if I had a sql query
' SELECT * FROM iris_table "
and wanted to read that directly into DuckDB, how would that work? I haven't seen any examples of this online
- How would that work?
- Would this even be a smart or desirable approach?