Ordering null values inconsistent with N1QL expectations

Description

https://github.com/couchbase/couchbase-lite-core/issues/762

Given the following query:

 

{{SELECT fl_result(fl_value(_doc.body, 'shipped-on')) FROM kv_default AS _doc WHERE (fl_value(_doc.body, 'test_id') = 'select_func') AND (_doc.flags & 1 = 0) ORDER BY fl_value(_doc.body, 'shipped-on')

{"ORDER_BY":[[".shipped-on"]],"WHAT":[[".shipped-on"]],"WHERE":["=",[".test_id"],"select_func"]}}}

The results should be entries with missing shipped-on, null shipped-on, and then values, but the actual result is missing shipped-on, values, null shipped-on.

Activity

Show:

Jianmin Zhao April 1, 2021 at 4:43 PM

We pass the computation of ordering to SQLite. First, SQLite does not have the notion of compound objects such as array and dictionary. Second, NULL in N1QL/Lite does not have any special meaning to SQLite as far as ordering is concerned.

We currently don't have the plan to accommodate them in the query tool.

Won't Do
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Labels

Story Points

Components

Fix versions

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created August 3, 2019 at 5:05 AM
Updated April 6, 2021 at 6:35 PM
Resolved April 1, 2021 at 4:43 PM
Instabug