-
I'm looking at creating a workflow where another process creates a table in DuckDB and then I would visualize that table with Mosaic. Essentially, I want to skip the part in the examples where it loads data from a csv or parquet file and subsequently creates a DuckDB table. I'll be using the same DuckDB server setup so that Mosaic still has the same API to the database. I'm wondering if there are any caveats to this approach. Importantly, the table needs to be added to the coordinator. Looking at the source for CREATE TEMP TABLE IF NOT EXISTS penguins AS SELECT * FROM read_csv('https://raw.githubusercontent.com/uwdata/mosaic/main/data/penguins.csv', auto_detect=true, sample_size=-1) Assuming I have already loaded penguins earlier, I'm guessing I could do something like this: vg.coordinator().exec('CREATE TABLE IF NOT EXISTS penguins AS SELECT * FROM penguins'); Purely from DuckDB's standpoint, it doesn't complain about a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The coordinator doesn't need to "know" about the table ahead of time -- |
Beta Was this translation helpful? Give feedback.
The coordinator doesn't need to "know" about the table ahead of time --
exec
queries simply pass right through to DuckDB, and there's no need to create a table that already exists. You can simply create tables however you like, then go straight to visualizing them!