Skip to content
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

Implement filter pushdown for SQLite #3337

Closed
wants to merge 86 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
e989702
wip
noisersup Sep 11, 2023
6381038
wip
noisersup Sep 11, 2023
b46a909
wip
noisersup Sep 11, 2023
7d3e0ef
wip
noisersup Sep 11, 2023
f4ef99f
wip
noisersup Sep 11, 2023
8fb0542
ehh
noisersup Sep 11, 2023
9eb8085
fixed!
noisersup Sep 11, 2023
8cc7417
fix
noisersup Sep 12, 2023
4fd0e49
fix comment pushdown
noisersup Sep 12, 2023
a590e63
fix empty key
noisersup Sep 12, 2023
c9a6b05
wip
noisersup Sep 12, 2023
ba33b0d
wip
noisersup Sep 12, 2023
a822d46
wip
noisersup Sep 13, 2023
ee3913e
wip
noisersup Sep 14, 2023
2714c65
subqueries
noisersup Sep 14, 2023
1e1978d
works (kinda)
noisersup Sep 14, 2023
31d49e9
wip
noisersup Sep 14, 2023
fc3ee77
wip
noisersup Sep 14, 2023
f7c4e35
disable dotnotation
noisersup Sep 14, 2023
35908d7
wip
noisersup Sep 14, 2023
13a934d
wip
noisersup Sep 14, 2023
b65ba1f
wip
noisersup Sep 14, 2023
8855c80
wip
noisersup Sep 15, 2023
bf67609
wip
noisersup Sep 18, 2023
8c2bb25
wip
noisersup Sep 18, 2023
c91c0d6
wip
noisersup Sep 18, 2023
c4fb7a8
wip
noisersup Sep 18, 2023
4269731
wip
noisersup Sep 18, 2023
ef46ff8
wip
noisersup Sep 18, 2023
3237d78
wip
noisersup Sep 18, 2023
075ae72
fix float64
noisersup Sep 18, 2023
edbc7ad
fix int64
noisersup Sep 18, 2023
781b209
fix time
noisersup Sep 18, 2023
91e81ea
wip
noisersup Sep 18, 2023
3704d9b
wip
noisersup Sep 18, 2023
fca4ac4
wip
noisersup Sep 18, 2023
b7bdec2
wip
noisersup Sep 18, 2023
6c3ded8
fix??
noisersup Sep 18, 2023
cd8dd8d
fix??
noisersup Sep 18, 2023
9883078
wip
noisersup Sep 18, 2023
733fc96
revert
noisersup Sep 19, 2023
85a96e6
wip
noisersup Sep 19, 2023
d758e4c
wip
noisersup Sep 19, 2023
d13e810
wip
noisersup Sep 19, 2023
18c368f
wip
noisersup Sep 19, 2023
f1eca5f
test
noisersup Sep 19, 2023
0b28825
test2
noisersup Sep 19, 2023
9038ec7
test2
noisersup Sep 19, 2023
72c647e
wip
noisersup Sep 19, 2023
10c4e96
wip
noisersup Sep 19, 2023
0e0821b
wip
noisersup Sep 19, 2023
4092f20
wip
noisersup Sep 20, 2023
f75ad82
comments
noisersup Sep 20, 2023
1335e0a
comments
noisersup Sep 20, 2023
f926c6e
wip
noisersup Sep 20, 2023
d669a21
wip
noisersup Sep 20, 2023
75ce21a
wip
noisersup Sep 20, 2023
88724d2
wip
noisersup Sep 20, 2023
d47f583
wip
noisersup Sep 20, 2023
a766095
wip
noisersup Sep 20, 2023
88c2013
wip
noisersup Sep 20, 2023
9c57de6
lint
noisersup Sep 20, 2023
73bd87c
lint
noisersup Sep 20, 2023
994ca36
lint
noisersup Sep 21, 2023
feec47c
lint
noisersup Sep 21, 2023
d87f4ac
lint
noisersup Sep 21, 2023
9d849c4
wip
noisersup Sep 21, 2023
6c72543
wip
noisersup Sep 21, 2023
5d73126
wip
noisersup Sep 21, 2023
6ce3261
wip
noisersup Sep 21, 2023
fb36c96
apply comments
noisersup Sep 21, 2023
fdac032
Merge branch 'main' into sqlite-pushdown-3235
AlekSi Sep 22, 2023
e019863
lint
noisersup Sep 22, 2023
1ca4e1a
wip
noisersup Sep 22, 2023
0e6394a
fmt
noisersup Sep 22, 2023
4adc3af
wip
noisersup Sep 22, 2023
e007b5e
wip
noisersup Sep 22, 2023
e0c6202
wip
noisersup Sep 22, 2023
f0d58a6
wip
noisersup Sep 25, 2023
19ed317
fix
noisersup Sep 27, 2023
7c82b1b
fix
noisersup Sep 27, 2023
079981b
Merge remote-tracking branch 'upstream/main' into sqlite-pushdown-3235
noisersup Sep 27, 2023
fb1ab57
fix
noisersup Sep 27, 2023
42db962
fix
noisersup Sep 27, 2023
dde7867
Merge remote-tracking branch 'upstream/main' into sqlite-pushdown-3235
noisersup Sep 28, 2023
db49f3e
fix
noisersup Sep 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
wip
  • Loading branch information
