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
|
@ -459,6 +459,7 @@ fn parse_delimited_identifiers() {
|
|||
with_ordinality: _,
|
||||
partitions: _,
|
||||
json_path: _,
|
||||
sample: _,
|
||||
} => {
|
||||
assert_eq!(vec![Ident::with_quote('"', "a table")], name.0);
|
||||
assert_eq!(Ident::with_quote('"', "alias"), alias.unwrap().name);
|
||||
|
@ -537,6 +538,15 @@ fn parse_use() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_tample_sample() {
|
||||
hive().verified_stmt("SELECT * FROM source TABLESAMPLE (BUCKET 3 OUT OF 32 ON rand()) AS s");
|
||||
hive().verified_stmt("SELECT * FROM source TABLESAMPLE (BUCKET 3 OUT OF 16 ON id)");
|
||||
hive().verified_stmt("SELECT * FROM source TABLESAMPLE (100M) AS s");
|
||||
hive().verified_stmt("SELECT * FROM source TABLESAMPLE (0.1 PERCENT) AS s");
|
||||
hive().verified_stmt("SELECT * FROM source TABLESAMPLE (10 ROWS)");
|
||||
}
|
||||
|
||||
fn hive() -> TestedDialects {
|
||||
TestedDialects::new(vec![Box::new(HiveDialect {})])
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue