hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject svn commit: r1325615 - /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/io/HiveFileFormatUtils.java
Date Fri, 13 Apr 2012 04:45:37 GMT
Author: hashutosh
Date: Fri Apr 13 04:45:37 2012
New Revision: 1325615

URL: http://svn.apache.org/viewvc?rev=1325615&view=rev
Log:
HIVE-2948 [jira] HiveFileFormatUtils should use Path.SEPARATOR instead of
File.Separator

Summary:
https://issues.apache.org/jira/browse/HIVE-2948

Simple patch which replaces File.separator to Path.SEPARATOR since separator for
hdfs path is Path.SEPARATOR not java's File.SEPARATOR

Because its munging hdfs paths and not OS paths.

Test Plan: EMPTY

Reviewers: JIRA, kevinwilfong

Reviewed By: kevinwilfong

Differential Revision: https://reviews.facebook.net/D2763

Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/io/HiveFileFormatUtils.java

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/io/HiveFileFormatUtils.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/io/HiveFileFormatUtils.java?rev=1325615&r1=1325614&r2=1325615&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/io/HiveFileFormatUtils.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/io/HiveFileFormatUtils.java Fri Apr 13
04:45:37 2012
@@ -18,7 +18,6 @@
 
 package org.apache.hadoop.hive.ql.io;
 
-import java.io.File;
 import java.io.IOException;
 import java.io.Serializable;
 import java.util.ArrayList;
@@ -317,8 +316,8 @@ public final class HiveFileFormatUtils {
 
     if (part == null) {
       String dirStr = dir.toString();
-      int dirPathIndex = dirPath.lastIndexOf(File.separator);
-      int dirStrIndex = dirStr.lastIndexOf(File.separator);
+      int dirPathIndex = dirPath.lastIndexOf(Path.SEPARATOR);
+      int dirStrIndex = dirStr.lastIndexOf(Path.SEPARATOR);
       while (dirPathIndex >= 0 && dirStrIndex >= 0) {
         dirStr = dirStr.substring(0, dirStrIndex);
         dirPath = dirPath.substring(0, dirPathIndex);
@@ -331,8 +330,8 @@ public final class HiveFileFormatUtils {
         if (part != null) {
           break;
         }
-        dirPathIndex = dirPath.lastIndexOf(File.separator);
-        dirStrIndex = dirStr.lastIndexOf(File.separator);
+        dirPathIndex = dirPath.lastIndexOf(Path.SEPARATOR);
+        dirStrIndex = dirStr.lastIndexOf(Path.SEPARATOR);
       }
     }
     return part;
@@ -362,8 +361,8 @@ public final class HiveFileFormatUtils {
     path = dirPath;
 
     String dirStr = dir.toString();
-    int dirPathIndex = dirPath.lastIndexOf(File.separator);
-    int dirStrIndex = dirStr.lastIndexOf(File.separator);
+    int dirPathIndex = dirPath.lastIndexOf(Path.SEPARATOR);
+    int dirStrIndex = dirStr.lastIndexOf(Path.SEPARATOR);
     while (dirPathIndex >= 0 && dirStrIndex >= 0) {
       dirStr = dirStr.substring(0, dirStrIndex);
       dirPath = dirPath.substring(0, dirPathIndex);
@@ -374,8 +373,8 @@ public final class HiveFileFormatUtils {
       if (foundAlias(pathToAliases, dirPath)) {
         return dirPath;
       }
-      dirPathIndex = dirPath.lastIndexOf(File.separator);
-      dirStrIndex = dirStr.lastIndexOf(File.separator);
+      dirPathIndex = dirPath.lastIndexOf(Path.SEPARATOR);
+      dirStrIndex = dirStr.lastIndexOf(Path.SEPARATOR);
     }
     return null;
   }



Mime
View raw message