AlaSQL / alasql

AlaSQL.js - JavaScript SQL database for browser and Node.js. Handles both traditional relational tables and nested JSON data (NoSQL). Export, store, and import data from localStorage, IndexedDB, or Excel.
http://alasql.org
MIT License
6.96k stars 651 forks source link

Any way to use alasql on columnar/column-oriented data structure? #1938

Closed daviddabingu closed 1 day ago

daviddabingu commented 2 weeks ago

Hello. I am trying to test alasql on my project.

I have my data stored in a columnar data structure in-memory, that is: var data = { column1: [1,2,3], column2: [4,5,6], ... }

However, it seems AlaSQL only supports a row-oriented data structure. Is there any way I can directly use alasql on the column-wise data like that? Thank you in advance.


AlaSQL is based on unpaid voluntary work. Thank you for taking the time to make it better.

Got ChatGPT?


Question about how to...


Something is not working as expected:

paulrutter commented 1 week ago

Not to bash on alasql, as it does a great job, but for columnar based data you are probably better of with something like https://duckdb.org/docs/api/nodejs/overview.html, it can load columnar data in a native way via Apache Arrow.

It doesn't match the data ingestion speed from alasql, but makes up in query time over big tables.

mathiasrw commented 1 day ago

Thank you @paulrutter for helping out here. Always pick the right tool for the job. DuckDB is a great tool and for sure better in this case.