Let’s frame this discussion in terms of user-visible behavior (rather than validator, relations and namespaces).
Calcite does validate EXPLAIN statements, as this example illustrates: sqlline> !connect jdbc:calcite:model=core/src/test/resources/hsqldb-model.json sa sa sqlline> explain plan for select x from emp; Error: Error while executing SQL "explain plan for select x from emp": At line 1, column 25: Column 'X' not found in any table (state=,code=0) Can you give an example where Calcite does not validate adequately? Julian > On May 12, 2021, at 11:19 PM, you Zhuang <[email protected]> wrote: > > Calcite doesn't treat Explain statement as DDL, so Explain statement isn't > a top level statement and will not have any namespace. > > But Explain will experience validated and that cause NPE. > > Q1: If Explain statement should not be validated, will we throw a more > user-friendly exception? > > Q2: If Explain statement should be validated, what should Calcite behave > when converting it to relation?
