Uploaded image for project: 'Apache AsterixDB'
  1. Apache AsterixDB
  2. ASTERIXDB-2696

Incorrect result with nested subplans

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.9.4.1
    • 0.9.7
    • COMP - Compiler
    • None

    Description

      The following query returns wrong result:

      from [
         { "a": 1, "b": [ 10, 20, 30] },
         { "a": 1, "b": [ 40, 50, 60] },
         { "a": 1, "b": [ 70, 80, 90] },
         { "a": 2, "b": [ 100, 200, 300] },
         { "a": 2, "b": [ 400, 500, 600] },
         { "a": 2, "b": [ 700, 800, 900] }
      ] t
      group by a
      select a, sum( case when some x in b satisfies x >= 50 then 1 else 0 end) as s;
      

      Current result:

      { "a": 1, "s": 1 }
      { "a": 2, "s": 1 }
      

      Correct result should be:

      { "a": 1, "s": 2 }
      { "a": 2, "s": 3 }
      

      Attachments

        Activity

          People

            dlychagin-cb Dmitry Lychagin
            dlychagin-cb Dmitry Lychagin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: