-
Install Node.js (version 22 or later)
-
Install the DataFusion ADBC driver:
dbc install datafusion
-
Install dependencies:
npm --prefix .. install
-
Customize the script
main.jsas needed- Change the SQL SELECT statement in
conn.query(), or keep it set toSELECT * FROM 'games.parquet';to query the Parquet file included with this example - The
conn.execute()call disables DataFusion's Arrow StringView output for Parquet scans so that the results can be decoded by theapache-arrowJavaScript library; keep it as is- If you change the query to produce string columns another way (for example, casting to
VARCHAR), you may also need to setdatafusion.sql_parser.map_string_types_to_utf8view = false
- If you change the query to produce string columns another way (for example, casting to
- Change the SQL SELECT statement in
-
Run the script:
Node.js:
node main.js
Bun:
bun run main.js
Deno:
deno run --allow-ffi --allow-env main.js