Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1404

Implement FILTER on aggregate functions in Interpreter

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.11.0
    • Component/s: core
    • Labels:
      None

      Description

      BindableAggregate doesn't properly filter aggregates like SUM(cnt) FILTER(WHERE foo = 'bar'). It seems to be ignoring the filter completely.

        Activity

        Hide
        julianhyde Julian Hyde added a comment - - edited

        Agreed. Such queries are currently giving the wrong results.

        To fix it, I plan to implement the FILTER (WHERE condition) clause (i.e. observe AggregateCall.filterArg) in AggregateNode (i.e. the Aggregate relational operator as implemented inside the Interpreter) and this will also fix it for BindableAggregate.

        Show
        julianhyde Julian Hyde added a comment - - edited Agreed. Such queries are currently giving the wrong results. To fix it, I plan to implement the FILTER (WHERE condition) clause (i.e. observe AggregateCall.filterArg ) in AggregateNode (i.e. the Aggregate relational operator as implemented inside the Interpreter ) and this will also fix it for BindableAggregate .
        Hide
        julianhyde Julian Hyde added a comment -

        I have posted a preview to https://github.com/julianhyde/calcite/commit/c49b6ffd32ea2dd0abd44455309883f5b10b008b. I will merge to master after 1.10 release.

        Show
        julianhyde Julian Hyde added a comment - I have posted a preview to https://github.com/julianhyde/calcite/commit/c49b6ffd32ea2dd0abd44455309883f5b10b008b . I will merge to master after 1.10 release.
        Show
        julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/92b3d381 .
        Hide
        julianhyde Julian Hyde added a comment -

        Resolved in release 1.11.0 (2017-01-11).

        Show
        julianhyde Julian Hyde added a comment - Resolved in release 1.11.0 (2017-01-11).

          People

          • Assignee:
            julianhyde Julian Hyde
            Reporter:
            gian Gian Merlino
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development