calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stamatis Zampetakis <zabe...@gmail.com>
Subject Re: Extracting all columns used in a query
Date Tue, 04 Jun 2019 09:26:18 GMT
Hey Adam,

I am not sure exactly what information you need, and at which level
(SqlNode/RelNode), but maybe you can exploit what is present in RelRoot
[1].
Follow the calls to the constructor to see which APIs can provide you what
you need (check for instance, SqlToRelConverter.convertQuery [2]).

Best,
Stamatis

[1]
https://github.com/apache/calcite/blob/7f33215ffaf9c0b8f4bef082913c910c77bf4427/core/src/main/java/org/apache/calcite/rel/RelRoot.java#L89
[2]
https://github.com/apache/calcite/blob/7f33215ffaf9c0b8f4bef082913c910c77bf4427/core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java#L553

On Tue, Jun 4, 2019 at 12:39 AM Muhammad Gelbana <m.gelbana@gmail.com>
wrote:

> I don't konw if there is an API for that but visiting the  parsed/validated
> SqlNode tree can do what you asked for.
>
> Thanks,
> Gelbana
>
>
> On Tue, Jun 4, 2019 at 12:12 AM Adam Rivelli <asrivelli@gmail.com> wrote:
>
> > Hi all,
> >
> > I'm trying to extract all of the (fully qualified) columns used by a
> query
> > - similar to the information provided by
> > RelMetadataQuery.getTableReferences()
> > <
> >
> https://calcite.apache.org/apidocs/org/apache/calcite/rel/metadata/RelMetadataQuery.html#getTableReferences-org.apache.calcite.rel.RelNode-
> > >,
> > but for column references. Is this possible to do using Calcite?
> >
> > I've been looking through the API docs and experimenting with the API,
> but
> > I haven't found a straightforward way of doing this. Any help or
> > information is appreciated.
> >
> > Adam
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message