hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xuefu Zhang (JIRA)" <>
Subject [jira] [Commented] (HIVE-5990) round() function with large scale chokes
Date Mon, 09 Dec 2013 23:44:09 GMT


Xuefu Zhang commented on HIVE-5990:

Trunk has a new implementation. However, OOM is observed with the same query, seemingly due
to the same issue as above.
hive> select ROUND(4.42330604244772E-305, 2000000000) from ts;     
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
	at java.math.BigDecimal.bigTenToThe(
	at java.math.BigDecimal.bigMultiplyPowerTen(
	at java.math.BigDecimal.setScale(
	at java.math.BigDecimal.setScale(
	at org.apache.hadoop.hive.ql.udf.generic.RoundUtils.round(
	at org.apache.hadoop.hive.ql.udf.generic.GenericUDFRound.round(
	at org.apache.hadoop.hive.ql.udf.generic.GenericUDFRound.evaluate(
	at org.apache.hadoop.hive.ql.udf.generic.GenericUDF.initializeAndFoldConstants(
	at org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc.newInstance(

[~mihirk] Do you have a fix for this, or do you plan to work on this?

> round() function with large scale chokes
> ----------------------------------------
>                 Key: HIVE-5990
>                 URL:
>             Project: Hive
>          Issue Type: Bug
>          Components: Query Processor, UDF
>    Affects Versions: 0.9.0
>         Environment: CDH 4.2 running Hive 0.9
>            Reporter: Mihir Kulkarni
> ROUND(4.42330604244772E-305, 2000000000) chokes with following error:
> FAILED: SemanticException [Error 10014]: Line 1:7 Wrong arguments '2000000000': org.apache.hadoop.hive.ql.metadata.HiveException:
Unable to execute method public org.apache.hadoop.hive.ql.udf.UDFRound.evaluate(,
 on object org.apache.hadoop.hive.ql.udf.UDFRound@51809ab7 of class org.apache.hadoop.hive.ql.udf.UDFRound
with arguments {,}
of size 2
> I think the problem might be in how Hive evaluates 2 arg ROUND(). The code uses
> BigDecimal.valueOf(d).setScale(i, RoundingMode.HALF_UP)
> which chokes by itself. I saw some changes in implementation of ROUND in hive trunk but
this is still being used in RoundUtils.

This message was sent by Atlassian JIRA

View raw message