From 1727e0841cf9948e601ae2936fe89094c8c0c835 Mon Sep 17 00:00:00 2001 From: Reynold Xin Date: Sun, 18 Jan 2015 11:01:42 -0800 Subject: [SPARK-5279][SQL] Use java.math.BigDecimal as the exposed Decimal type. Author: Reynold Xin Closes #4092 from rxin/bigdecimal and squashes the following commits: 27b08c9 [Reynold Xin] Fixed test. 10cb496 [Reynold Xin] [SPARK-5279][SQL] Use java.math.BigDecimal as the exposed Decimal type. --- .../src/main/scala/org/apache/spark/sql/hive/thriftserver/Shim12.scala | 2 +- .../src/main/scala/org/apache/spark/sql/hive/thriftserver/Shim13.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/hive-thriftserver') diff --git a/sql/hive-thriftserver/v0.12.0/src/main/scala/org/apache/spark/sql/hive/thriftserver/Shim12.scala b/sql/hive-thriftserver/v0.12.0/src/main/scala/org/apache/spark/sql/hive/thriftserver/Shim12.scala index 171d707b13..166c56b9df 100644 --- a/sql/hive-thriftserver/v0.12.0/src/main/scala/org/apache/spark/sql/hive/thriftserver/Shim12.scala +++ b/sql/hive-thriftserver/v0.12.0/src/main/scala/org/apache/spark/sql/hive/thriftserver/Shim12.scala @@ -122,7 +122,7 @@ private[hive] class SparkExecuteStatementOperation( case FloatType => to.addColumnValue(ColumnValue.floatValue(from.getFloat(ordinal))) case DecimalType() => - val hiveDecimal = from.get(ordinal).asInstanceOf[BigDecimal].bigDecimal + val hiveDecimal = from.getDecimal(ordinal) to.addColumnValue(ColumnValue.stringValue(new HiveDecimal(hiveDecimal))) case LongType => to.addColumnValue(ColumnValue.longValue(from.getLong(ordinal))) diff --git a/sql/hive-thriftserver/v0.13.1/src/main/scala/org/apache/spark/sql/hive/thriftserver/Shim13.scala b/sql/hive-thriftserver/v0.13.1/src/main/scala/org/apache/spark/sql/hive/thriftserver/Shim13.scala index bec9d9aca3..eaf7a1ddd4 100644 --- a/sql/hive-thriftserver/v0.13.1/src/main/scala/org/apache/spark/sql/hive/thriftserver/Shim13.scala +++ b/sql/hive-thriftserver/v0.13.1/src/main/scala/org/apache/spark/sql/hive/thriftserver/Shim13.scala @@ -94,7 +94,7 @@ private[hive] class SparkExecuteStatementOperation( case FloatType => to += from.getFloat(ordinal) case DecimalType() => - to += from.getAs[BigDecimal](ordinal).bigDecimal + to += from.getDecimal(ordinal) case LongType => to += from.getLong(ordinal) case ByteType => -- cgit v1.2.3