@@ -620,9 +620,18 @@ func isFloatArray(colType string) bool {
620
620
}
621
621
}
622
622
623
+ func isDecimal (colType string ) bool {
624
+ switch colType {
625
+ case "DECIMAL" , "NUMERIC" :
626
+ return true
627
+ default :
628
+ return false
629
+ }
630
+ }
631
+
623
632
func isDecimalArray (colType string ) bool {
624
633
switch colType {
625
- case "[]DECIMAL" , "_DECIMAL" :
634
+ case "[]DECIMAL" , "_DECIMAL" , "[]NUMERIC" , "_NUMERIC" :
626
635
return true
627
636
default :
628
637
return false
@@ -633,7 +642,7 @@ func needApproximateMatch(colType string) bool {
633
642
// On s390x, check that values for both float and decimal coltypes are
634
643
// approximately equal to take into account platform differences in floating
635
644
// point calculations. On other architectures, check float values only.
636
- return (runtime .GOARCH == "s390x" && (colType == "DECIMAL" || isDecimalArray (colType ))) ||
645
+ return (runtime .GOARCH == "s390x" && (isDecimal ( colType ) || isDecimalArray (colType ))) ||
637
646
colType == "FLOAT4" || colType == "FLOAT8" || isFloatArray (colType )
638
647
}
639
648
@@ -714,7 +723,7 @@ func unsortedMatricesDiffWithFloatComp(
714
723
}
715
724
var needCustomMatch bool
716
725
for _ , colType := range colTypes {
717
- if needApproximateMatch (colType ) || colType == "DECIMAL" || isDecimalArray (colType ) {
726
+ if needApproximateMatch (colType ) || isDecimal ( colType ) || isDecimalArray (colType ) {
718
727
needCustomMatch = true
719
728
break
720
729
}
@@ -748,7 +757,7 @@ func unsortedMatricesDiffWithFloatComp(
748
757
}
749
758
} else {
750
759
switch {
751
- case colType == "DECIMAL" :
760
+ case isDecimal ( colType ) :
752
761
// For decimals, remove any trailing zeroes.
753
762
row1 [j ] = trimDecimalTrailingZeroes (row1 [j ])
754
763
row2 [j ] = trimDecimalTrailingZeroes (row2 [j ])
0 commit comments