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

Fix support for comparison between ID/TYPE bindings and text literals inside HAVING clauses #117

Merged
merged 24 commits into from
Jul 30, 2020

Conversation

rogerlucena
Copy link
Contributor

@rogerlucena rogerlucena commented Jul 15, 2020

Previously, comparisons between ID bindings and text literals inside HAVING clauses (such as below) were not effective:

SELECT ?s, ?predID, ?o
FROM ?family
WHERE {
  ?s ?p ID ?predID ?o
}
HAVING ?predID < "parent_of"^^type:text;

Now, they are fully supported (<, > and =), proceeding as a lexicographical comparison between the ID binding and the text literal that follows.

The same is now supported for bindings created using the TYPE keyword too.

Error handling for comparison expressions were also improved.

bql/semantic/expression.go Show resolved Hide resolved
bql/semantic/expression.go Outdated Show resolved Hide resolved
bql/semantic/expression.go Outdated Show resolved Hide resolved
bql/semantic/expression.go Outdated Show resolved Hide resolved
bql/semantic/expression_test.go Outdated Show resolved Hide resolved
bql/semantic/expression_test.go Outdated Show resolved Hide resolved
bql/planner/planner_test.go Outdated Show resolved Hide resolved
@rogerlucena rogerlucena marked this pull request as draft July 15, 2020 18:22
@rogerlucena rogerlucena force-pushed the fix-having-id branch 2 times, most recently from 3f21963 to 50209b2 Compare July 15, 2020 23:38
bql/semantic/expression.go Outdated Show resolved Hide resolved
bql/semantic/expression.go Outdated Show resolved Hide resolved
bql/semantic/expression.go Outdated Show resolved Hide resolved
bql/semantic/expression.go Outdated Show resolved Hide resolved
bql/semantic/expression.go Outdated Show resolved Hide resolved
docs/bql.md Show resolved Hide resolved
@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

1 similar comment
@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@thiagovas
Copy link
Member

@googlebot I fixed it.

@rogerlucena rogerlucena force-pushed the fix-having-id branch 2 times, most recently from 224846e to 7efe586 Compare July 16, 2020 21:36
@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@rogerlucena rogerlucena force-pushed the fix-having-id branch 3 times, most recently from ead17f6 to 69ca15d Compare July 17, 2020 12:58
@rogerlucena rogerlucena changed the title Fix support for comparison between ID bindings and text literals inside HAVING clauses Fix support for comparison between ID/TYPE bindings and text literals inside HAVING clauses Jul 17, 2020
@rogerlucena rogerlucena marked this pull request as ready for review July 21, 2020 20:38
bql/semantic/expression.go Outdated Show resolved Hide resolved
bql/semantic/expression.go Outdated Show resolved Hide resolved
bql/semantic/expression.go Outdated Show resolved Hide resolved
bql/semantic/expression.go Outdated Show resolved Hide resolved
bql/semantic/expression.go Outdated Show resolved Hide resolved
bql/semantic/expression_test.go Show resolved Hide resolved
bql/semantic/expression_test.go Show resolved Hide resolved
bql/semantic/expression_test.go Show resolved Hide resolved
@rogerlucena rogerlucena force-pushed the fix-having-id branch 2 times, most recently from 8726d36 to 8c55ab9 Compare July 29, 2020 01:34
… compare a ^^type:int64 to a ^^type:float64)
Copy link

@Tati1701 Tati1701 left a comment

Choose a reason for hiding this comment

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

Thanks, Roger! I hope this helps :)

bql/planner/planner_test.go Outdated Show resolved Hide resolved
bql/semantic/expression_test.go Show resolved Hide resolved
@thiagovas thiagovas merged commit bd587e1 into google:master Jul 30, 2020
@rogerlucena rogerlucena deleted the fix-having-id branch July 30, 2020 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants