Note that there are TWO PigRelBuilder.java files in the code base. (Apologies for that! Both names made sense at the time.)
This particular line of code is in piglet. I suspect that it was added by me or Khai Tran in order to make some tests pass, and get a big PR ( https://github.com/apache/calcite/pull/1265 ) across the finishing line. If you want to find out what it does, remove the line and see what tests fail. I doubt that it is very harmful (at worst, PigRelBuilder misses some optimizations), but I suppose some users might like some more control. Feel free to enhance it. On Thu, Apr 15, 2021 at 6:25 AM JiaTao Tao <[email protected]> wrote: > > Hi, in PigRelBuilder#create, we set Hook.REL_BUILDER_SIMPLIFY to false: > > public static PigRelBuilder create(FrameworkConfig config) { > final RelBuilder relBuilder = RelBuilder.create(config); > Hook.REL_BUILDER_SIMPLIFY.addThread(Hook.propertyJ(false)); > return new PigRelBuilder( > transform(config.getContext(), c -> c.withBloat(-1)), > relBuilder.getCluster(), > relBuilder.getRelOptSchema()); > } > > I have two doubts: > 1. Why we set FALSE here cuz its default value is true; > 2. This maybe not the suitable place to set "Hook.REL_BUILDER_SIMPLIFY", > IMO we should use this in user code, not in the frame code, cuz once we > done this in frame code, we can not change this config anymore. > > Regards! > > Aron Tao
