Syntax Trees

19 views
Skip to first unread message

Elliotte Rusty Harold

unread,
Dec 12, 2022, 8:54:29 AM12/12/22
to subs...@googlegroups.com
I've been taking a look at Substrait for an ongoing project. Scanning
the docs and the repos, it looks like the proto representation starts
with the compute plan. As far as I've been able to find in a hour or
so of casual browsing of the code, there doesn't seem to be any
representation of the concrete or abstract syntax trees produced by
parsing a SQL query. Is that accurate?

In other words, there's no canonical representation of a SQL string
such as "SELECT foo FROM bar". Is that accurate or am I missing or
misunderstanding something? Thanks.

--
Elliotte Rusty Harold
elh...@ibiblio.org

Tim Swast

unread,
Dec 12, 2022, 3:22:05 PM12/12/22
to subs...@googlegroups.com
My understanding is that the top-level will always be a RelRoot.


In this case, RelRoot.names = [foo] and Rel.input would have a Rel.read.


I interpret SQL ReadRel has having a reference to a NamedTable.


Note: You'll also need to populate base_schema with the table schema and ReadRel.common.emit.output_mapping = [column index of the foo column according to base_schema]

  •  Tim Swast
  •  Senior Software Friendliness Engineer, BigQuery
  •  Google Cloud Platform
  •  Chicago, IL, USA


--
You received this message because you are subscribed to the Google Groups "substrait" group.
To unsubscribe from this group and stop receiving emails from it, send an email to substrait+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/substrait/CAGhczrrOsmc0uer9cTB0omNNzDFWc72aYzAjW9OH1790Tm1jXg%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages