Hi,

Is there any tutorial teaching how to traverse parsed SQL statements (I
read
https://github.com/michaelmior/calcite-notebooks/blob/master/query-parsing.ipynb
which
is a great intro).

What I am trying to achieve is to create valid "sub-queries" from a single
query, by traversing the AST and saving the valid "sub-trees" and convert
them back to query by toString(), for example the following query "SELECT *
FROM foo WHERE country='USA' AND state='New York' " will return the
following sub-queries:
1.  "SELECT * FROM foo "
2.  "SELECT * FROM foo WHERE country='USA' "
3. "SELECT * FROM foo WHERE state='New York' "
4. "SELECT * FROM foo WHERE country='USA' AND state='New York' "

I would love any advice/resource that can help me implement these.

Thanks,
Eyal Trabelsi

Reply via email to