duckdb.query_file

Run a SQL file over the connected tables with DuckDB, without network. The tables are views named t0, t1, ... in connection order. The file may be several statements; the result of the last is the output. Runs queries written by ai.sql, saved from an earlier run, or uploaded.

  • Kind: standard
  • Network: no
  • Memory: 8Gi

Inputs🔗

NameTypeRequiredDefaultDescription
queryfile (SQL)yesThe SQL to run, in DuckDB's dialect.
tablescollection of file (Parquet)noTables to query (Parquet or CSV), bound as t0, t1, ... in order. Leave unconnected for a query that makes its own data.
output_formatstringnoparquetFile format of the result. One of parquet, csv.

Outputs🔗

NameTypeDescription
resultfile (Parquet)The result of the last statement.

Example🔗

- id: "@query_file"
  name: duckdb.query_file
  inputs: [{block: "@write_query", output: query, as: query}, {block: "@pivot", output: result, as: tables}]
  args: {}