Hi Alessandro, Thanks for your feedback, the RelOptUtil#findAllTables requires its input is a relNode, But many times we need extract all tables before validation, this has the following advantages.
1. no metadata need and fast. 2. we can compose a on-demand catalog, rather get all schemas, tables to match. Alessandro Solimando <[email protected]> 于2022年4月13日周三 16:04写道: > Hi Yanjing, > > I found a discussion in the ML suggesting to use RelOptUtil#findAllTables > to get all tables involved in a query: > https://lists.apache.org/thread/wcfv2bhdytwsoyc3qlsnxcd7nmnnlb06 > > Can you check if that's what you want? > > Best regards, > Alessandro > > On Wed, 13 Apr 2022 at 09:33, Yanjing Wang <[email protected]> > wrote: > > > Hi Commnunity, > > > > In real scenarios, many developers want to get what tables a query > > statement contains. > > > > such as 'WITH t as (SELECT * FROM t1) SELECT * FROM t, t2', it only > > contains table t1 and t2. > > > > I tried to visit the SqlNode and found this solution is very complicated > > and has very many checks, otherwise easy to get in parser. > > such as add one line 'involvedTables.add(nameList);' in > > 'CompoundTableIdentifier' production rule. > > > > I know that this isn't the duty of parser, but I think it's the easiest > way > > to get the tables, I want to add this functionality to parser, how do you > > think? > > >
