Github user fangshil commented on a diff in the pull request:
https://github.com/apache/spark/pull/21276#discussion_r187540911
--- 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 = {
--- End diff --
updated. since getSimpleName is a method from Class, it makes sense for
Utils.getSimpleName to also takes a Class param. Also, Utils.getSimpleName will
try to use the Class's getSimpleName first, and only use the alternative if the
internal error is caught. This should minimize the potential impact of this
patch
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]