You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/01/17 11:38:56 UTC

[GitHub] [spark] NobiGo commented on pull request #35220: [SPARK-37922][SQL] Improve `SimplifyCasts` to remove useless cast

NobiGo commented on pull request #35220:
URL: https://github.com/apache/spark/pull/35220#issuecomment-1014426755


   In the Postgresql:
   ```
   CREATE TABLE decimalTable(value numeric(7,2));
   INSERT INTO decimalTable(value) VALUES (12.34);
   INSERT INTO decimalTable(value) VALUES (12.45);
   INSERT INTO decimalTable(value) VALUES (12.55);
   
   select value::decimal(5,1)::decimal(4,2) from decimalTable;
   ```
   ```
   value
   12.30
   12.50
   12.60
   ```
   
   If we simplify this cast to value::decimal(4,2) The value will be:
   
   ```
   value
   12.34
   12.45
   12.55
   ```
   
   The result will be different. So it is reasonable or acceptable in Spark?


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org