Author: daijy
Date: Wed May 26 17:21:55 2010
New Revision: 948506

URL: http://svn.apache.org/viewvc?rev=948506&view=rev
Log:
PIG-1419: Remove user.name from JobConf

Modified:
    hadoop/pig/trunk/CHANGES.txt
    
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/HExecutionEngine.java
    
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/JobControlCompiler.java
    
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigInputFormat.java
    hadoop/pig/trunk/src/org/apache/pig/tools/grunt/GruntParser.java

Modified: hadoop/pig/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/CHANGES.txt?rev=948506&r1=948505&r2=948506&view=diff
==============================================================================
--- hadoop/pig/trunk/CHANGES.txt (original)
+++ hadoop/pig/trunk/CHANGES.txt Wed May 26 17:21:55 2010
@@ -70,7 +70,9 @@ PIG-1309: Map-side Cogroup (ashutoshc)
 
 BUG FIXES
 
-PIG-1359: bin/pig script does not pick up correct jar libraries
+PIG-1419: Remove "user.name" from JobConf (daijy)
+
+PIG-1359: bin/pig script does not pick up correct jar libraries (zjffdu)
 
 PIG-566: Dump and store outputs do not match for PigStorage (azaroth via daijy)
 

Modified: 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/HExecutionEngine.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/HExecutionEngine.java?rev=948506&r1=948505&r2=948506&view=diff
==============================================================================
--- 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/HExecutionEngine.java
 (original)
+++ 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/HExecutionEngine.java
 Wed May 26 17:21:55 2010
@@ -396,7 +396,10 @@ public class HExecutionEngine implements
             while (propertiesIter.hasMoreElements()) {
                 String key = (String) propertiesIter.nextElement();
                 String val = properties.getProperty(key);
-                hadoopProperties.put(key, val);
+
+                // We do not put user.name, See PIG-1419
+                if (!key.equals("user.name"))
+                    hadoopProperties.put(key, val);
             }
             
             //clear user defined properties and re-populate

Modified: 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/JobControlCompiler.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/JobControlCompiler.java?rev=948506&r1=948505&r2=948506&view=diff
==============================================================================
--- 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/JobControlCompiler.java
 (original)
+++ 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/JobControlCompiler.java
 Wed May 26 17:21:55 2010
@@ -336,8 +336,6 @@ public class JobControlCompiler{
         
         //Set the User Name for this job. This will be
         //used as the working directory
-        String user = System.getProperty("user.name");        
-        conf.set("user.name", (user != null ? user : "Pigster"));
         if (pigContext.defaultParallel > 0)
             conf.set("mapred.reduce.tasks", ""+pigContext.defaultParallel);
  

Modified: 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigInputFormat.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigInputFormat.java?rev=948506&r1=948505&r2=948506&view=diff
==============================================================================
--- 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigInputFormat.java
 (original)
+++ 
hadoop/pig/trunk/src/org/apache/pig/backend/hadoop/executionengine/mapReduceLayer/PigInputFormat.java
 Wed May 26 17:21:55 2010
@@ -230,7 +230,7 @@ public class PigInputFormat extends Inpu
                 // if the execution is against Mapred DFS, set
                 // working dir to /user/<userid>
                 if(pigContext.getExecType() == ExecType.MAPREDUCE) {
-                    fs.setWorkingDirectory(new Path("/user", 
conf.get("user.name")));
+                    fs.setWorkingDirectory(jobcontext.getWorkingDirectory());
                 }
                 
                 // first pass input location to the loader - for this send a 

Modified: hadoop/pig/trunk/src/org/apache/pig/tools/grunt/GruntParser.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/tools/grunt/GruntParser.java?rev=948506&r1=948505&r2=948506&view=diff
==============================================================================
--- hadoop/pig/trunk/src/org/apache/pig/tools/grunt/GruntParser.java (original)
+++ hadoop/pig/trunk/src/org/apache/pig/tools/grunt/GruntParser.java Wed May 26 
17:21:55 2010
@@ -57,6 +57,7 @@ import org.apache.pig.backend.datastorag
 import org.apache.pig.backend.executionengine.ExecJob;
 import org.apache.pig.backend.executionengine.ExecutionEngine;
 import org.apache.pig.backend.hadoop.datastorage.ConfigurationUtil;
+import org.apache.pig.backend.hadoop.datastorage.HDataStorage;
 import org.apache.pig.backend.hadoop.executionengine.HExecutionEngine;
 import org.apache.pig.data.Tuple;
 import org.apache.pig.impl.util.LogUtils;
@@ -562,7 +563,7 @@ public class GruntParser extends PigScri
         if(mExplain == null) { // process only if not in "explain" mode
             try {
                 if (path == null) {
-                    container = mDfs.asContainer("/user/" + 
System.getProperty("user.name"));
+                    container = 
mDfs.asContainer(((HDataStorage)mDfs).getHFS().getHomeDirectory().toString());
                     mDfs.setActiveContainer(container);
                 }
                 else
@@ -582,7 +583,7 @@ public class GruntParser extends PigScri
             }
             catch (DataStorageException e) {
                 throw new IOException("Failed to change working directory to " 
+ 
-                                      ((path == null) ? ("/user/" + 
System.getProperty("user.name")) 
+                                      ((path == null) ? 
(((HDataStorage)mDfs).getHFS().getHomeDirectory().toString()) 
                                                          : (path)), e);
             }
         } else {


Reply via email to