jonvex commented on code in PR #13572:
URL: https://github.com/apache/hudi/pull/13572#discussion_r2228886225
##########
hudi-client/hudi-spark-client/src/main/scala/org/apache/spark/sql/HoodieInternalRowUtils.scala:
##########
@@ -379,7 +379,7 @@ object HoodieInternalRowUtils {
case (_: DoubleType, _) =>
prevDataType match {
- case _: FloatType => (fieldUpdater, ordinal, value) =>
fieldUpdater.setDouble(ordinal, value.asInstanceOf[Float].toDouble)
+ case _: FloatType => (fieldUpdater, ordinal, value) =>
fieldUpdater.setDouble(ordinal, value.asInstanceOf[Float].toString.toDouble)
Review Comment:
https://stackoverflow.com/questions/916081/convert-float-to-double-without-losing-precision
Casting float to double just pads the representation with a bunch of zeros.
But when you do .toString it will be slightly different. If you want it to be
the same you need to do this. You can see that we do it in avro as well in
rewrite record
--
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]