noisersup committed Sep 18, 2023
commit 8c2bb25f3f74887c85fad5e8add71cd95ade58ab
41 changes: 22 additions & 19 deletions integration/query_compat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,14 @@ const (
NoPushdown ResultPushdown = 0
PgPushdown ResultPushdown = 1
SQLitePushdown ResultPushdown = 2

AllPushdown ResultPushdown = PgPushdown + SQLitePushdown
)

func (res ResultPushdown) Add(item ResultPushdown) ResultPushdown {
return res + item
}

func (res ResultPushdown) PushdownExpected(t testtb.TB) bool {
switch {
case setup.IsSQLite(t):
Expand All @@ -54,15 +60,14 @@ func (res ResultPushdown) PushdownExpected(t testtb.TB) bool {

// queryCompatTestCase describes query compatibility test case.
type queryCompatTestCase struct {
filter bson.D // required
sort bson.D // defaults to `bson.D{{"_id", 1}}`
optSkip *int64 // defaults to nil to leave unset
limit *int64 // defaults to nil to leave unset
batchSize *int32 // defaults to nil to leave unset
projection bson.D // nil for leaving projection unset
resultType compatTestCaseResultType // defaults to nonEmptyResult
resultPushdown ResultPushdown // defaults to false
resultPushdownSQLite bool // TODO https://github.com/FerretDB/FerretDB/issues/3235
filter bson.D // required
sort bson.D // defaults to `bson.D{{"_id", 1}}`
optSkip *int64 // defaults to nil to leave unset
limit *int64 // defaults to nil to leave unset
batchSize *int32 // defaults to nil to leave unset
projection bson.D // nil for leaving projection unset
resultType compatTestCaseResultType // defaults to nonEmptyResult
resultPushdown ResultPushdown // defaults to false

skipIDCheck bool // skip check collected IDs, use it when no ids returned from query
skip string // skip test for all handlers, must have issue number mentioned
Expand Down Expand Up @@ -228,29 +233,27 @@ func TestQueryCompatFilter(t *testing.T) {
},
"String": {
filter: bson.D{{"v", "foo"}},
resultPushdown: true,
resultPushdown: PgPushdown,
},
"Int32": {
filter: bson.D{{"v", int32(42)}},
resultPushdown: true,
resultPushdown: PgPushdown,
},
"IDString": {
filter: bson.D{{"_id", "string"}},
resultPushdown: true,
resultPushdown: PgPushdown,
},
"IDNilObjectID": {
filter: bson.D{{"_id", primitive.NilObjectID}},
resultPushdown: true,
resultPushdownSQLite: true,
filter: bson.D{{"_id", primitive.NilObjectID}},
resultPushdown: AllPushdown,
},
"IDObjectID": {
filter: bson.D{{"_id", primitive.ObjectID{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10, 0x11}}},
resultPushdown: true,
resultPushdownSQLite: true,
filter: bson.D{{"_id", primitive.ObjectID{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10, 0x11}}},
resultPushdown: AllPushdown,
},
"ObjectID": {
filter: bson.D{{"v", primitive.NilObjectID}},
resultPushdown: true,
resultPushdown: PgPushdown,
},
"UnknownFilterOperator": {
filter: bson.D{{"v", bson.D{{"$someUnknownOperator", 42}}}},
Expand Down