Return-Path: X-Original-To: apmail-crunch-dev-archive@www.apache.org Delivered-To: apmail-crunch-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2B5A210660 for ; Sun, 23 Mar 2014 19:42:50 +0000 (UTC) Received: (qmail 30873 invoked by uid 500); 23 Mar 2014 19:42:49 -0000 Delivered-To: apmail-crunch-dev-archive@crunch.apache.org Received: (qmail 30099 invoked by uid 500); 23 Mar 2014 19:42:46 -0000 Mailing-List: contact dev-help@crunch.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@crunch.apache.org Delivered-To: mailing list dev@crunch.apache.org Received: (qmail 29541 invoked by uid 500); 23 Mar 2014 19:42:43 -0000 Delivered-To: apmail-incubator-crunch-dev@incubator.apache.org Received: (qmail 29535 invoked by uid 99); 23 Mar 2014 19:42:43 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 23 Mar 2014 19:42:43 +0000 Date: Sun, 23 Mar 2014 19:42:43 +0000 (UTC) From: "Gabriel Reid (JIRA)" To: crunch-dev@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (CRUNCH-369) Crunch doesn't use custom getSplits functions of FileInputFormat subclasses 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/CRUNCH-369?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gabriel Reid resolved CRUNCH-369. --------------------------------- Resolution: Duplicate > Crunch doesn't use custom getSplits functions of FileInputFormat subclasses > --------------------------------------------------------------------------- > > Key: CRUNCH-369 > URL: https://issues.apache.org/jira/browse/CRUNCH-369 > Project: Crunch > Issue Type: Bug > Components: IO > Affects Versions: 0.9.0 > Reporter: Jeremy Lewi > Priority: Minor > > Suppose I create a source for a custom InputFormat which is a subclass of FileInputFormat; e.g. > TableSource source = From.formattedFile( > inputFile, FastQInputFormatNew.class, LongWritable.class, > FastQWritable.class); > where FastQInputFormat is a subclass of FileInputFormat. > This won't work as expected because by default CrunchInputFormat.getSplits will end up using CrunchCombineFileInputFormat to split the file. This doesn't work because my custom FIleInputFormat uses a custom file splitter. > I can work around this by explicitly disabling the combining: e.g > source.inputConf(RuntimeParameters.DISABLE_COMBINE_FILE, Boolean.TRUE.toString()); > but this doesn't strike me as the best solution. If I tell Crunch to use a custom InputFormat I shouldn't have to specify a second config option in order to tell Crunch to respect the getSplits function in my custom InputFormat. > I think CrunchInputFormat.getSplits should check that the format class exactly matches FileInputFormat; i.e. it isn't a subclass. For subclasses Crunch should use the getsplits function in the custom InputFormat class. I think changing the check to the following might work > if (format.getClass().equals(FileInputFormat.class) && > !conf.getBoolean(RuntimeParameters.DISABLE_COMBINE_FILE, true) -- This message was sent by Atlassian JIRA (v6.2#6252)