LuciferYang commented on code in PR #43890:
URL: https://github.com/apache/spark/pull/43890#discussion_r1399097708


##########
core/src/main/scala/org/apache/spark/input/FixedLengthBinaryInputFormat.scala:
##########
@@ -74,7 +74,7 @@ private[spark] class FixedLengthBinaryInputFormat
     if (defaultSize < recordLength) {
       recordLength.toLong
     } else {
-      (Math.floor(defaultSize / recordLength) * recordLength).toLong
+      (Math.floor(defaultSize.toDouble / recordLength.toDouble) * 
recordLength).toLong

Review Comment:
   1. Is it feasible here to just add `.toDouble` to `defaultSize`?
   2. In the current scenario, theoretically, both `defaultSize` and 
`recordLength` should be integer(or long) greater than 0 and `defaultSize / 
recordLength` is a long value. So, Is there a need to perform `Math.floor` on 
it?
   
   This is a very old piece of code, do you have time to help check this? 
@dongjoon-hyun @srowen Thanks
   
   



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to