-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
Fixed relevancy ordering for Full-Text #1957
Conversation
This might be an efficient way to implement the table column requirement for |
a398c2d
to
35f5bbb
Compare
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.
I think this is the right idea. The fromScope cols are the input deps you want. But my first reaction is that this will panic for any queries that use projection pruning. I see that you disable the projection pruning rule for match expressions, so it is a smaller subset of queries will panic -- aggregations and windows. So either 1) we disable aggregation/window mixing with MA, 2) we ship and cut a ticket expecting someone to hit this panic soon, 3) you use the scope extraCols to register MA dependencies and embed those expressions in MatchAgainst for index fixup/execution reference. The projection pruning guard rail is probably unnecessary after (3).
> ALTER TABLE test ADD COLUMN extracol2 INT DEFAULT 7;
> SELECT pk, count(pk), MATCH(doc) AGAINST('aaaa') as relevancy FROM test ORDER BY relevancy DESC;
panic: runtime error: slice bounds out of range [:4] with capacity 3 [recovered]
panic: runtime error: slice bounds out of range [:4] with capacity 3
goroutine 10 [running]:
testing.tRunner.func1.2({0x1f72700, 0xc00004aa38})
/usr/local/go/src/testing/testing.go:1545 +0x238
testing.tRunner.func1()
/usr/local/go/src/testing/testing.go:1548 +0x397
panic({0x1f72700?, 0xc00004aa38?})
/usr/local/go/src/runtime/panic.go:914 +0x21f
github.com/dolthub/go-mysql-server/sql/expression.(*MatchAgainst).Eval(0xc0004deca8?, 0x3?, {0xc0004f1ad0?, 0x2?, 0xc00065a500?})
/Users/max-hoffman/go/src/github.com/dolthub/go-mysql-server/sql/expression/matchagainst.go:87 +0x165
github.com/dolthub/go-mysql-server/sql/expression.(*Alias).Eval(0xc00007d7c0?, 0xc00026fb08?, {0xc0004f1ad0?, 0x3?, 0x1e6f8a0?})
...
35f5bbb
to
67af087
Compare
67af087
to
7e88fc4
Compare
A quick stab at |
Fixes dolthub/dolt#6530