Author: rohini
Date: Sat Jul 15 20:22:06 2023
New Revision: 1911038

URL: http://svn.apache.org/viewvc?rev=1911038&view=rev
Log:
PIG-5442: Add only credentials from setStoreLocation to the Job Conf (maswin 
via rohini)

Modified:
    pig/branches/branch-0.18/CHANGES.txt
    
pig/branches/branch-0.18/src/org/apache/pig/backend/hadoop/executionengine/tez/TezDagBuilder.java

Modified: pig/branches/branch-0.18/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/pig/branches/branch-0.18/CHANGES.txt?rev=1911038&r1=1911037&r2=1911038&view=diff
==============================================================================
--- pig/branches/branch-0.18/CHANGES.txt (original)
+++ pig/branches/branch-0.18/CHANGES.txt Sat Jul 15 20:22:06 2023
@@ -122,6 +122,8 @@ OPTIMIZATIONS
  
 BUG FIXES
 
+PIG-5442: Add only credentials from setStoreLocation to the Job Conf (maswin 
via rohini)
+
 PIG-5441: Pig skew join tez grace reducer fails to find shuffle data (yigress 
via rohini)
 
 PIG-5432: OrcStorage fails to detect schema in some cases (jtolar via rohini)

Modified: 
pig/branches/branch-0.18/src/org/apache/pig/backend/hadoop/executionengine/tez/TezDagBuilder.java
URL: 
http://svn.apache.org/viewvc/pig/branches/branch-0.18/src/org/apache/pig/backend/hadoop/executionengine/tez/TezDagBuilder.java?rev=1911038&r1=1911037&r2=1911038&view=diff
==============================================================================
--- 
pig/branches/branch-0.18/src/org/apache/pig/backend/hadoop/executionengine/tez/TezDagBuilder.java
 (original)
+++ 
pig/branches/branch-0.18/src/org/apache/pig/backend/hadoop/executionengine/tez/TezDagBuilder.java
 Sat Jul 15 20:22:06 2023
@@ -1078,7 +1078,15 @@ public class TezDagBuilder extends TezOp
             for (POStore st : stores) {
                 storeLocations.add(st);
                 StoreFuncInterface sFunc = st.getStoreFunc();
-                sFunc.setStoreLocation(st.getSFile().getFileName(), job);
+
+                // Backward compatibility - before addCredentials API was 
introduced, credentials were set in setStoreLocation method
+                Job copyOfJob = new Job(job.getConfiguration());
+                sFunc.setStoreLocation(st.getSFile().getFileName(), copyOfJob);
+                // Credentials object in the copy should always refer to the 
original job's. Just future proofing.
+                if (job.getCredentials() != copyOfJob.getCredentials()) {
+                    job.getCredentials().mergeAll(copyOfJob.getCredentials());
+                }
+
                 sFunc.addCredentials(job.getCredentials(), 
job.getConfiguration());
             }
 


Reply via email to