Return-Path: X-Original-To: apmail-hadoop-mapreduce-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-mapreduce-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 A361818F8E for ; Tue, 5 Jan 2016 14:06:40 +0000 (UTC) Received: (qmail 18384 invoked by uid 500); 5 Jan 2016 14:06:40 -0000 Delivered-To: apmail-hadoop-mapreduce-issues-archive@hadoop.apache.org Received: (qmail 18282 invoked by uid 500); 5 Jan 2016 14:06:40 -0000 Mailing-List: contact mapreduce-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mapreduce-issues@hadoop.apache.org Delivered-To: mailing list mapreduce-issues@hadoop.apache.org Received: (qmail 18267 invoked by uid 99); 5 Jan 2016 14:06:39 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jan 2016 14:06:39 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id C71D22C1F56 for ; Tue, 5 Jan 2016 14:06:39 +0000 (UTC) Date: Tue, 5 Jan 2016 14:06:39 +0000 (UTC) From: "Jason Lowe (JIRA)" To: mapreduce-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MAPREDUCE-6598) LineReader enhencement to support text records contains "\n" 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/MAPREDUCE-6598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15083086#comment-15083086 ] Jason Lowe commented on MAPREDUCE-6598: --------------------------------------- LineReader already supports a custom record delimiter. There are a number of constructors that take a byte array specifying the record delimiter bytes. This in turn is also supported by LineRecordReader which internally uses LineReader. > LineReader enhencement to support text records contains "\n" > ------------------------------------------------------------ > > Key: MAPREDUCE-6598 > URL: https://issues.apache.org/jira/browse/MAPREDUCE-6598 > Project: Hadoop Map/Reduce > Issue Type: Improvement > Components: mrv2 > Affects Versions: 2.6.0 > Environment: RHEL 7, Spark 1.3.1, Hadoop 2.6.0 > Reporter: cloudyarea > Priority: Minor > > We have billions of XML message records stored on text files need to be parsed parallel by Spark. By default, Spark open a Hadoop text file using LineReader which provides a single line of text as a record. > The XML messages contains "\n" and I believe it is a common scenario - many users have cross-line records. Currently, the solution is to the extend the interface RecordReader. > To reduce the repeat work, I wrote a class named MessageRecordReader to extend the interface RecordReader, user can set a string as record delimiter, then MessageRecordReader provides a multiple line record to user. > I would like to contribute the code to community. Please let me know if you are interested in this simple but useful implementation. > Thank you very much and happy new year! -- This message was sent by Atlassian JIRA (v6.3.4#6332)