pig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From roh...@apache.org
Subject svn commit: r1729053 - in /pig/trunk: CHANGES.txt contrib/piggybank/java/src/main/java/org/apache/pig/piggybank/storage/avro/AvroStorage.java
Date Sun, 07 Feb 2016 23:52:43 GMT
Author: rohini
Date: Sun Feb  7 23:52:42 2016
New Revision: 1729053

URL: http://svn.apache.org/viewvc?rev=1729053&view=rev
Log:
PIG-4686: Backend code should not call AvroStorageUtils.getPaths (mitdesai via rohini)

Modified:
    pig/trunk/CHANGES.txt
    pig/trunk/contrib/piggybank/java/src/main/java/org/apache/pig/piggybank/storage/avro/AvroStorage.java

Modified: pig/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1729053&r1=1729052&r2=1729053&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Sun Feb  7 23:52:42 2016
@@ -89,6 +89,8 @@ PIG-4639: Add better parser for Apache H
 
 BUG FIXES
 
+PIG-4686: Backend code should not call AvroStorageUtils.getPaths (mitdesai via rohini)
+
 PIG-4795: Flushing ObjectOutputStream before calling toByteArray on the underlying ByteArrayOutputStream
(emopers via daijy)
 
 PIG-4690: Union with self replicate join will fail in Tez (rohini)

Modified: pig/trunk/contrib/piggybank/java/src/main/java/org/apache/pig/piggybank/storage/avro/AvroStorage.java
URL: http://svn.apache.org/viewvc/pig/trunk/contrib/piggybank/java/src/main/java/org/apache/pig/piggybank/storage/avro/AvroStorage.java?rev=1729053&r1=1729052&r2=1729053&view=diff
==============================================================================
--- pig/trunk/contrib/piggybank/java/src/main/java/org/apache/pig/piggybank/storage/avro/AvroStorage.java
(original)
+++ pig/trunk/contrib/piggybank/java/src/main/java/org/apache/pig/piggybank/storage/avro/AvroStorage.java
Sun Feb  7 23:52:42 2016
@@ -186,18 +186,20 @@ public class AvroStorage extends FileInp
             }
         }
 
-        Configuration conf = job.getConfiguration();
-        Set<Path> paths = AvroStorageUtils.getPaths(location, conf, true);
-        if (!paths.isEmpty()) {
-            // Set top level directories in input format. Adding all files will
-            // bloat configuration size
-            FileInputFormat.setInputPaths(job, paths.toArray(new Path[paths.size()]));
-            // Scan all directories including sub directories for schema
-            if (inputAvroSchema == null) {
-                setInputAvroSchema(paths, conf);
+        if (inputAvroSchema == null || UDFContext.getUDFContext().isFrontend()) {
+            Configuration conf = job.getConfiguration();
+            Set<Path> paths = AvroStorageUtils.getPaths(location, conf, true);
+            if (!paths.isEmpty()) {
+                // Set top level directories in input format. Adding all files will
+                // bloat configuration size
+                FileInputFormat.setInputPaths(job, paths.toArray(new Path[paths.size()]));
+                // Scan all directories including sub directories for schema
+                if (inputAvroSchema == null) {
+                    setInputAvroSchema(paths, conf);
+                }
+            } else {
+                throw new IOException("Input path \'" + location + "\' is not found");
             }
-        } else {
-            throw new IOException("Input path \'" + location + "\' is not found");
         }
 
     }



Mime
View raw message