Skip to content

Commit

Permalink
[SPARK-3704][SQL] Fix ColumnValue type for Short values in thrift server
Browse files Browse the repository at this point in the history
case ```ShortType```, we should add short value to hive row. Int value may lead to some problems.

Author: scwf <[email protected]>

Closes apache#2551 from scwf/fix-addColumnValue and squashes the following commits:

08bcc59 [scwf] ColumnValue.shortValue for short type
  • Loading branch information
scwf authored and marmbrus committed Nov 11, 2014
1 parent f4e17cd commit 064750d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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]))
Expand Down Expand Up @@ -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 =>
Expand Down

0 comments on commit 064750d

Please sign in to comment.