SQL file readers and table functions

Query CSV and Parquet files or expand lists into rows with Haybarn SQL. Work through small examples that run in the browser.

Choose a function

Table functions belong in FROM and produce rows for the rest of the query. Start with a small sample, inspect the column types, and select the columns your analysis actually needs.

Browser examples use the engine’s virtual filesystem. A path on your computer is not automatically available to the browser engine. Remote files also need a server that permits browser access.

Query CSV files with SQL

Read a CSV file as a table and query its columns directly. Set header and column types explicitly when the file format is known.

The example creates a small CSV in the browser engine’s virtual filesystem, then reads it with an explicit schema. A unique filename lets the example run repeatedly.

Query CSV files with SQL
SQL
Haybarn WASM 2.0.0-rc12 Β· In your browser

Guide example Β· Run to view results.

Expected result
product_idquantity
00125

Watch for: Type inference can lose leading zeroes in identifiers. Declare such columns as VARCHAR. Browser queries cannot open arbitrary paths on your computer.

Full read_csv() reference β†’

All files & tables functions

19 functions in Haybarn WASM 2.0.0-rc12. Browse the filtered catalog β†’