Uploaded image for project: 'Couchbase Lite'
  1. Couchbase Lite
  2. CBL-1354

finding euclidean distance, square euclidean distance rounding the precision value

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.8.0
    • 3.0
    • .NET
    • Security Level: Public
    • None
    • 5

    Description

      CBL-2.8.0-153
      late seen: It is been failing from last release.
      SG version: 2.7.0-166 or 2.8.0-374
      SG config:
      {
      "SSLCert": "sg_cert.pem",
      "SSLKey": "sg_privkey.pem",
      "adminInterface": "0.0.0.0:4985",
      "compressResponses": false,
      "databases": {
      "db": {
      "allow_conflicts": false,
      "bucket": "travel-sample",
      "delta_sync":

      { "enabled": true }

      ,
      "enable_shared_bucket_access": true,
      "import_docs": true,
      "num_index_replicas": 0,
      "password": "password",
      "server": "http://192.168.33.10:8091",
      "username": "travel-sample"
      }
      },
      "interface": ":4984",
      "logging": {
      "debug":

      { "enabled": true }

      },
      "maxFileDescriptors": 90000,
      "maxIncomingConnections": 0
      }
      }

      --Steps to reproduce:

      1. Create docs with x,y,z coordinates ex: [[3, 6, 10], [34, 23, 4]]
      2. find the euclidean distance, square euclidean distance, and cosine distance
      Expected euclidean distance: 35.86084215408221
      Actual euclidean distance :35.8608421540822

      Expected cosine distance: 0.43620415177230565
      Actual cosine distance :0.436204151772306

      • Github link for the code:

      https://github.com/couchbaselabs/mobile-testkit/blob/master/testsuites/CBLTester/CBL_Functional_tests/TestSetup_FunctionalTests/test_predective_queries.py#L89

      • Pytest Command:
        pytest -s --timeout 1800 --liteserv-version=2.8.0-153 --liteserv-host=localhost --liteserv-port=8080 --delta-sync --xattrs --sg-ssl --no-conflicts --enable-file-logging --sync-gateway-version=2.8.0-373 --mode=cc --server-version=6.5.1-6299 --liteserv-platform=net-uwp --create-db-per-test=cbl-test --junitxml=results/results.xml testsuites/CBLTester/CBL_Functional_tests/TestSetup_FunctionalTests -k "test_predictiveQueries_euclideanCosineDistance[coordinates5-35.86084215408221-1286-0.43620415177230565]"
      • What is the last build this test passed: always failed

      In the logs query looks like below:

       
      20:06:00.746054| [Query]: (XQuery) [Thread Pool Worker (13)] Query encoded as {"WHAT":[["EUCLIDEAN_DISTANCE()",[".abc"],[".def"],2]]}
      20:06:00.746215| [Query]: {Query#4} Compiling JSON query: {"WHAT":[["EUCLIDEAN_DISTANCE()",[".abc"],[".def"],2]]}
      20:06:00.746336| [Query]: {Query#4} Compiled as SELECT fl_result(euclidean_distance(fl_value(_doc.body, 'abc'), fl_value(_doc.body, 'def'), 2)) FROM kv_default AS _doc WHERE (_doc.flags & 1 = 0)
      20:06:00.746532| [Query]: {QueryEnum#5} Created on {Query#4} with 1 rows (18 bytes) in 0.030ms
      20:06:00.746660| [Query]: (QueryResultSet) [Thread Pool Worker (13)] Beginning query enumeration (6000024e43d0)
      20:06:00.747111| [Query]: (QueryResultSet) [Thread Pool Worker (13)] End of query enumeration (6000024e43d0)
      20:06:00.747196| [Query]: {QueryEnum#5} Deleted
      20:06:00.750771| [Query]: (XQuery) [Thread Pool Worker (14)] Query encoded as {"WHAT":[["COSINE_DISTANCE()",[".abc"],[".def"]]]}
      20:06:00.750894| [Query]: {Query#6} Compiling JSON query: {"WHAT":[["COSINE_DISTANCE()",[".abc"],[".def"]]]}
      20:06:00.750993| [Query]: {Query#6} Compiled as SELECT fl_result(cosine_distance(fl_value(_doc.body, 'abc'), fl_value(_doc.body, 'def'))) FROM kv_default AS _doc WHERE (_doc.flags & 1 = 0)
      

      Attachments

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

        Activity

          No work has yet been logged on this issue.

          People

            The Lite The Lite
            manasa.ghanta Manasa Ghanta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty