Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

Commit

Permalink
adding FloatType in ColumnarLiteral
Browse files Browse the repository at this point in the history
Signed-off-by: Yuan Zhou <[email protected]>
  • Loading branch information
zhouyuan committed May 25, 2022
1 parent 007717e commit 4cda7d5
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ColumnarLiteral(lit: Literal)

def buildCheck(): ArrowType = {
val supportedTypes =
List(StringType, IntegerType, LongType, DoubleType, DateType,
List(StringType, IntegerType, LongType, DoubleType, FloatType, DateType,
BooleanType, CalendarIntervalType, BinaryType, TimestampType)
if (supportedTypes.indexOf(dataType) == -1 && !dataType.isInstanceOf[DecimalType]) {
// Decimal is supported in ColumnarLiteral
Expand Down Expand Up @@ -111,6 +111,13 @@ class ColumnarLiteral(lit: Literal)
case _ =>
(TreeBuilder.makeLiteral(value.asInstanceOf[java.lang.Double]), resultType)
}
case t: FloatType =>
value match {
case null =>
(TreeBuilder.makeNull(resultType), resultType)
case _ =>
(TreeBuilder.makeLiteral(value.asInstanceOf[java.lang.Float]), resultType)
}
case d: DecimalType =>
value match {
case null =>
Expand Down

0 comments on commit 4cda7d5

Please sign in to comment.