Return-Path: X-Original-To: apmail-hive-dev-archive@www.apache.org Delivered-To: apmail-hive-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 CD9D110960 for ; Wed, 22 Jan 2014 19:25:41 +0000 (UTC) Received: (qmail 60421 invoked by uid 500); 22 Jan 2014 19:25:26 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 60296 invoked by uid 500); 22 Jan 2014 19:25:24 -0000 Mailing-List: contact dev-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 dev@hive.apache.org Received: (qmail 60181 invoked by uid 500); 22 Jan 2014 19:25:23 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 60106 invoked by uid 99); 22 Jan 2014 19:25:22 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Jan 2014 19:25:22 +0000 Date: Wed, 22 Jan 2014 19:25:22 +0000 (UTC) From: "Jason Dere (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-6264) Unbalanced number of HiveParser msgs.push/msgs.pop calls when doing lookahead 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-6264?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jason Dere updated HIVE-6264: ----------------------------- Attachment: HIVE-6264.1.patch Patch v1. Add new pushMsg()/popMsg() methods in HiveParser which will check state.backtracking. > Unbalanced number of HiveParser msgs.push/msgs.pop calls when doing lookahead > ----------------------------------------------------------------------------- > > Key: HIVE-6264 > URL: https://issues.apache.org/jira/browse/HIVE-6264 > Project: Hive > Issue Type: Bug > Reporter: Jason Dere > Assignee: Jason Dere > Attachments: HIVE-6264.1.patch > > > HiveParser pushes/pops messages describing the current parse rule like so: > {noformat} > joinSource > @init { gParent.msgs.push("join source"); } > @after { gParent.msgs.pop(); } > ... > {noformat} > The ANTLR generated code for the init/after actions looks like this: > {noformat} > gParent.msgs.push("join source"); > ... > if ( state.backtracking==0 ) { gParent.msgs.pop(); } > {noformat} > If we have a parse rule that does some lookahead, the message is always pushed onto the message stack since the init action has no check of state.backtracking. But that message is never popped because the after action does check state.backtracking. As a result there can be a bunch of parser context messages added to the stack which are never taken off. -- This message was sent by Atlassian JIRA (v6.1.5#6160)