Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-63024

Nested aggregates are not allowed.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 7.6.4
    • 7.6.2, 7.6.1
    • query
    • Untriaged
    • 0
    • Yes

    Description

       

      UPSERT INTO default VALUES("k01", {"cid": "c01", "status":"active", "pid": "p01"});
      CREATE INDEX ix11 ON default(cid, status, pid);
      SELECT a.*
      FROM default AS a
      LEFT JOIN (SELECT b.pid, COUNT(1) AS cnt
                 FROM default AS b
                 WHERE b.cid > "c01" AND b.status IN ['active']
                 GROUP BY b.pid) AS m USE NL
      ON m.pid = a.cid
      WHERE a.cid IS NOT NULL;
      

       

      "errors": [
              {
                  "code": 5370,
                  "msg": "Unable to run subquery - cause: Nested aggregates are not allowed."
              },
              {
                  "code": 5010,
                  "msg": "Error evaluating ExpressionScan",
                  "reason": {
                      "_level": "exception",
                      "caller": "context:1154",
                      "code": 5370,
                      "icause": "Nested aggregates are not allowed.",
                      "key": "execution.subquery.build",
                      "message": "Unable to run subquery"
                  }
              }
          ],

      Hash JOIN works

      Attachments

        Activity

          People

            pierre.regazzoni Pierre Regazzoni
            Sitaram.Vemulapalli Sitaram Vemulapalli
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                PagerDuty