diff options
author | Azeem Jiva <azeemj@gmail.com> | 2016-04-26 11:49:04 +0100 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2016-04-26 11:49:04 +0100 |
commit | de6e633420aba1fe5d806a2725a95e610699ae7d (patch) | |
tree | 4d7d0ddc183404e27f56f723efa7929c981b78ea /sql | |
parent | f70e4fff0e7adb8d6fe774daf11fb0dfb080cf31 (diff) | |
download | spark-de6e633420aba1fe5d806a2725a95e610699ae7d.tar.gz spark-de6e633420aba1fe5d806a2725a95e610699ae7d.tar.bz2 spark-de6e633420aba1fe5d806a2725a95e610699ae7d.zip |
[SPARK-14756][CORE] Use parseLong instead of valueOf
## What changes were proposed in this pull request?
Use Long.parseLong which returns a primative.
Use a series of appends() reduces the creation of an extra StringBuilder type
## How was this patch tested?
Unit tests
Author: Azeem Jiva <azeemj@gmail.com>
Closes #12520 from javawithjiva/minor.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/PartitioningUtils.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/PartitioningUtils.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/PartitioningUtils.scala index 3ac2ff494f..1065bb1047 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/PartitioningUtils.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/PartitioningUtils.scala @@ -441,9 +441,9 @@ private[sql] object PartitioningUtils { val c = path.charAt(i) if (c == '%' && i + 2 < path.length) { val code: Int = try { - Integer.valueOf(path.substring(i + 1, i + 3), 16) - } catch { case e: Exception => - -1: Integer + Integer.parseInt(path.substring(i + 1, i + 3), 16) + } catch { + case _: Exception => -1 } if (code >= 0) { sb.append(code.asInstanceOf[Char]) |