hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xu...@apache.org
Subject svn commit: r1666684 - /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkUtilities.java
Date Sat, 14 Mar 2015 13:22:07 GMT
Author: xuefu
Date: Sat Mar 14 13:22:06 2015
New Revision: 1666684

URL: http://svn.apache.org/r1666684
Log:
HIVE-9948: SparkUtilities.getFileName passes File.separator to String.split() method (Alex
via Xuefu)

Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkUtilities.java

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkUtilities.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkUtilities.java?rev=1666684&r1=1666683&r2=1666684&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkUtilities.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkUtilities.java Sat Mar
14 13:22:06 2015
@@ -19,12 +19,10 @@ package org.apache.hadoop.hive.ql.exec.s
 
 import java.io.File;
 import java.io.IOException;
-import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.net.URL;
 
-import org.apache.hadoop.conf.Configuration;
+import org.apache.commons.io.FilenameUtils;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hive.conf.HiveConf;
@@ -96,8 +94,8 @@ public class SparkUtilities {
       return null;
     }
 
-    String[] splits = uri.getPath().split(File.separator);
-    return  splits[splits.length-1];
+    String name = FilenameUtils.getName(uri.getPath());
+    return name;
   }
 
   public static SparkSession getSparkSession(HiveConf conf,



Mime
View raw message