Hive
  1. Hive
  2. HIVE-6264

Unbalanced number of HiveParser msgs.push/msgs.pop calls when doing lookahead

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.13.0
    • Component/s: None
    • Labels:
      None

      Description

      HiveParser pushes/pops messages describing the current parse rule like so:

      joinSource
      @init { gParent.msgs.push("join source"); }
      @after { gParent.msgs.pop(); }
      ...
      

      The ANTLR generated code for the init/after actions looks like this:

               gParent.msgs.push("join source"); 
      ...
                  if ( state.backtracking==0 ) { gParent.msgs.pop(); }
      

      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.

      1. HIVE-6264.1.patch
        68 kB
        Jason Dere
      2. HIVE-6264.2.patch
        68 kB
        Jason Dere
      3. HIVE-6264.3.patch
        68 kB
        Jason Dere
      4. HIVE-6264.4.patch
        68 kB
        Jason Dere

        Activity

        Jason Dere created issue -
        Jason Dere made changes -
        Field Original Value New Value
        Attachment HIVE-6264.1.patch [ 12624402 ]
        Jason Dere made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Jason Dere made changes -
        Attachment HIVE-6264.2.patch [ 12624985 ]
        Jason Dere made changes -
        Attachment HIVE-6264.3.patch [ 12625625 ]
        Jason Dere made changes -
        Attachment HIVE-6264.4.patch [ 12625831 ]
        Harish Butani made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ashutosh Chauhan made changes -
        Fix Version/s 0.13.0 [ 12324986 ]

          People

          • Assignee:
            Jason Dere
            Reporter:
            Jason Dere
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development