Skip to content

Commit 064750d

Browse files
scwfmarmbrus
authored andcommitted
[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 <[email protected]> Closes #2551 from scwf/fix-addColumnValue and squashes the following commits: 08bcc59 [scwf] ColumnValue.shortValue for short type
1 parent f4e17cd commit 064750d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/server/SparkSQLOperationManager.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ private[thriftserver] class SparkSQLOperationManager(hiveContext: HiveContext)
113113
case ByteType =>
114114
to.addColumnValue(ColumnValue.byteValue(from.getByte(ordinal)))
115115
case ShortType =>
116-
to.addColumnValue(ColumnValue.intValue(from.getShort(ordinal)))
116+
to.addColumnValue(ColumnValue.shortValue(from.getShort(ordinal)))
117117
case TimestampType =>
118118
to.addColumnValue(
119119
ColumnValue.timestampValue(from.get(ordinal).asInstanceOf[Timestamp]))
@@ -145,7 +145,7 @@ private[thriftserver] class SparkSQLOperationManager(hiveContext: HiveContext)
145145
case ByteType =>
146146
to.addColumnValue(ColumnValue.byteValue(null))
147147
case ShortType =>
148-
to.addColumnValue(ColumnValue.intValue(null))
148+
to.addColumnValue(ColumnValue.shortValue(null))
149149
case TimestampType =>
150150
to.addColumnValue(ColumnValue.timestampValue(null))
151151
case BinaryType | _: ArrayType | _: StructType | _: MapType =>

0 commit comments

Comments
 (0)