slinkydeveloper commented on a change in pull request #19001:
URL: https://github.com/apache/flink/pull/19001#discussion_r826071344



##########
File path: 
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/codegen/CodeGenUtils.scala
##########
@@ -209,13 +209,27 @@ object CodeGenUtils {
     case _: JShort => s"((short)$value)"
     case _: JInt => value.toString
     case _: JLong => value.toString + "L"
-    case _: JFloat => value.toString + "f"
-    case _: JDouble => value.toString + "d"
+    case _: JFloat => value match {
+      case JFloat.NEGATIVE_INFINITY => "java.lang.Float.NEGATIVE_INFINITY"
+      case JFloat.POSITIVE_INFINITY => "java.lang.Float.POSITIVE_INFINITY"
+      case _ => value.toString + "f"
+    }
+    case _: JDouble => value match {
+      case JDouble.NEGATIVE_INFINITY => "java.lang.Double.NEGATIVE_INFINITY"
+      case JDouble.POSITIVE_INFINITY => "java.lang.Double.POSITIVE_INFINITY"
+      case _ => value.toString + "d"
+    }
     case sd: StringData =>
       qualifyMethod(BINARY_STRING_DATA_FROM_STRING) + "(\"" +
         EncodingUtils.escapeJava(sd.toString) + "\")"
     case td: TimestampData =>
       s"$TIMESTAMP_DATA.fromEpochMillis(${td.getMillisecond}L, 
${td.getNanoOfMillisecond})"
+    case decimalData: DecimalData =>
+      s"""$DECIMAL_UTIL.castFrom(

Review comment:
       In this particular case, it doesn't really make a difference, as we 
store literal values in static variables anyway. I rather prefer to keep the 
implementation simple here.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to