Skip to content

Commit

Permalink
Fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Harshil Goel committed Mar 18, 2024
1 parent f7e5275 commit 5e66d7b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 27 deletions.
2 changes: 1 addition & 1 deletion query/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func applySub(a, b, c *types.Val) error {
case FLOAT:
c.Value = a.Value.(float64) - b.Value.(float64)
case VFLOAT:
// When adding vectors of floats, we add then item-wise
// When subtracting vectors of floats, we add then item-wise
// so that c.Value[i] = a.Value[i] - b.Value[i] for all i
// in range. If lengths of a and b are different, we treat
// this as an error.
Expand Down
4 changes: 2 additions & 2 deletions query/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,8 @@ func populateCluster() {

setSchema(testSchema)
err := addTriplesToCluster(`
<1> <vectorNonIndex> "[1.0, 1.0, 2.0, 2.0]" .
<2> <vectorNonIndex> "[2.0, 1.0, 2.0, 2.0]" .
<1> <vectorNonIndex> "[1.0, 1.0, 2.0, 2.0]" .
<2> <vectorNonIndex> "[2.0, 1.0, 2.0, 2.0]" .
<1> <name> "Michonne" .
<2> <name> "King Lear" .
<3> <name> "Margaret" .
Expand Down
28 changes: 4 additions & 24 deletions query/query0_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,38 +48,18 @@ func TestGetVector(t *testing.T) {
"data": {
"me": [
{
"vectorNonIndex": [
1,
1,
2,
2
]
"vectorNonIndex": [1,1,2,2]
},
{
"vectorNonIndex": [
2,
1,
2,
2
]
"vectorNonIndex": [2,1,2,2]
}
],
"aggregation": [
{
"avg(val(a))": [
1.5,
1,
2,
2
]
"avg(val(a))": [1.5,1,2,2]
},
{
"sum(val(a))": [
3,
2,
4,
4
]
"sum(val(a))": [3,2,4,4]
}
]
}
Expand Down
1 change: 1 addition & 0 deletions types/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import (
// floatCommaList := ([whitespace] "," [whitespace] float32Val)+
// float32Val := < a string rep of a float32 value >
func ParseVFloat(s string) ([]float32, error) {
// TODO Check if this can be done using lexer
s = strings.ReplaceAll(s, "\n", " ")
s = strings.ReplaceAll(s, "\t", " ")
s = strings.TrimSpace(s)
Expand Down

0 comments on commit 5e66d7b

Please sign in to comment.