Hooks are intended mainly for tracing/monitoring applications, i.e. read-only. 
If you want to modify the query preparation life cycle (parse, validate, 
optimize) then you should probably sub-class org.apache.calcite.prepare.Prepare 
to use a different parser. See Driver.createPrepareFactory.

Also, think carefully whether you really want to modify the SqlNode tree, 
because of SQL’s complicated rules on how table and column names are resolved. 
It is usually safer to modify the RelNode tree.

Julian



> On Aug 23, 2016, at 10:09 AM, Anoop Johnson <anoop.k.john...@gmail.com> wrote:
> 
> Hello Everyone -
> 
> I need to transform a the parse tree before it will be executed. I could
> use the Hook.PARSE_TREE mechanism to add an observer and inspect the parse
> tree, but is there a way for the observer to modify the SqlNode?
> 
> Thanks,
> Anoop

Reply via email to