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/04/18 17:56:40 UTC

[GitHub] [spark] dtenedor commented on a diff in pull request #35269: [SPARK-28516][SQL] Data Type Formatting Functions: `to_char`

dtenedor commented on code in PR #35269:
URL: https://github.com/apache/spark/pull/35269#discussion_r852295254


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/NumberFormatter.scala:
##########
@@ -149,6 +156,21 @@ class NumberFormatter(originNumberFormat: String, isParse: Boolean = true) exten
     } else if (invalidSignPosition(DOLLAR_SIGN)) {
       TypeCheckResult.TypeCheckFailure(
         nonFistOrLastCharInNumberFormatError(s"'$DOLLAR_SIGN'"))
+    } else if (!isParse && normalizedNumberFormat.exists(_ == COMMA_SIGN)) {

Review Comment:
   As of this PR [1], the `NumberFormatter` class is deleted now :) It looks like that got merged after this PR started but before now. How do we want to handle this? Should we (a) merge latest commits from master including [1] and then update this PR to use the `ToNumberParser` class instead, or (b) keep this `NumberFormatter` class around just for the `to_char` function and delete all the code related to parsing strings to `Decimal` values?
   
   Either approach sounds OK, WDYT?
   
   [1] https://github.com/apache/spark/pull/36066



-- 
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