Ngone51 commented on a change in pull request #26881: [SPARK-30252][SQL] Disallow negative scale of Decimal URL: https://github.com/apache/spark/pull/26881#discussion_r366112598
########## File path: sql/core/src/test/resources/sql-tests/results/literals.sql.out ########## @@ -211,7 +211,7 @@ select 1E309, -1E309 -- !query 21 select 0.3, -0.8, .5, -.18, 0.1111, .1111 -- !query 21 schema -struct<0.3:decimal(1,1),-0.8:decimal(1,1),0.5:decimal(1,1),-0.18:decimal(2,2),0.1111:decimal(4,4),0.1111:decimal(4,4)> Review comment: That's true that there's other DBMS would ignore the leftmost zero, which could bring larger scale for values less than `1`. I don't know that Spark is also intentionally to follow this. But AFAIK, for number like `0.3`, in Spark, it will have `(precision, scale)` as (2, 1) in `Decimal`, but (1, 1) in `DecimalType`. Maybe, we shall add this as a new feature in following PR. ---------------------------------------------------------------- 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]
