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

Inconsistent query results

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • bug-backlog
    • 5.0.0
    • secondary-index
    • None
    • Untriaged
    • No

    Description

      Following word count query returns inconsistent result with Spock.

      Same inconsistent results are observed with 4.6 equivalent query (with pure sub-query, not subquery expression) on spock build. This 4.6 query gives consistent results (as in run2)  in the 4.6 release.

      Also, note that I only get these two variants of results and not any other 3rd variant.

      You may have to rerun the query 5 times or so to see the inconsistent results.

       

      spock version using subquery expr (Build: 2031, on Mac 10.12.3 (Sierra)):

      ========================================================

      SELECT w, cnt
      FROM ARRAY split FOR i IN (SELECT raw name
      FROM `travel-sample`
      WHERE type = "hotel") END AS words
      UNNEST words w
      GROUP BY w LETTING cnt = COUNT(w)
      ORDER BY cnt DESC;

       

      4.6 version:

      ========

      SELECT w, cnt
      FROM (SELECT raw n1
      FROM `travel-sample` t
      UNNEST split(t.name) n1
      WHERE t.type = "hotel") AS w
      GROUP BY w LETTING cnt = COUNT(w)
      ORDER BY cnt DESC

      LIMIT 10;

       

      Run1 results:

      ===========

      [
      {
      "cnt": 273,
      "w": "Hotel"
      },
      {
      "cnt": 106,
      "w": "Inn"
      },
      {
      "cnt": 78,
      "w": "The"
      },
      {
      "cnt": 48,
      "w": "House"
      },
      {
      "cnt": 31,
      "w": "Hostel"
      },
      {
      "cnt": 27,
      "w": "Birmingham"
      },
      {
      "cnt": 25,
      "w": "Holiday"
      },

       

      Run2 results (obtained with 4.6):

      =========================

      [
      {
      "cnt": 315,
      "w": "Hotel"
      },
      {
      "cnt": 114,
      "w": "Inn"
      },
      {
      "cnt": 95,
      "w": "The"
      },
      {
      "cnt": 51,
      "w": "House"
      },
      {
      "cnt": 38,
      "w": "Hostel"
      },
      {
      "cnt": 28,
      "w": "Birmingham"
      },
      {
      "cnt": 27,
      "w": "Holiday"
      },

       

      Attachments

        Issue Links

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

          Activity

            People

              prathibha Prathibha Bisarahalli (Inactive)
              Prasad.Varakur Prasad Varakur
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty