Skip to content

Commit fe7669d

Browse files
cloud-fanrxin
authored andcommitted
[SQL][minor] remove duplicated cases in DecimalPrecision
We already have a rule to do type coercion for fixed decimal and unlimited decimal in `WidenTypes`, so we don't need to handle them in `DecimalPrecision`. Author: Wenchen Fan <[email protected]> Closes #6698 from cloud-fan/fix and squashes the following commits: 413ad4a [Wenchen Fan] remove duplicated cases
1 parent bbdfc0a commit fe7669d

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/HiveTypeCoercion.scala

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -445,12 +445,6 @@ trait HiveTypeCoercion {
445445
e2 @ DecimalType.Expression(p2, s2)) if p1 != p2 || s1 != s2 =>
446446
val resultType = DecimalType(max(p1, p2), max(s1, s2))
447447
b.makeCopy(Array(Cast(e1, resultType), Cast(e2, resultType)))
448-
case b @ BinaryComparison(e1 @ DecimalType.Fixed(_, _), e2)
449-
if e2.dataType == DecimalType.Unlimited =>
450-
b.makeCopy(Array(Cast(e1, DecimalType.Unlimited), e2))
451-
case b @ BinaryComparison(e1, e2 @ DecimalType.Fixed(_, _))
452-
if e1.dataType == DecimalType.Unlimited =>
453-
b.makeCopy(Array(e1, Cast(e2, DecimalType.Unlimited)))
454448

455449
// Promote integers inside a binary expression with fixed-precision decimals to decimals,
456450
// and fixed-precision decimals in an expression with floats / doubles to doubles

0 commit comments

Comments
 (0)