Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 639FC200B48 for ; Mon, 18 Jul 2016 20:20:23 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 624D4160A88; Mon, 18 Jul 2016 18:20:23 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B8FFB160A65 for ; Mon, 18 Jul 2016 20:20:22 +0200 (CEST) Received: (qmail 42627 invoked by uid 500); 18 Jul 2016 18:20:21 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 42323 invoked by uid 99); 18 Jul 2016 18:20:21 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Jul 2016 18:20:21 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 143262C0373 for ; Mon, 18 Jul 2016 18:20:21 +0000 (UTC) Date: Mon, 18 Jul 2016 18:20:21 +0000 (UTC) From: "Akira Ajisaka (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HADOOP-13192) org.apache.hadoop.util.LineReader cannot handle multibyte delimiters correctly MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 18 Jul 2016 18:20:23 -0000 [ https://issues.apache.org/jira/browse/HADOOP-13192?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Akira Ajisaka updated HADOOP-13192: ----------------------------------- Attachment: HADOOP-13192.final.patch Attaching a patch for the commit. (Generated by {{git diff d0162f2040a4d98fbac51527dfc9447888cb32ab fc6b50cc574e144fd314dea6c11987c6a384bfa6}}) Thanks [~haitao-tony]! > org.apache.hadoop.util.LineReader cannot handle multibyte delimiters correctly > ------------------------------------------------------------------------------ > > Key: HADOOP-13192 > URL: https://issues.apache.org/jira/browse/HADOOP-13192 > Project: Hadoop Common > Issue Type: Bug > Components: util > Affects Versions: 2.6.2 > Reporter: binde > Assignee: binde > Priority: Critical > Fix For: 2.7.3 > > Attachments: 0001-HADOOP-13192-org.apache.hadoop.util.LineReader-match.patch, 0002-fix-bug-hadoop-1392-add-test-case-for-LineReader.patch, HADOOP-13192.final.patch > > Original Estimate: 5m > Remaining Estimate: 5m > > org.apache.hadoop.util.LineReader.readCustomLine() has a bug, > when line is aaaabccc, recordDelimiter is aaab, the result should be a,ccc, > show the code on line 310: > for (; bufferPosn < bufferLength; ++bufferPosn) { > if (buffer[bufferPosn] == recordDelimiterBytes[delPosn]) { > delPosn++; > if (delPosn >= recordDelimiterBytes.length) { > bufferPosn++; > break; > } > } else if (delPosn != 0) { > bufferPosn--; > delPosn = 0; > } > } > shoud be : > for (; bufferPosn < bufferLength; ++bufferPosn) { > if (buffer[bufferPosn] == recordDelimiterBytes[delPosn]) { > delPosn++; > if (delPosn >= recordDelimiterBytes.length) { > bufferPosn++; > break; > } > } else if (delPosn != 0) { > // ------------- change here ------------- start ---- > bufferPosn -= delPosn; > // ------------- change here ------------- end ---- > > delPosn = 0; > } > } -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-issues-help@hadoop.apache.org