Skip to content

Conversation

@jycor
Copy link
Contributor

@jycor jycor commented Mar 7, 2023

No description provided.

// Assume these are all BinaryExpression with exactly two children
children := e.Children()
if len(children) != 2 {
panic("st function is not a binary expression")
Copy link
Contributor

Choose a reason for hiding this comment

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

best to just error, the function already has an error return type

},
tests: []SpatialIndexPlanTestAssertion{
{
q: "select p from point_tbl where st_within(p, point(0,0))",
Copy link
Contributor

@max-hoffman max-hoffman Mar 8, 2023

Choose a reason for hiding this comment

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

Just confirming, this validates that point_tbl is indexed? If someone breaks this in the future this will error to notify?

Copy link
Contributor

Choose a reason for hiding this comment

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

should we have a test for null point? null value input into filter? can the index be a primary? the is a keyless table, maybe a pk table also? query that returns data?

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, evalSpatialIndexPlanTest should check that the plan produced contains both a Filter and a IndexAccess

https://github.com/dolthub/go-mysql-server/pull/1641/files#diff-c78bcec60f7605673e947656af38792e90f53fdacd97c7def3e2142a41ae581dR352

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can add tests for primary key table and a null point.

Copy link
Contributor

@max-hoffman max-hoffman left a comment

Choose a reason for hiding this comment

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

lgtm, some test suggestions

@jycor jycor merged commit 245be80 into main Mar 8, 2023
@Hydrocharged Hydrocharged deleted the james/within-index branch March 29, 2023 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants