aboutsummaryrefslogtreecommitdiff
path: root/sql/hive-thriftserver/src
diff options
context:
space:
mode:
authorscwf <wangfei1@huawei.com>2014-10-01 16:38:10 -0700
committerMichael Armbrust <michael@databricks.com>2014-10-01 16:38:15 -0700
commit1b9f0d67f28011cdff316042b344c9891f986aaa (patch)
tree212cd5f55b2c229691c956446362461f4f3c9dd0 /sql/hive-thriftserver/src
parent45e058ca4babbe3cef6524b6a0f48b466a5139bf (diff)
downloadspark-1b9f0d67f28011cdff316042b344c9891f986aaa.tar.gz
spark-1b9f0d67f28011cdff316042b344c9891f986aaa.tar.bz2
spark-1b9f0d67f28011cdff316042b344c9891f986aaa.zip
[SPARK-3704][SQL] Fix ColumnValue type for Short values in thrift server
case ```ShortType```, we should add short value to hive row. Int value may lead to some problems. Author: scwf <wangfei1@huawei.com> Closes #2551 from scwf/fix-addColumnValue and squashes the following commits: 08bcc59 [scwf] ColumnValue.shortValue for short type
Diffstat (limited to 'sql/hive-thriftserver/src')
-rw-r--r--sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/server/SparkSQLOperationManager.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/server/SparkSQLOperationManager.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/server/SparkSQLOperationManager.scala
index bd3f68d92d..910174a153 100644
--- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/server/SparkSQLOperationManager.scala
+++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/server/SparkSQLOperationManager.scala
@@ -113,7 +113,7 @@ private[thriftserver] class SparkSQLOperationManager(hiveContext: HiveContext)
case ByteType =>
to.addColumnValue(ColumnValue.byteValue(from.getByte(ordinal)))
case ShortType =>
- to.addColumnValue(ColumnValue.intValue(from.getShort(ordinal)))
+ to.addColumnValue(ColumnValue.shortValue(from.getShort(ordinal)))
case TimestampType =>
to.addColumnValue(
ColumnValue.timestampValue(from.get(ordinal).asInstanceOf[Timestamp]))
@@ -145,7 +145,7 @@ private[thriftserver] class SparkSQLOperationManager(hiveContext: HiveContext)
case ByteType =>
to.addColumnValue(ColumnValue.byteValue(null))
case ShortType =>
- to.addColumnValue(ColumnValue.intValue(null))
+ to.addColumnValue(ColumnValue.shortValue(null))
case TimestampType =>
to.addColumnValue(ColumnValue.timestampValue(null))
case BinaryType | _: ArrayType | _: StructType | _: MapType =>