-
-
Notifications
You must be signed in to change notification settings - Fork 584
implement spatial indexes #5164
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
Conversation
…/dolt into james/spatial-index-test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good, some remaining work to clean this up, then ship it
| Tags []uint64 `noms:"tags" json:"tags"` | ||
| Comment string `noms:"comment" json:"comment"` | ||
| Unique bool `noms:"unique" json:"unique"` | ||
| Spatial bool `noms:"spatial,omitempty" json:"spatial,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should revert these changes, we don't support spatial indexes in the old format. you should also add some tests to confirm this
| return &multipointType{sqlType.(gmstypes.MultiPointType)}, nil | ||
| case gmstypes.MultiLineStringType{}.String(): | ||
| return &multilinestringType{}, nil | ||
| return &multilinestringType{sqlType.(gmstypes.MultiLineStringType)}, nil | ||
| case gmstypes.MultiPolygonType{}.String(): | ||
| return &multipolygonType{}, nil | ||
| return &multipolygonType{sqlType.(gmstypes.MultiPolygonType)}, nil | ||
| case gmstypes.GeomCollType{}.String(): | ||
| return &geomcollType{}, nil | ||
| return &geomcollType{sqlType.(gmstypes.GeomCollType)}, nil | ||
| case gmstypes.GeometryType{}.String(): | ||
| return &geometryType{sqlGeometryType: sqlType.(gmstypes.GeometryType)}, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this change for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is something I should've implemented when I was originally implementing MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection. When defining columns over these types, we're able to specify a default SRID, and sqlType is what remembers the columns user defined SRID.
Example: create table t (p point srid 0)
Having a SRID defined is required for Spatial Indexes to work.
| // TODO: the descriptors in the primary key are different | ||
| // than the ones in the secondary key; this test assumes | ||
| // they're the same | ||
| if len(def.PrefixLengths()) > 0 || def.IsSpatial() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implement the logic to validate both of these speacial case indexes, rather than just skipping them. otherwise you're eroding the value of this validation
Changes:
DOLT_ENABLE_SPATIAL_INDEXCompanion PR: dolthub/go-mysql-server#1558
Note: prepared test that I changed here had a column anmed
commit, which got confused withto_commitin the diff #5188TODOs