Support mysql partition to table selection (#959)

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
This commit is contained in:
chunshao.rcs 2023-09-15 02:21:47 +08:00 committed by GitHub
parent a16791d019
commit f6e4be4c15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 108 additions and 7 deletions

View file

@ -215,6 +215,7 @@ fn parse_update_set_from() {
args: None,
with_hints: vec![],
version: None,
partitions: vec![],
},
joins: vec![],
},
@ -242,6 +243,7 @@ fn parse_update_set_from() {
args: None,
with_hints: vec![],
version: None,
partitions: vec![],
},
joins: vec![],
}],
@ -308,6 +310,7 @@ fn parse_update_with_table_alias() {
args: None,
with_hints: vec![],
version: None,
partitions: vec![],
},
joins: vec![],
},
@ -371,6 +374,7 @@ fn parse_select_with_table_alias() {
args: None,
with_hints: vec![],
version: None,
partitions: vec![],
},
joins: vec![],
}]
@ -402,6 +406,7 @@ fn parse_delete_statement() {
args: None,
with_hints: vec![],
version: None,
partitions: vec![],
},
from[0].relation
);
@ -430,6 +435,7 @@ fn parse_delete_statement_for_multi_tables() {
args: None,
with_hints: vec![],
version: None,
partitions: vec![],
},
from[0].relation
);
@ -440,6 +446,7 @@ fn parse_delete_statement_for_multi_tables() {
args: None,
with_hints: vec![],
version: None,
partitions: vec![],
},
from[0].joins[0].relation
);
@ -464,6 +471,7 @@ fn parse_delete_statement_for_multi_tables_with_using() {
args: None,
with_hints: vec![],
version: None,
partitions: vec![],
},
from[0].relation
);
@ -474,6 +482,7 @@ fn parse_delete_statement_for_multi_tables_with_using() {
args: None,
with_hints: vec![],
version: None,
partitions: vec![],
},
from[1].relation
);
@ -484,6 +493,7 @@ fn parse_delete_statement_for_multi_tables_with_using() {
args: None,
with_hints: vec![],
version: None,
partitions: vec![],
},
using[0].relation
);
@ -494,6 +504,7 @@ fn parse_delete_statement_for_multi_tables_with_using() {
args: None,
with_hints: vec![],
version: None,
partitions: vec![],
},
using[0].joins[0].relation
);
@ -522,6 +533,7 @@ fn parse_where_delete_statement() {
args: None,
with_hints: vec![],
version: None,
partitions: vec![],
},
from[0].relation,
);
@ -564,6 +576,7 @@ fn parse_where_delete_with_alias_statement() {
args: None,
with_hints: vec![],
version: None,
partitions: vec![],
},
from[0].relation,
);
@ -578,6 +591,7 @@ fn parse_where_delete_with_alias_statement() {
args: None,
with_hints: vec![],
version: None,
partitions: vec![],
},
joins: vec![],
}]),
@ -3552,6 +3566,7 @@ fn test_parse_named_window() {
args: None,
with_hints: vec![],
version: None,
partitions: vec![],
},
joins: vec![],
}],
@ -3891,6 +3906,7 @@ fn parse_interval_and_or_xor() {
args: None,
with_hints: vec![],
version: None,
partitions: vec![],
},
joins: vec![],
}],
@ -4496,6 +4512,7 @@ fn parse_implicit_join() {
args: None,
with_hints: vec![],
version: None,
partitions: vec![],
},
joins: vec![],
},
@ -4506,6 +4523,7 @@ fn parse_implicit_join() {
args: None,
with_hints: vec![],
version: None,
partitions: vec![],
},
joins: vec![],
},
@ -4524,6 +4542,7 @@ fn parse_implicit_join() {
args: None,
with_hints: vec![],
version: None,
partitions: vec![],
},
joins: vec![Join {
relation: TableFactor::Table {
@ -4532,6 +4551,7 @@ fn parse_implicit_join() {
args: None,
with_hints: vec![],
version: None,
partitions: vec![],
},
join_operator: JoinOperator::Inner(JoinConstraint::Natural),
}],
@ -4543,6 +4563,7 @@ fn parse_implicit_join() {
args: None,
with_hints: vec![],
version: None,
partitions: vec![],
},
joins: vec![Join {
relation: TableFactor::Table {
@ -4551,6 +4572,7 @@ fn parse_implicit_join() {
args: None,
with_hints: vec![],
version: None,
partitions: vec![],
},
join_operator: JoinOperator::Inner(JoinConstraint::Natural),
}],
@ -4572,6 +4594,7 @@ fn parse_cross_join() {
args: None,
with_hints: vec![],
version: None,
partitions: vec![],
},
join_operator: JoinOperator::CrossJoin,
},
@ -4593,6 +4616,7 @@ fn parse_joins_on() {
args: None,
with_hints: vec![],
version: None,
partitions: vec![],
},
join_operator: f(JoinConstraint::On(Expr::BinaryOp {
left: Box::new(Expr::Identifier("c1".into())),
@ -4663,6 +4687,7 @@ fn parse_joins_using() {
args: None,
with_hints: vec![],
version: None,
partitions: vec![],
},
join_operator: f(JoinConstraint::Using(vec!["c1".into()])),
}
@ -4725,6 +4750,7 @@ fn parse_natural_join() {
args: None,
with_hints: vec![],
version: None,
partitions: vec![],
},
join_operator: f(JoinConstraint::Natural),
}
@ -4990,6 +5016,7 @@ fn parse_derived_tables() {
args: None,
with_hints: vec![],
version: None,
partitions: vec![],
},
join_operator: JoinOperator::Inner(JoinConstraint::Natural),
}],
@ -6318,6 +6345,7 @@ fn parse_merge() {
args: None,
with_hints: vec![],
version: None,
partitions: vec![],
}
);
assert_eq!(table, table_no_into);
@ -6342,6 +6370,7 @@ fn parse_merge() {
args: None,
with_hints: vec![],
version: None,
partitions: vec![],
},
joins: vec![],
}],