Skip to content

sort result different by orderasc or not, the count only 1000 by orderasc #2558

@JustinRong

Description

@JustinRong

Produce:

  1. prepare data

data.js

const fs = require('fs');

const rdf = (i) => {
    return `_:x${i} <price> "1.5${i}" . #`;
}

const rdfs = (n) => {
    for (var i = 0; i < n; i++) {
        console.log(rdf(i))
    }
}

rdfs(process.argv[2])

// node data.js 1 > 1.rdf
// node data.js 1000 > 1000.rdf

  1. load data.
    first, load 1000 data.
    dgraph live -r 1000.rdf
    check the result with query:
{
  A (func: has(price), orderdesc: <price>){
count(uid)
}
B(func: has(price)){
count(uid)
}
}

the result is

"data": {
    "A": [
      {
        "count": 1000
      }
    ],
    "B": [
      {
        "count": 1000
      }
    ]

From now on , It's all ok.

then , load 1 row.
dgraph live -r 1.rdf

re query it

{
  A (func: has(price), orderdesc: <price>){
count(uid)
}
B(func: has(price)){
count(uid)
}
}

the result is :

"data": {
    "A": [
      {
        "count": 1000
      }
    ],
    "B": [
      {
        "count": 1001
      }
    ]
  },

1000 != 1001

Dgraph version Info:

Dgraph version   : v1.0.7
Commit SHA-1     : f1803442
Commit timestamp : 2018-08-10 13:00:21 -0700
Branch           : HEAD

For Dgraph official documentation, visit https://docs.dgraph.io.
For discussions about Dgraph     , visit https://discuss.dgraph.io.
To say hi to the community       , visit https://dgraph.slack.com.

Licensed under Apache 2.0 + Commons Clause. Copyright 2015-2018 Dgraph Labs, Inc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions