Yes, on any namespace, especially an IdentifierNamespace, validateImpl needs to be called before resolve. That does NOT mean that you should call validateImpl directly; you should just try to stay within the validation life-cycle as closely as possible.
See if you can reproduce the bug in pure Calcite. If you can’t, that will give you some hints what you are doing wrong. You could even debug the Calcite and Drill versions in parallel debuggers. Julian > On Jul 25, 2016, at 1:39 PM, Vitalii Diravka <[email protected]> > wrote: > > Hi all! > > I am working on DRILL-4682: Allow full schema identifier in SELECT clause > <https://issues.apache.org/jira/browse/DRILL-4682> now. > After my attempt to pass in drill the query with nested sub-query I > got *"AssertionError: > must call validate first"* from calcite *IdentifierNamespace#resolve()*. > Looks like the problem in missing separate validating of nested sub-query > sqlNode. > > Are my assumptions right? If yes - I'll open a jira for this bug. > > > Example of query with nested sub-query: > > > > > > > > *select `employee.json`.employee_id, `employee.json`.department_id > from cp.`employee.json` where `employee.json`.employee_id < 5 and > `employee.json`.department_id in (select > dfs_test.tmp.`department`.department_id from dfs_test.tmp.`department` > where dfs_test.tmp.`department`.department_id > 0)* > > Thanks. > > > Kind regards > Vitalii
