mgaido91 commented on issue #22450: [SPARK-25454][SQL] Avoid precision loss in division with decimal with negative scale URL: https://github.com/apache/spark/pull/22450#issuecomment-473253706 > Can you list some of them? Oracle for instance allows negative scales. > we should find out the cases that will be broken, and put them in the release notes. Well, the cases are obvious, ie. when there are negative scales which define numbers which don't fit in (38, 0), surely we cannot handle them anymore; moreover we need to convert to non-negative all the cases when the users provides a scala/java decimal with negative scale and we may cause some precision losses in cases when a negative scale and a non-negative one are the inputs for an arithmetic operation. > Personally I'd prefer the first direction, as that's how other mainstream databases do. I agree with you in general, but then when I think to the backward compatibility issues I am doubtful about it. And in the discussion in the mailing list I think @rxin preferred to avoid these breaking changes too. > I would reject a proposal that only allows negative scale, as its definition will be hard to generalize. Just to be clear, here I am not proposing to allow negative scales, I am just proposing to handle them properly in the operations since they happen to be present.
---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
