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

[BP to 7.1.6-MP1 & 7.2.3-MP1]UDF returns Nested aggregates are not allowed.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Major
    • 7.1.7
    • 7.6.0, 7.1.4, 7.2.1, 7.1.5
    • query
    • Untriaged
    • 0
    • Unknown

    Description

      UPSERT INTO default VALUES("k01", {"cid": "c01", "status":"active", "pid": "p01"});
       CREATE INDEX ix1 ON default(cid, status, pid);
      CREATE OR REPLACE FUNCTION udf1(pObj, pcustId) {(
      WITH pm as ( Select * from OBJECT_INNER_PAIRS(pObj) as m)
      SELECT pid, count(1) AS numRows
             FROM default
             WHERE cid = pcustId AND status IN ['active']
             GROUP BY pid
      )};
      SELECT a.* FROM udf1({"xx":"xx"}, "c01") AS a;
      prepare p2 from SELECT a.* FROM udf1({"xx":"xx"}, "c07") AS a;
      prepare p3 from SELECT a.* FROM udf1({"xx":"xx"}, "c01") AS a;
      execute p3;
      execute p2;
      execute p3;
      execute p2;
      execute p3;
      execute p2;

      Note: multiple prepare statements alternative execution. This intermittent. repeat pattern of execution in loop

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              ajay.bhullar Ajay Bhullar
              Sitaram.Vemulapalli Sitaram Vemulapalli
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty