Comment by glogla

4 years ago

This is cool! I love it.

Few notes:

1) SQL also allows you to define windowing reusably, like this

    select
        sum(blah) over window_abc,
        avg(blah) over window_abc
    from table_xyz
    window window_abc as (partition by x order by y)

so that second example could be written somewhat less repetitively but it wouldn't change the whole point.

2) Sadly my main pain point with SQL for ETL is not possible to solve with a transpiler - SQL has exactly one target so doing things like "I want these records to go to a table A and those records go to table B" is not possible with one query.

3) It would be cool to see how this does typically annoying and repetitive cases from analytics / data warehousing world. I'm thinking like SCD1/2 implementation. But I don't even know if mutation is there yet.

4) I would recommend investing in one canonical formatter, like Go has. So that there isn't infinite number of ways the same query could be formatted for people to argue over preference.

EDIT:

5) Since this seems to be focused on analytics (by the choice of queries and Snowflake in examples), I want to highlight that someone suggested to use TPC-H (or TPC-DS) queries as a benchmark. It does sound like a good idea.