gauravphoenix 5 years ago

It is somewhat similar to https://calcite.apache.org/ which I like quite a lot. The calcite documentation is top notch as opposed to a bunch of MDs in a directory providing no coherent flow of information.

  • michaelmior 5 years ago

    There will hopefully be some integration with Calcite in the future. The ZetaSQL team has been in discussion about this on our mailing list :)

  • dc_gregory 5 years ago

        We will also be releasing more documentation over time,
        particular related to developing engines with this framework.
    
    Looks like they intend to resolve that.
    • midasz 5 years ago

      The intention is always there

robfig 5 years ago

Direct link to the documentation one-pager: https://github.com/google/zetasql/blob/master/docs/one-pager...

  • bpicolo 5 years ago

    > 22365 lines (18045 sloc) 599 KB

    That is a truly enormous "one-pager". I thought my scroll bar was bugged!

    • gonyea 5 years ago

      This is an in-joke at Google.

      • fizwhiz 5 years ago

        To elaborate: The spirit of a one-pager isn't to cram everything onto "one page", but rather to have a "single document" that contains all the context/content you need instead of having hyperlinks to large swaths of other documents (doing a depth-first search in documentation at Google can be a huge time-sink).

        Source: Another Googler that wastes time on memegen

        • kkarakk 5 years ago

          company whose verb has come to mean "to search" has employees who dislike search

          • hu3 5 years ago

            Or maybe they just value an easy-to-use CTRL+F search

gigatexal 5 years ago

I might be a bit slow but what is this exactly? Is it something I could add to a data layer and get SQL semantics from?

  • JulianMorrison 5 years ago

    SQL parser. Input: text in a standardized SQL dialect, output: a data structure describing what the user wants done.

    • gigatexal 5 years ago

      That is really cool. I’ve been looking for this

  • jve 5 years ago

    No answer to this question. Also interested.

  • whoevercares 5 years ago

    From my understanding yes, you should be able to just use this library to query against your data, however you might need to write a custom execution planner if you want to run it at scale.

reilly3000 5 years ago

I have to presume this is in production with the BigQuery web UI. It has brilliant validation and completion, arguably better than Looker. I’d let that framework into my hypothetical SQL UI any old time it likes.

paxys 5 years ago

This is neat, although the docs don't say which (if any) SQL standard it follows.

  • joatmon-snoo 5 years ago

    Not super sure if it follows any of them, but it might be ANSI 2011, since Cloud Spanner SQL is described as "ANSI 2011 with extensions", and I would expect that to be a strict subset of ZetaSQL.

    For some more context, ZetaSQL is the thing we've standardized our internal systems on, aka F1, Dremel/BigQuery, Spanner (and there's a few others). The F1 Query paper makes a light reference to this in S7.2 http://www.vldb.org/pvldb/vol11/p1835-samwel.pdf.

    For me, the most valuable feature of it has been that protos are an explicitly defined data type, since we use protos for pretty much everything. Docs: https://github.com/google/zetasql/blob/master/docs/one-pager...

    EDIT: BigQuery SQL is described as "compliant with the SQL 2011 standard and has extensions", and I would also expect that to be a strict subset of ZetaSQL.

  • ma2rten 5 years ago

    Google has it's own internal SQL dialect. It's the same that is also used in Cloud Spanner. I think it's mostly standard complaint, but less feature complete than the standard sql dialects.

  • setr 5 years ago

    I’m pretty sure it wouldn’t follow any; I can’t imagine any significant benefit (if you’re not chasing strict compatibility, general SQL should take you more than far enough on the beginner-friendly front) and significant benefit from doing a custom SQL

    • paxys 5 years ago

      A benefit of following an established standard is that one can use this not just to write a new engine but also to build internal tooling (static analysis, linters, IDE tools etc.) for an existing one (e.g. MySQL).

    • djhaskin987 5 years ago

      What significant benefit

      • davidjnelson 5 years ago

        Things like late row lookups in mysql that are not an issue in postgres https://explainextended.com/2011/02/11/late-row-lookups-inno...

        • riffraff 5 years ago

          aren't both executions (mysqls' and postgresqls') acceptable from an SQL point of view?

          I don't think the SQL standard mandates how the DBMS executes the query. In fact, I seem to remember that was on of the purposes of having an high level language.

rkagerer 5 years ago

Seeing as this introduces a language, a couple examples on the landing page wouldn't be a bad idea.

malkia 5 years ago

Wasn't this internally called "GoogleSQL" - sorry was 2 years back, all I remember was switching one syntax to another, and certain things easier in previous syntax, but not well defined, and vice versa...

  • azurezyq 5 years ago

    Still using Dremel SQL occasionally and I tend to agree that certain things are easier in Dremel SQL. But it's a canonical example of continuously applying convenient patches making things worse. While something is easier to write, expressing something else becomes impossible. Examples are complicated Protos with multiple layers of repeated/map/struct stuffs...

    With Google SQL, it's really verbose but a conceptually coherent design just gives you less surprises.

    I'd say I like the latter more.