As the javadoc says, hooks can be set “by observers”. They are sometimes used internally in Calcite but can also be used externally.
QUERY_PLAN is set in CalciteAssert.queryContains. > On Mar 7, 2018, at 10:27 AM, Muhammad Gelbana <m.gelb...@gmail.com> wrote: > > Looking at this statement > <https://github.com/apache/calcite/blame/master/druid/src/main/java/org/apache/calcite/adapter/druid/DruidQuery.java#L1570>, > it suggests that *org.apache.calcite.runtime.Hook.addThread(Function<T, R>)* > or *org.apache.calcite.runtime.Hook.add(Function<T, R>)* will be called for > QUERY_PLAN somewhere but I couldn't find it. > > Is it kept this way just in case someone needs to extends QUERY_PLAN > handlers somehow but kept empty by default ? Would someone please explain > to me the purpose of this ? > > Thanks, > Gelbana >