malloydata / malloy

Malloy is an experimental language for describing data relationships and transformations.
http://www.malloydata.dev
MIT License
1.91k stars 75 forks source link

Ignored nested select should be a compiler error #1713

Open mtoy-googly-moogly opened 2 months ago

mtoy-googly-moogly commented 2 months ago
    run: duckdb.sql("""
      SELECT 1 as n, false as even UNION ALL SELECT 2, true
      UNION ALL SELECT 3, false UNION ALL SELECT 4,true
    """) -> {
      group_by: even
      nest: abn is {
        group_by: n, a is 'a', b is 'b'
        nest: next is {
          select: from_n is n, to_n is n + 1, to_even is not even
        }
      }
    }

In this code, the next record in abn is an empty array in the result set, if you change the select: to a group_by: then a reasonable result is generated.

This should either work, or be a compiler error.