Skip to content

has function with pagination (first) does not return correct count #4282

@danielmai

Description

@danielmai

What version of Dgraph are you using?

master (0259f3d)

I suspect this bug got introduced in #3970.

Have you tried reproducing the issue with the latest release?

does not happen in v1.1.0.

What is the hardware spec (RAM, OS)?

Ubuntu Linux 64 GB

Steps to reproduce the issue (command/config used to run Dgraph).

  1. Run Dgraph cluster with latest master
  2. Load 21-million movie data set
  3. Run a query with has() with first limit for a language string predicate name@en:
{
  q(func: has(name@en), first: 10) {
    count(uid)
  }
}

The query response returns {"count": 7}. If I set first: 100, I get {"count": 96}.

Expected behaviour and actual result.

Since there are >100 name@en edges, I expected the paginated result with first: 10 to return 10 nodes and first: 100 to return 100 nodes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/querylangIssues related to the query language specification and implementation.area/querylang/paginationRelated to pagination: first, offset, etckind/bugSomething is broken.priority/P1Serious issue that requires eventual attention (can wait a bit)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions