PIG-619: Create one InputSplit even when the input file is zero length so that hadoop runs maps and creates output for the next job.


git-svn-id: https://svn.apache.org/repos/asf/hadoop/pig/branches/pre-multiquery-phase2@775346 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/CHANGES.txt b/CHANGES.txt
index db99021..bd678f6 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -24,6 +24,10 @@
 
 IMPROVEMENTS
 
+PIG-619: Create one InputSplit even when the input file is zero length
+         so that hadoop runs maps and creates output for the next
+         job (gates).
+
 PIG-693: Proposed improvements to pig's optimizer (sms)
 
 PIG-700: To automate the pig patch test process (gkesavan via sms)
diff --git a/src/org/apache/pig/backend/executionengine/PigSlicer.java b/src/org/apache/pig/backend/executionengine/PigSlicer.java
index 8cc638c..00b149e 100644
--- a/src/org/apache/pig/backend/executionengine/PigSlicer.java
+++ b/src/org/apache/pig/backend/executionengine/PigSlicer.java
@@ -100,6 +100,12 @@
                 // Anything that ends with a ".gz" we must process as a complete
                 // file
                 slices.add(new PigSlice(name, funcSpec, 0, size));
+            } else if (size == 0) {
+                // add one empty slice.  This is a total hack to deal with the
+				// case where hadoop isn't starting maps for empty arrays of
+				// InputSplits.  See PIG-619.  This should be removed
+				// once we determine why this is.
+                slices.add(new PigSlice(name, funcSpec, 0, bs));
             } else {
                 while (pos < size) {
                     if (pos + bs > size) {