Repository: hive Updated Branches: refs/heads/master a75b600c9 -> 8b285947d
HIVE-17554: ArithmeticException: / by zero at hplsql component (ZhangBing Lin reviewed by Rui) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/8b285947 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/8b285947 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/8b285947 Branch: refs/heads/master Commit: 8b285947d7aa8e87e63288dc6fe8ff13d6aa985f Parents: a75b600 Author: ZhangBing Lin <lin.zhangb...@zte.com.cn> Authored: Thu Sep 21 10:47:20 2017 +0800 Committer: Rui Li <li...@apache.org> Committed: Thu Sep 21 10:47:20 2017 +0800 ---------------------------------------------------------------------- hplsql/src/main/java/org/apache/hive/hplsql/Copy.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/8b285947/hplsql/src/main/java/org/apache/hive/hplsql/Copy.java ---------------------------------------------------------------------- diff --git a/hplsql/src/main/java/org/apache/hive/hplsql/Copy.java b/hplsql/src/main/java/org/apache/hive/hplsql/Copy.java index 67af0a9..1879f99 100644 --- a/hplsql/src/main/java/org/apache/hive/hplsql/Copy.java +++ b/hplsql/src/main/java/org/apache/hive/hplsql/Copy.java @@ -28,6 +28,8 @@ import java.util.List; import java.io.FileOutputStream; import java.io.OutputStream; import java.io.IOException; +import java.math.RoundingMode; +import java.text.DecimalFormat; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -167,7 +169,9 @@ public class Copy { exec.setRowCount(rows); long elapsed = timer.stop(); if (info) { - info(ctx, "COPY completed: " + rows + " row(s), " + timer.format() + ", " + rows/(elapsed/1000) + " rows/sec"); + DecimalFormat df = new DecimalFormat("#,##0.00"); + df.setRoundingMode(RoundingMode.HALF_UP); + info(ctx, "COPY completed: " + rows + " row(s), " + timer.format() + ", " + df.format(rows/(elapsed/1000.0)) + " rows/sec"); } }