Is RelMdPredicates any help? It might have deduced a predicate 'RexInputRef($f1) = RexLiteral(5E-1)'. These are the same predicates that we use in constant reduction.
On Thu, Oct 29, 2015 at 4:23 PM, Pengcheng Xiong <[email protected]> wrote: > Hi all, > > argList is a List<Integer> in AggregationCall. Is there any way to know > that the argument in the argList is actually a constant (or a literal)? For > example, in the following operator tree, I would like to know that $1 in > the aggregation call of "percentile_approx" is actually a constant of > "5E-1" or 0.5. > > HiveAggregate(group=[{}], agg#0=[percentile_approx($0, $1)]): > HiveProject($f0=[$0], $f1=[5E-1]): > HiveTableScan(table=[[default.s]], qbid:alias=[s]): > > I have tried inputRel.getChildExps(). It works in the above example > because HiveProject.getChildExps() will give me RexLiteral. But for some > other cases it does not work. For example, when there are other operators > in between the Aggregate and the Project, which has an empty ChildExps. > > Thanks! > Best > Pengcheng
