Return-Path: X-Original-To: apmail-spark-issues-archive@minotaur.apache.org Delivered-To: apmail-spark-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6662918752 for ; Mon, 19 Oct 2015 06:35:05 +0000 (UTC) Received: (qmail 43393 invoked by uid 500); 19 Oct 2015 06:35:05 -0000 Delivered-To: apmail-spark-issues-archive@spark.apache.org Received: (qmail 43360 invoked by uid 500); 19 Oct 2015 06:35:05 -0000 Mailing-List: contact issues-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@spark.apache.org Received: (qmail 43339 invoked by uid 99); 19 Oct 2015 06:35:05 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Oct 2015 06:35:05 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 09EF52C1F5E for ; Mon, 19 Oct 2015 06:35:05 +0000 (UTC) Date: Mon, 19 Oct 2015 06:35:05 +0000 (UTC) From: "Josh Rosen (JIRA)" To: issues@spark.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (SPARK-11177) sc.wholeTextFiles throws ArrayIndexOutOfBoundsException when S3 file has zero bytes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SPARK-11177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14962913#comment-14962913 ] Josh Rosen commented on SPARK-11177: ------------------------------------ It looks like this is caused by MAPREDUCE-4470, which is not patched in Apache Hadoop 1.x releases. If Spark users cannot upgrade to Hadoop 2.x and absolutely need a fix for this, then one somewhat hacky solution is to use a modified copy of CombineFileInputFormat which lives in the Spark source tree and includes the three-line fix for MAPREDUCE-4470. While this works (I have tests!), it's not an approach which is suitable for inclusion in a Spark release: it's going to be borderline impossible to maintain source- and binary-compatibility with all of our supported Hadoop versions while using this approach. > sc.wholeTextFiles throws ArrayIndexOutOfBoundsException when S3 file has zero bytes > ----------------------------------------------------------------------------------- > > Key: SPARK-11177 > URL: https://issues.apache.org/jira/browse/SPARK-11177 > Project: Spark > Issue Type: Sub-task > Reporter: Josh Rosen > Assignee: Josh Rosen > > From a user report: > {quote} > When I upload a series of text files to an S3 directory and one of the files is empty (0 bytes). The sc.wholeTextFiles method stack traces. > java.lang.ArrayIndexOutOfBoundsException: 0 > at org.apache.hadoop.mapreduce.lib.input.CombineFileInputFormat$OneFileInfo.(CombineFileInputFormat.java:506) > at org.apache.hadoop.mapreduce.lib.input.CombineFileInputFormat.getMoreSplits(CombineFileInputFormat.java:285) > at org.apache.hadoop.mapreduce.lib.input.CombineFileInputFormat.getSplits(CombineFileInputFormat.java:245) > at org.apache.spark.rdd.WholeTextFileRDD.getPartitions(NewHadoopRDD.scala:303) > at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:239) > at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:237) > at scala.Option.getOrElse(Option.scala:120) > at org.apache.spark.rdd.RDD.partitions(RDD.scala:237) > at org.apache.spark.SparkContext.runJob(SparkContext.scala:1922) > at org.apache.spark.rdd.RDD$$anonfun$collect$1.apply(RDD.scala:905) > at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:147) > at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:108) > at org.apache.spark.rdd.RDD.withScope(RDD.scala:306) > at org.apache.spark.rdd.RDD.collect(RDD.scala:904) > {quote} > It looks like this has been a longstanding issue: > * http://apache-spark-user-list.1001560.n3.nabble.com/pyspark-wholeTextFiles-error-td8872.html > * https://stackoverflow.com/questions/31051107/read-multiple-files-from-a-directory-using-spark > * https://forums.databricks.com/questions/1799/arrayindexoutofboundsexception-with-wholetextfiles.html -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org For additional commands, e-mail: issues-help@spark.apache.org