Skip to content

Commit

Permalink
refactor: reformat
Browse files Browse the repository at this point in the history
Signed-off-by: Andres Taylor <[email protected]>
  • Loading branch information
systay committed Nov 5, 2024
1 parent 48f52b7 commit cb8ee86
Showing 1 changed file with 127 additions and 127 deletions.
254 changes: 127 additions & 127 deletions go/vt/vtgate/testdata/executor_vexplain.json
Original file line number Diff line number Diff line change
@@ -1,129 +1,129 @@
[
{
"query": "select count(*), col2 from music group by col2",
"expected": {
"statementType": "SELECT",
"groupingColumns": [
"music.col2"
],
"selectColumns": [
"music.col2"
]
}
},
{
"query": "select * from user u join user_extra ue on u.id = ue.user_id where u.col1 \u003e 100 and ue.noLimit = 'foo'",
"expected": {
"statementType": "SELECT",
"filterColumns": [
"`user`.col1 gt",
"user_extra.noLimit ="
],
"joinPredicates": [
"`user`.id = user_extra.user_id"
]
}
},
{
"query": "select * from user_extra ue, user u where ue.noLimit = 'foo' and u.col1 \u003e 100 and ue.user_id = u.id",
"expected": {
"statementType": "SELECT",
"filterColumns": [
"`user`.col1 gt",
"user_extra.noLimit ="
],
"joinPredicates": [
"`user`.id = user_extra.user_id"
]
}
},
{
"query": "select u.foo, ue.bar, count(*) from user u join user_extra ue on u.id = ue.user_id where u.name = 'John Doe' group by 1, 2",
"expected": {
"statementType": "SELECT",
"groupingColumns": [
"`user`.foo",
"user_extra.bar"
],
"filterColumns": [
"`user`.`name` ="
],
"selectColumns": [
"`user`.foo",
"user_extra.bar"
],
"joinPredicates": [
"`user`.id = user_extra.user_id"
]
}
},
{
"query": "select * from (select * from user) as derived where derived.amount \u003e 1000",
"expected": {
"statementType": "SELECT"
}
},
{
"query": "select name, sum(amount) from user group by name",
"expected": {
"statementType": "SELECT",
"groupingColumns": [
"`user`.`name`"
],
"selectColumns": [
"`user`.`name`",
"`user`.amount"
]
}
},
{
"query": "select name from user where age \u003e 30",
"expected": {
"statementType": "SELECT",
"filterColumns": [
"`user`.age gt"
],
"selectColumns": [
"`user`.`name`"
]
}
},
{
"query": "select * from user where name = 'apa' union select * from user_extra where name = 'monkey'",
"expected": {
"statementType": "SELECT",
"filterColumns": [
"`user`.`name` =",
"user_extra.`name` ="
]
}
},
{
"query": "update user set name = 'Jane Doe' where id = 1",
"expected": {
"statementType": "UPDATE",
"filterColumns": [
"`user`.id ="
]
}
},
{
"query": "delete from user where order_date \u003c '2023-01-01'",
"expected": {
"statementType": "DELETE",
"filterColumns": [
"`user`.order_date lt"
]
}
},
{
"query": "select * from user where name between 'A' and 'C'",
"expected": {
"statementType": "SELECT",
"filterColumns": [
"`user`.`name` ge",
"`user`.`name` le"
]
}
}
{
"query": "select count(*), col2 from music group by col2",
"expected": {
"statementType": "SELECT",
"groupingColumns": [
"music.col2"
],
"selectColumns": [
"music.col2"
]
}
},
{
"query": "select * from user u join user_extra ue on u.id = ue.user_id where u.col1 \u003e 100 and ue.noLimit = 'foo'",
"expected": {
"statementType": "SELECT",
"filterColumns": [
"`user`.col1 gt",
"user_extra.noLimit ="
],
"joinPredicates": [
"`user`.id = user_extra.user_id"
]
}
},
{
"query": "select * from user_extra ue, user u where ue.noLimit = 'foo' and u.col1 \u003e 100 and ue.user_id = u.id",
"expected": {
"statementType": "SELECT",
"filterColumns": [
"`user`.col1 gt",
"user_extra.noLimit ="
],
"joinPredicates": [
"`user`.id = user_extra.user_id"
]
}
},
{
"query": "select u.foo, ue.bar, count(*) from user u join user_extra ue on u.id = ue.user_id where u.name = 'John Doe' group by 1, 2",
"expected": {
"statementType": "SELECT",
"groupingColumns": [
"`user`.foo",
"user_extra.bar"
],
"filterColumns": [
"`user`.`name` ="
],
"selectColumns": [
"`user`.foo",
"user_extra.bar"
],
"joinPredicates": [
"`user`.id = user_extra.user_id"
]
}
},
{
"query": "select * from (select * from user) as derived where derived.amount \u003e 1000",
"expected": {
"statementType": "SELECT"
}
},
{
"query": "select name, sum(amount) from user group by name",
"expected": {
"statementType": "SELECT",
"groupingColumns": [
"`user`.`name`"
],
"selectColumns": [
"`user`.`name`",
"`user`.amount"
]
}
},
{
"query": "select name from user where age \u003e 30",
"expected": {
"statementType": "SELECT",
"filterColumns": [
"`user`.age gt"
],
"selectColumns": [
"`user`.`name`"
]
}
},
{
"query": "select * from user where name = 'apa' union select * from user_extra where name = 'monkey'",
"expected": {
"statementType": "SELECT",
"filterColumns": [
"`user`.`name` =",
"user_extra.`name` ="
]
}
},
{
"query": "update user set name = 'Jane Doe' where id = 1",
"expected": {
"statementType": "UPDATE",
"filterColumns": [
"`user`.id ="
]
}
},
{
"query": "delete from user where order_date \u003c '2023-01-01'",
"expected": {
"statementType": "DELETE",
"filterColumns": [
"`user`.order_date lt"
]
}
},
{
"query": "select * from user where name between 'A' and 'C'",
"expected": {
"statementType": "SELECT",
"filterColumns": [
"`user`.`name` ge",
"`user`.`name` le"
]
}
}
]

0 comments on commit cb8ee86

Please sign in to comment.