mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-07-07 17:04:59 +00:00
Add support for TABLESAMPLE (#1580)
This commit is contained in:
parent
7bc6ddb8fb
commit
316bb14135
20 changed files with 546 additions and 458 deletions
|
@ -1188,9 +1188,7 @@ fn parse_delimited_identifiers() {
|
|||
args,
|
||||
with_hints,
|
||||
version,
|
||||
with_ordinality: _,
|
||||
partitions: _,
|
||||
json_path: _,
|
||||
..
|
||||
} => {
|
||||
assert_eq!(vec![Ident::with_quote('"', "a table")], name.0);
|
||||
assert_eq!(Ident::with_quote('"', "alias"), alias.unwrap().name);
|
||||
|
@ -2960,3 +2958,19 @@ fn parse_insert_overwrite() {
|
|||
let insert_overwrite_into = r#"INSERT OVERWRITE INTO schema.table SELECT a FROM b"#;
|
||||
snowflake().verified_stmt(insert_overwrite_into);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_table_sample() {
|
||||
snowflake_and_generic().verified_stmt("SELECT * FROM testtable SAMPLE (10)");
|
||||
snowflake_and_generic().verified_stmt("SELECT * FROM testtable TABLESAMPLE (10)");
|
||||
snowflake_and_generic()
|
||||
.verified_stmt("SELECT * FROM testtable AS t TABLESAMPLE BERNOULLI (10)");
|
||||
snowflake_and_generic().verified_stmt("SELECT * FROM testtable AS t TABLESAMPLE ROW (10)");
|
||||
snowflake_and_generic().verified_stmt("SELECT * FROM testtable AS t TABLESAMPLE ROW (10 ROWS)");
|
||||
snowflake_and_generic()
|
||||
.verified_stmt("SELECT * FROM testtable TABLESAMPLE BLOCK (3) SEED (82)");
|
||||
snowflake_and_generic()
|
||||
.verified_stmt("SELECT * FROM testtable TABLESAMPLE SYSTEM (3) REPEATABLE (82)");
|
||||
snowflake_and_generic().verified_stmt("SELECT id FROM mytable TABLESAMPLE (10) REPEATABLE (1)");
|
||||
snowflake_and_generic().verified_stmt("SELECT id FROM mytable TABLESAMPLE (10) SEED (1)");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue