[ https://issues.apache.org/jira/browse/HIVE-1130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12904650#action_12904650 ]
Pierre Huyn commented on HIVE-1130: ----------------------------------- Not sure why the rest of my message was cut off. It is still in my sent mail. Here is the entire message: Hi John, It appears that the call ObjectInspectorUtils.compare(myagg.max, xInputOI, px, xInputOI), which tries to compare 2 integer writables, failed in casting. Here is a fragment of the stack trace: ... Caused by: java.lang.ClassCastException: org.apache.hadoop.io.IntWritable cannot be cast to org.apache.hadoop.hive.serde2.lazy.LazyPrimitive at org.apache.hadoop.hive.serde2.lazy.objectinspector.primitive.AbstractPrimitiveLazyObjectInspector.getPrimitiveWritableObject(AbstractPrimitiveLazyObjectInspector.java:37) at org.apache.hadoop.hive.serde2.lazy.objectinspector.primitive.LazyIntObjectInspector.get(LazyIntObjectInspector.java:38) at org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorUtils.compare(ObjectInspectorUtils.java:497) at org.apache.hadoop.hive.ql.udf.generic.GenericUDAFArgMax$GenericUDAFArgMaxEvaluator.internalMerge(GenericUDAFArgMax.java:165) at org.apache.hadoop.hive.ql.udf.generic.GenericUDAFArgMax$GenericUDAFArgMaxEvaluator.iterate(GenericUDAFArgMax.java:142) ... Not sure why the casting fails. Both myagg.max and px were passed in as arguments of iterate(). Their data types are not known at compile time. That is the only reason why I use ObjectInspectorUtils.compare() to compare them. Do you see any problem with that? --- Pierre > Create argmin and argmax > ------------------------ > > Key: HIVE-1130 > URL: https://issues.apache.org/jira/browse/HIVE-1130 > Project: Hadoop Hive > Issue Type: Improvement > Affects Versions: 0.7.0 > Reporter: Zheng Shao > Assignee: Pierre Huyn > Fix For: 0.7.0 > > Attachments: HIVE-1130.1.patch, HIVE-1130.2.patch > > > With HIVE-1128, users can already do what argmax and argmin does. > But it will be helpful if we provide these functions explicitly so people > from maths/stats background can use it more easily. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.