HackerTrans
トップ新着トレンドコメント過去質問紹介求人

ltabb

no profile record

投稿

DuckDB: Prefix aliases make SQL more readable

duckdb.org
2 ポイント·投稿者 ltabb·昨年·0 コメント

Malloy 4.0 aims to make a better analytical SQL

malloydata.github.io
5 ポイント·投稿者 ltabb·3 年前·2 コメント

Data is Rectangular and other Limiting Misconceptions

lloydtabb.substack.com
2 ポイント·投稿者 ltabb·3 年前·1 コメント

Try Malloy's Fiddle: Sequel to SQL (Built with DuckDB and WASM)

looker-open-source.github.io
2 ポイント·投稿者 ltabb·4 年前·1 コメント

コメント

ltabb
·3 年前·議論
We're on the fourth major revision of Malloy, a data language aiming to replace analytical SQL. Making something that is simple, complete and understandable is really hard. 'Experimental' is no longer in our description.
ltabb
·3 年前·議論
In software we express our ideas through tools. In data, those tools think in rectangles. From spreadsheets to the data warehouses, to do any analytical calculation, you must first go through a rectangle. Forcing data through a rectangle shapes the way we solve problems (for example, dimensional fact tables, OLAP Cubes). But really, most data isn’t rectangular
ltabb
·4 年前·議論
Curious about the Malloy Language? Want to try it out with no install? Check out our new Malloy Fiddle. Malloy Fiddle runs entirely in the browser using #DuckDB and WASM. Malloy Fiddle queries semantic data models. See results as tables, JSON or SQL
ltabb
·4 年前·議論
If you would like to play with Malloy... You can Fiddle using just a web browser. The Malloy Fiddle uses DuckDB and WASM.

  https://twitter.com/lloydtabb/status/1567671348306264064
ltabb
·4 年前·議論
Give it a shot. Malloy writes the query in the twitter thread with a single database read. It computes the query, simultaneously at 4 levels of dimensionalization but only touches the disk once. No joins.
ltabb
·4 年前·議論
Try writing this SQL. Malloy writes SQL you can't (I'm pretty sure of it).

  https://twitter.com/lloydtabb/status/1556287859601985536
ltabb
·4 年前·議論
We're hoping its more of a 'typescript' but yeah :)
ltabb
·4 年前·議論
Sorry, the link to the documentation is buried.

https://looker-open-source.github.io/malloy/documentation/la...
ltabb
·4 年前·議論
Scroll to the bottom of the page. It shows the returned JSON

https://looker-open-source.github.io/malloy/documentation/pa...

Here is the SQL we generate.

https://gist.github.com/lloydtabb/8c144d2dac978dda9bf3ec4d6b...
ltabb
·4 年前·議論
> What's nest actually doing?

1) Nesting builds nested results (like GraphQL). This is particularly hard to do in SQL but is allows very large complex data sets to be returned in a single query.

https://looker-open-source.github.io/malloy/documentation/la...

For example the dashboard on the page below is a single SQL query:

https://looker-open-source.github.io/malloy/documentation/ex...

> How does aggregate know what function to use?

You can pre-define calculations with 'measure:' or decalre them explicitly in a query.

> where's the windowing

It's missing with a bunch of other things (like union for example). Its coming of course. The goal is that everything represent able in SQL is represent able in Malloy.

> heck does "order by: 2" mean

Same thing as it does in SQL. We try and have reasonable defaults.

https://looker-open-source.github.io/malloy/documentation/la...

> "How is this actually easier?"

The goal here is to be able to create data models that are re-usable and compose-able and verifiable. Yeah, there is a learning curve as there is with anything powerful. There are many things expressible in Malloy that cannot be easily expressed in SQL.
ltabb
·4 年前·議論
Thanks, that is reasonable feedback. We'll work on updating the documentation.

Here is an example of Malloy solving today's worlde in 50 lines of Malloy

https://looker-open-source.github.io/malloy/documentation/ex...

And here is the equivalent SQL.

https://gist.github.com/lloydtabb/32f46e7ecbb2da1a443d1adbe9...
ltabb
·4 年前·議論
Here is the quick start.

https://looker-open-source.github.io/malloy/documentation/la...
ltabb
·4 年前·議論
Actually joins recently landed. Arbitrary patterns and computes aggregates correctly regardless of join patterns.

https://looker-open-source.github.io/malloy/documentation/la...