-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Gen4: Even more fixes #8904
Gen4: Even more fixes #8904
Conversation
d9cf06c
to
85584d2
Compare
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
…tble join planning Signed-off-by: Andres Taylor <andres@planetscale.com>
Now that all the queries are either planned correctly or failing with the expected error (Gen4NotSupported), we could simplify plan_test a lot Signed-off-by: Andres Taylor <andres@planetscale.com>
3921b89
to
b382124
Compare
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
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.
looks good to me 🚀
func orderedStringIntMap(in map[string]int) orderedMap { | ||
result := make(orderedMap, 0, len(in)) | ||
for k, v := range in { | ||
result = append(result, keyVal{key: k, val: v}) | ||
} | ||
sort.Sort(result) | ||
return result | ||
} |
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.
this is great
} | ||
func (qg *QueryGraph) addJoinPredicates(ts semantics.TableSet, expr sqlparser.Expr) { | ||
for _, join := range qg.innerJoins { |
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.
nit: add an extra new line between 119
and 120
var checkAllTests = false | ||
func testFile(t *testing.T, filename, tempDir string, vschema *vschemaWrapper) { | ||
t.Run(filename, func(t *testing.T) { |
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.
this is really great
{ | ||
"QueryType": "SELECT", | ||
"Original": "select col from unsharded union select id from user union select col2 from unsharded union select col from user_extra", | ||
"Instructions": { | ||
"OperatorType": "Distinct", | ||
"Inputs": [ | ||
{ | ||
"OperatorType": "Concatenate", | ||
"Inputs": [ | ||
{ | ||
"OperatorType": "Route", | ||
"Variant": "SelectUnsharded", | ||
"Keyspace": { | ||
"Name": "main", | ||
"Sharded": false | ||
}, | ||
"FieldQuery": "select col from unsharded where 1 != 1 union select col2 from unsharded where 1 != 1", | ||
"Query": "select col from unsharded union select col2 from unsharded", | ||
"Table": "unsharded" | ||
}, | ||
{ | ||
"OperatorType": "Route", | ||
"Variant": "SelectScatter", | ||
"Keyspace": { | ||
"Name": "user", | ||
"Sharded": true | ||
}, | ||
"FieldQuery": "select id from `user` where 1 != 1 union select col from user_extra where 1 != 1", | ||
"Query": "select id from `user` union select col from user_extra", | ||
"Table": "`user`" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |
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.
+1 for better plans!
Description
More gen4 small fixes
Related Issue(s)
#7280
Checklist