PIG-4918: Pig on Tez cannot switch pig.temp.dir to another fs

git-svn-id: https://svn.apache.org/repos/asf/pig/trunk@1779284 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/CHANGES.txt b/CHANGES.txt
index 7f7f771..d150d62 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -181,6 +181,8 @@
 
 BUG FIXES
 
+PIG-4918: Pig on Tez cannot switch pig.temp.dir to another fs (daijy)
+
 PIG-5078: Script fails with error - POStoreTez only accepts MROutput (rohini)
 
 PIG-5088: HashValuePartitioner has skew when there is only map fields (rohini)
diff --git a/src/org/apache/pig/backend/hadoop/executionengine/tez/TezResourceManager.java b/src/org/apache/pig/backend/hadoop/executionengine/tez/TezResourceManager.java
index 9b4538b..ac69ce3 100644
--- a/src/org/apache/pig/backend/hadoop/executionengine/tez/TezResourceManager.java
+++ b/src/org/apache/pig/backend/hadoop/executionengine/tez/TezResourceManager.java
@@ -69,7 +69,7 @@
     public void init(PigContext pigContext, Configuration conf) throws IOException {
         if (!inited) {
             this.resourcesDir = FileLocalizer.getTemporaryResourcePath(pigContext);
-            this.remoteFs = FileSystem.get(conf);
+            this.remoteFs = resourcesDir.getFileSystem(conf);
             this.conf = conf;
             this.pigContext = pigContext;
             this.inited = true;