Skip to content

Commit

Permalink
fix after clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
ayman-sigma committed Dec 12, 2024
1 parent 4f92baa commit acd682e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/tokenizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ impl<'a> Tokenizer<'a> {
{
s.push('.');
chars.next();
} else if s.is_empty() {
} else if !s.is_empty() {
// Number might be part of period separated construct. Keep the period for next token
// e.g. a-12.b
return Ok(Some(Token::Number(s, false)));
Expand Down
9 changes: 9 additions & 0 deletions tests/sqlparser_bigquery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2232,3 +2232,12 @@ fn test_any_value() {
bigquery_and_generic().verified_expr("ANY_VALUE(fruit HAVING MAX sold)");
bigquery_and_generic().verified_expr("ANY_VALUE(fruit HAVING MIN sold)");
}

#[test]
fn test_err() {
let res = bigquery().parse_sql_statements("SELECT * FROM bq-dwh-prod-327613.xyz");
print!("{:?}", res);

let res = bigquery().parse_sql_statements("SELECT xy-12.z FROM bq-dwh-prod-327613.xyz");
print!("{:?}", res);
}
11 changes: 11 additions & 0 deletions tests/sqlparser_databricks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,3 +313,14 @@ fn parse_databricks_struct_function() {
})
);
}

// #[test]
// fn test_err() {
// let res = databricks().parse_sql_statements("SELECT *
// FROM
// datamart_att.att_user_features_daily_v1
// WHERE
// period <= struct(x).y");

// print!("{:?}", res);
// }

0 comments on commit acd682e

Please sign in to comment.