spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maropu <...@git.apache.org>
Subject [GitHub] spark pull request #21276: [SPARK-24216][SQL] Spark TypedAggregateExpression...
Date Thu, 10 May 2018 09:10:51 GMT
Github user maropu commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21276#discussion_r187278875
  
    --- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
    @@ -2715,6 +2715,66 @@ private[spark] object Utils extends Logging {
         HashCodes.fromBytes(secretBytes).toString()
       }
     
    +  /**
    +   * A safer version than scala obj's getClass.getSimpleName and Utils.getFormattedClassName
    +   * which may throw Malformed class name error.
    +   * This method mimicks scalatest's getSimpleNameOfAnObjectsClass.
    +   */
    +  def getSimpleName(fullyQualifiedName: String): String = {
    +    stripDollars(parseSimpleName(fullyQualifiedName))
    +  }
    +
    +  /**
    +   * Remove the packages from full qualified class name
    +   */
    +  private def parseSimpleName(fullyQualifiedName: String): String = {
    --- End diff --
    
    `fullyQualifiedName.split("\\.").takeRight(1)`?


---

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


Mime
View raw message