----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/71571/#review218204 -----------------------------------------------------------
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFPercentileCont.java Line 208 (original), 213 (patched) <https://reviews.apache.org/r/71571/#comment305775> With the previous comment, I meant we can preallocate the results here array/list here and populate it, then we can just call `set` on each of them from `calculatePercentile`? - Jesús Camacho Rodríguez On Oct. 14, 2019, 9:15 a.m., Krisztian Kasa wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/71571/ > ----------------------------------------------------------- > > (Updated Oct. 14, 2019, 9:15 a.m.) > > > Review request for hive, Jesús Camacho Rodríguez, Zoltan Haindrich, and > Vineet Garg. > > > Bugs: HIVE-22240 > https://issues.apache.org/jira/browse/HIVE-22240 > > > Repository: hive-git > > > Description > ------- > > Function percentile_cont fails when array parameter passed > ========================================================== > The method `GenericUDAFPercentileCont.iterate` expect a `HiveDecimalWritable` > parameter. However array parameters are converted to > `ArrayList<HiveDecimalWritable>` before they passed. This leads to a > `ClassCastException`. > > > Diffs > ----- > > > ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFPercentileCont.java > 00e17f92da > > ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFPercentileDisc.java > 21580f79cb > ql/src/test/queries/clientpositive/udaf_percentile_cont.q 7a1ac5c968 > ql/src/test/queries/clientpositive/udaf_percentile_disc.q 6d93b3418a > ql/src/test/results/clientpositive/udaf_percentile_cont.q.out cddd908d73 > ql/src/test/results/clientpositive/udaf_percentile_disc.q.out 83875ec514 > > > Diff: https://reviews.apache.org/r/71571/diff/3/ > > > Testing > ------- > > Existing q tests are extended with calling percentile_cont/disc with array > parameters > > > Thanks, > > Krisztian Kasa > >
