Return-Path: X-Original-To: apmail-hive-issues-archive@minotaur.apache.org Delivered-To: apmail-hive-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 57A0218117 for ; Thu, 21 May 2015 18:22:17 +0000 (UTC) Received: (qmail 58283 invoked by uid 500); 21 May 2015 18:22:17 -0000 Delivered-To: apmail-hive-issues-archive@hive.apache.org Received: (qmail 58261 invoked by uid 500); 21 May 2015 18:22:17 -0000 Mailing-List: contact issues-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list issues@hive.apache.org Received: (qmail 58251 invoked by uid 99); 21 May 2015 18:22:17 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 May 2015 18:22:17 +0000 Date: Thu, 21 May 2015 18:22:17 +0000 (UTC) From: "Hive QA (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-10787) MatchPath misses the last matched row from the final result set 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/HIVE-10787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14554796#comment-14554796 ] Hive QA commented on HIVE-10787: -------------------------------- {color:green}Overall{color}: +1 all checks pass Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12734579/HIVE-10787.1.patch {color:green}SUCCESS:{color} +1 8967 tests passed Test results: http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-TRUNK-Build/3988/testReport Console output: http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-TRUNK-Build/3988/console Test logs: http://ec2-174-129-184-35.compute-1.amazonaws.com/logs/PreCommit-HIVE-TRUNK-Build-3988/ Messages: {noformat} Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase {noformat} This message is automatically generated. ATTACHMENT ID: 12734579 - PreCommit-HIVE-TRUNK-Build > MatchPath misses the last matched row from the final result set > --------------------------------------------------------------- > > Key: HIVE-10787 > URL: https://issues.apache.org/jira/browse/HIVE-10787 > Project: Hive > Issue Type: Bug > Components: UDF > Affects Versions: 1.2.0 > Reporter: Mohammad Kamrul Islam > Assignee: Mohammad Kamrul Islam > Attachments: HIVE-10787.1.patch > > > For example, if you have a STAR(*) pattern at the end, the current code misses the last row from the final result. For example, if I have pattern like (LATE.EARLY*), the matched rows are : > 1. LATE > 2. EARLY > In the current implementation, the final 'tpath' missed the last "EARLY" and returns only LATE . Ideally it should return LATE and EARLY. > The following code snippets shows the bug. > {noformat} > 0. SymbolFunctionResult rowResult = symbolFn.match(row, pItr); > 1. while (rowResult.matches && pItr.hasNext()) > 2. { > 3. row = pItr.next(); > 4. rowResult = symbolFn.match(row, pItr); > 5. } > 6. > 7. result.nextRow = pItr.getIndex() - 1; > {noformat} > Line 7 of the code always moves the row index by one. If ,in some cases, loop (line 1) is never executed (due to pItr.hasNext() being 'false'), the code still moves the row pointer back by one. Although the line 0 found the first match and the iterator reaches to the end. > I'm uploading a patch which I already tested. > -- This message was sent by Atlassian JIRA (v6.3.4#6332)