Github user dilipbiswal commented on a diff in the pull request:
https://github.com/apache/spark/pull/13368#discussion_r64982756
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala
---
@@ -290,11 +290,6 @@ object TypeCoercion {
// Skip nodes who's children have not been resolved yet.
case e if !e.childrenResolved => e
- case a @ BinaryArithmetic(left @ StringType(), right @
DecimalType.Expression(_, _)) =>
- a.makeCopy(Array(Cast(left, DecimalType.SYSTEM_DEFAULT), right))
- case a @ BinaryArithmetic(left @ DecimalType.Expression(_, _), right
@ StringType()) =>
- a.makeCopy(Array(left, Cast(right, DecimalType.SYSTEM_DEFAULT)))
-
--- End diff --
Hi @dongjoon-hyun
Some more data points for us to decide. I did the following in hive to
verify decimal multiplication semantics.
```SQL
hive> create table t1(c1 decimal(38, 18), c2 decimal(38, 18));
OK
hive> insert into t1 values (123456,123, 1234.123);
OK
hive> create table t2 as select c1 * c2 from t1;
OK
hive> describe t2;
OK
_c0 decimal(38,36)
Time taken: 0.064 seconds, Fetched: 1 row(s)
hive> select * from t2;
OK
NULL
```
For decimal literal case , hive seems to do better than us. We can look at
it as a followup.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]