mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-04 14:28:22 +00:00
This commit is contained in:
parent
8de3a62948
commit
269967a6ac
5 changed files with 99 additions and 3 deletions
|
@ -1649,6 +1649,21 @@ fn parse_table_sample() {
|
|||
clickhouse().verified_stmt("SELECT * FROM tbl SAMPLE 1 / 10 OFFSET 1 / 2");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_numbers_with_underscore() {
|
||||
let canonical = if cfg!(feature = "bigdecimal") {
|
||||
"SELECT 10000"
|
||||
} else {
|
||||
"SELECT 10_000"
|
||||
};
|
||||
let select = clickhouse().verified_only_select_with_canonical("SELECT 10_000", canonical);
|
||||
|
||||
assert_eq!(
|
||||
select.projection,
|
||||
vec![SelectItem::UnnamedExpr(Expr::Value(number("10_000")))]
|
||||
)
|
||||
}
|
||||
|
||||
fn clickhouse() -> TestedDialects {
|
||||
TestedDialects::new(vec![Box::new(ClickHouseDialect {})])
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue