Skip to content

Commit

Permalink
geo: rebrand geospatial to spatial with minor refactors
Browse files Browse the repository at this point in the history
* Rename geospatial to spatial (for outwards facing docs).
* Replace all (args[d].(*tree.DType)) to tree.MustBeDType(args[d])
* Add tests to ensure all geo builtin info has a capital letter and
  full stop.

Release justification: low risk update to new functionality

Release note (cli change): The `--geo-libs` flag introduced in
v20.2-alphas is renamed to `--spatial-libs`.
  • Loading branch information
otan committed Sep 1, 2020
1 parent 2d5cd11 commit 325ad66
Show file tree
Hide file tree
Showing 11 changed files with 997 additions and 950 deletions.
1,526 changes: 763 additions & 763 deletions docs/generated/sql/functions.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pkg/cli/cliflags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -1093,9 +1093,9 @@ the demo shell.`,
}

GeoLibsDir = FlagInfo{
Name: "geo-libs",
Name: "spatial-libs",
Description: `
The location where all libraries for Geospatial operations is located.`,
The location where all libraries for spatial operations is located.`,
}

Global = FlagInfo{
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/demo.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ func runDemo(cmd *cobra.Command, gen workload.Generator) (err error) {

loc, err := geos.EnsureInit(geos.EnsureInitErrorDisplayPrivate, startCtx.geoLibsDir)
if err != nil {
log.Infof(ctx, "could not initialize GEOS - geospatial functions may not be available: %v", err)
log.Infof(ctx, "could not initialize GEOS - spatial functions may not be available: %v", err)
} else {
log.Infof(ctx, "GEOS loaded from directory %s", loc)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ If problems persist, please see %s.`
// We need to make sure this happens before any queries involving geospatial data is executed.
loc, err := geos.EnsureInit(geos.EnsureInitErrorDisplayPrivate, startCtx.geoLibsDir)
if err != nil {
log.Infof(ctx, "could not initialize GEOS - geospatial functions may not be available: %v", err)
log.Infof(ctx, "could not initialize GEOS - spatial functions may not be available: %v", err)
} else {
log.Infof(ctx, "GEOS loaded from directory %s", loc)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/geoviz/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ func handleLoad(w http.ResponseWriter, r *http.Request) {
var flagGeoLibsDir = flag.String(
"geo_libs",
"/usr/local/lib/cockroach",
"Location where geospatial related libraries can be found.",
"Location where spatial related libraries can be found.",
)

func main() {
flag.Parse()

if _, err := geos.EnsureInit(geos.EnsureInitErrorDisplayPrivate, *flagGeoLibsDir); err != nil {
log.Fatalf("could not initialize GEOS - geospatial functions may not be available: %v", err)
log.Fatalf("could not initialize GEOS - spatial functions may not be available: %v", err)
}

http.HandleFunc("/", handleIndex)
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/opt/invertedidx/inverted_index_expr.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func NewDatumsToInvertedExpr(
evalCtx *tree.EvalContext, colTypes []*types.T, expr tree.TypedExpr, desc *descpb.IndexDescriptor,
) (invertedexpr.DatumsToInvertedExpr, error) {
if geoindex.IsEmptyConfig(&desc.GeoConfig) {
return nil, fmt.Errorf("inverted joins are currently only supported for geospatial indexes")
return nil, fmt.Errorf("inverted joins are currently only supported for spatial indexes")
}

return NewGeoDatumsToInvertedExpr(evalCtx, colTypes, expr, &desc.GeoConfig)
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/sem/builtins/builtins.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const (
categoryDateAndTime = "Date and time"
categoryEnum = "Enum"
categoryGenerator = "Set-returning"
categoryGeospatial = "Geospatial"
categorySpatial = "Spatial"
categoryIDGeneration = "ID generation"
categoryJSON = "JSONB"
categoryMultiTenancy = "Multi-tenancy"
Expand Down
Loading

0 comments on commit 325ad66

Please sign in to comment.