Skip to content

Commit

Permalink
Fix grammar and other minor edits
Browse files Browse the repository at this point in the history
Co-authored-by: Asdine El Hrychy <[email protected]>
  • Loading branch information
jhchabran and asdine committed May 1, 2021
1 parent 565ca8e commit 56b18ab
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmd/genji/dbutil/dump_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func TestDump(t *testing.T) {
require.NoError(t, err)
writeToBuf(q + "\n")

q = fmt.Sprintf(`CREATE INDEX idx_%s_b_c ON %s (a);`, table, table)
q = fmt.Sprintf(`CREATE INDEX idx_%s_b_c ON %s (b, c);`, table, table)
err = db.Exec(q)
require.NoError(t, err)
writeToBuf(q + "\n")
Expand Down
2 changes: 1 addition & 1 deletion database/catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ OUTER:
for _, path := range info.Paths {
for _, fc := range ti.FieldConstraints {
if fc.Path.IsEqual(path) {
// a constraint may or may enforce a type
// a constraint may or may not enforce a type
if fc.Type != 0 {
info.Types = append(info.Types, document.ValueType(fc.Type))
}
Expand Down
2 changes: 1 addition & 1 deletion database/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ type IndexInfo struct {
// If set to true, values will be associated with at most one key. False by default.
Unique bool

// If set, the index is typed and only accepts values of those types .
// If set, the index is typed and only accepts values of those types.
Types []document.ValueType
}

Expand Down
2 changes: 1 addition & 1 deletion database/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (idx *Index) IsComposite() bool {
return len(idx.Info.Types) > 1
}

// Arity returns how many values the indexed is operating on.
// Arity returns how many values the index is operating on.
// For example, an index created with `CREATE INDEX idx_a_b ON foo (a, b)` has an arity of 2.
func (idx *Index) Arity() int {
return len(idx.Info.Types)
Expand Down
3 changes: 2 additions & 1 deletion planner/optimizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,8 @@ outer:
// - given a query SELECT ... WHERE a = 1 AND b > 2
// - the paths a and b are contiguous in the index definition, this index can be used
// - given a query SELECT ... WHERE a = 1 AND c > 2
// - the paths a and c are not contiguous in the index definition, this index cannot be used
// - the paths a and c are not contiguous in the index definition, this index cannot be used for both values
// but it will be used with a and c with a normal filter node.
var fops []*stream.FilterOperator
var usableFilterNodes []*filterNode
contiguous := true
Expand Down
3 changes: 1 addition & 2 deletions query/reindex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"testing"

"github.com/genjidb/genji"
"github.com/genjidb/genji/document"
"github.com/stretchr/testify/require"
)

Expand Down Expand Up @@ -82,7 +81,7 @@ func TestReIndex(t *testing.T) {
}

i := 0
err = idx.AscendGreaterOrEqual([]document.Value{document.Value{}}, func(val []byte, key []byte) error {
err = idx.AscendGreaterOrEqual(nil, func(val []byte, key []byte) error {
i++
return nil
})
Expand Down

0 comments on commit 56b18ab

Please sign in to comment.