Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(query): Support for between func with count at root #6556

Merged
merged 14 commits into from
Sep 24, 2020

Conversation

ashish-goswami
Copy link
Contributor

@ashish-goswami ashish-goswami commented Sep 22, 2020


This change is Reviewable

Docs Preview: Dgraph Preview

illegal = count <= 0
illegal = countl <= 0
case "between":
illegal = countl <= 0 || counth <= 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another check could be countl > counth

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not returning any error in case of improper bounds. Returned response would be empty.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should just check that case here as we are already checking other illegal cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. But the point is not to return error from here, to have between behaviour consistent.

return err
}
if cp.fn == between && int64(k.Count) > counth {
break
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we will continue here to the next item and not break, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to break here as soon as we cross the upper bound in case of between.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it because all future keys count will be higher. (i.e keys are sorted?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes.

Base automatically changed from ashish/between to master September 24, 2020 22:24
@ashish-goswami ashish-goswami merged commit 7bf6168 into master Sep 24, 2020
@ashish-goswami ashish-goswami deleted the ashish/between-count branch September 24, 2020 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants