cloud-fan commented on a change in pull request #35060:
URL: https://github.com/apache/spark/pull/35060#discussion_r781171223



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/NumberUtils.scala
##########
@@ -21,49 +21,73 @@ import java.math.BigDecimal
 import java.text.{DecimalFormat, NumberFormat, ParsePosition}
 import java.util.Locale
 
+import org.apache.spark.sql.AnalysisException
+import org.apache.spark.sql.catalyst.analysis.TypeCheckResult
 import org.apache.spark.sql.errors.{QueryCompilationErrors, 
QueryExecutionErrors}
 import org.apache.spark.sql.types.Decimal
 import org.apache.spark.unsafe.types.UTF8String
 
 object NumberUtils {
 
-  private val pointSign = '.'
-  private val letterPointSign = 'D'
-  private val commaSign = ','
-  private val letterCommaSign = 'G'
-  private val minusSign = '-'
-  private val letterMinusSign = 'S'
-  private val dollarSign = '$'
+  private final val POINT_SIGN = '.'
+  private final val POINT_LETTER = 'D'
+  private final val COMMA_SIGN = ','
+  private final val COMMA_LETTER = 'G'
+  private final val MINUS_SIGN = '-'
+  private final val MINUS_LETTER = 'S'
+  private final val DOLLAR_SIGN = '$'
+  private final val NINE_DIGIT = '9'
+  private final val ZERO_DIGIT = '0'
+  private final val POUND_SIGN = '#'
 
-  private val commaSignStr = commaSign.toString
+  private final val COMMA_SIGN_STRING = COMMA_SIGN.toString
+  private final val POUND_SIGN_STRING = POUND_SIGN.toString
 
+  private final val SIGN_SET = Set(POINT_SIGN, COMMA_SIGN, MINUS_SIGN, 
DOLLAR_SIGN)
+
+  /**
+   * DecimalFormat provides '#' and '0' as placeholder of digit, ',' as 
grouping separator,
+   * '.' as decimal separator, '-' as minus, '$' as dollar, but '9', 'G', 'D', 
'S'. So we need

Review comment:
       ```suggestion
      * '.' as decimal separator, '-' as minus, '$' as dollar, but not '9', 
'G', 'D', 'S'. So we need
   ```




-- 
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-unsubscr...@spark.apache.org

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



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

Reply via email to