Thank you so much. I love the spirit of this community. Just came to my mind - when Calcite validates the query against a schema, it must be validating if all the columns and tables are present in the schema. So it must be extracting these details; no?
May be something for me to dig into. Thank you. ________________________________ From: Zhe Hu <[email protected]> Sent: Monday, February 7, 2022 8:15 AM To: [email protected] <[email protected]> Subject: Re:List of tables & Columns Hi, Sharma. As far as I can tell, Calcite doesn’t provide a simple way to get table names or column names for a query(or maybe I miss something). But you can take a look at SqlSelect、SqlOrderBy and SqlWith if you want to do such things. Based on my own experience, SqlVisitor seems the only way to get table/column names or alias by visiting the SqlNode, at least that’s how I extract tables/columns、distinguish SQL type or rewriting SQL in practice. Hope it’s helpful for you. Best, ZheHu On 02/5/2022 18:39,Yogendra Sharma<[email protected]> wrote: Hi Community, I had to gather the list of all fully qualified table names and thier column names used(referenced) jn a SELECT query. I simply parsed the query and wrote a visitor to visit the SqlNode recursively. While its working (may be with few bugs here and there), i am wondering if Calcite would already be doing it somewhere ir if there is an easier way to achieve this? Thanks Y Get Outlook for Android<https://aka.ms/ghei36>
