Maybe I don’t fully understand the problem, but a RexInputRef must always have the same type as the field it references. If field 1 is an INTEGER, then RefInputRef(1) must be an INTEGER. If one consumer wants that field as a BIGINT then they must apply a cast (RexCall to the CAST operator).
If you are creating a RexInputRef with the type that you want it to be, then bad things will happen. Sorry if this is confusing/unexpected. RexNode is very strict regarding types. Julian > On Oct 30, 2017, at 8:41 AM, weijie tong <[email protected]> wrote: > > Hi devs: > At drill,stddev_pop and sum functions once issued together will occur > error.The reason is the DrillReduceAggregatesRule leverages Calcite's > RexBuilder.addAggCall method to reduce the duplicated functions.But this > method only cares about function name and input references ignoring the > parameter data type. > More details please see https://github.com/apache/drill/pull/1016 > > But I think it's better to move my judgement logic codes to the > RexBuilder's addAggCall method. > So what do you think about it ? If it sounds ok ,I will be pleasure to do > that.
