mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-07-08 01:15:00 +00:00
chore: remove redundant punctuation (#1434)
This commit is contained in:
parent
04a53e5753
commit
71318df8b9
7 changed files with 16 additions and 16 deletions
|
@ -1264,7 +1264,7 @@ impl<'a> Parser<'a> {
|
||||||
self.prev_token();
|
self.prev_token();
|
||||||
self.parse_duckdb_struct_literal()
|
self.parse_duckdb_struct_literal()
|
||||||
}
|
}
|
||||||
_ => self.expected("an expression:", next_token),
|
_ => self.expected("an expression", next_token),
|
||||||
}?;
|
}?;
|
||||||
|
|
||||||
if self.parse_keyword(Keyword::COLLATE) {
|
if self.parse_keyword(Keyword::COLLATE) {
|
||||||
|
|
|
@ -276,13 +276,13 @@ fn parse_alter_table_attach_and_detach_partition() {
|
||||||
clickhouse_and_generic()
|
clickhouse_and_generic()
|
||||||
.parse_sql_statements(format!("ALTER TABLE t0 {operation} PARTITION").as_str())
|
.parse_sql_statements(format!("ALTER TABLE t0 {operation} PARTITION").as_str())
|
||||||
.unwrap_err(),
|
.unwrap_err(),
|
||||||
ParserError("Expected: an expression:, found: EOF".to_string())
|
ParserError("Expected: an expression, found: EOF".to_string())
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
clickhouse_and_generic()
|
clickhouse_and_generic()
|
||||||
.parse_sql_statements(format!("ALTER TABLE t0 {operation} PART").as_str())
|
.parse_sql_statements(format!("ALTER TABLE t0 {operation} PART").as_str())
|
||||||
.unwrap_err(),
|
.unwrap_err(),
|
||||||
ParserError("Expected: an expression:, found: EOF".to_string())
|
ParserError("Expected: an expression, found: EOF".to_string())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -355,7 +355,7 @@ fn parse_alter_table_add_projection() {
|
||||||
clickhouse_and_generic()
|
clickhouse_and_generic()
|
||||||
.parse_sql_statements("ALTER TABLE t0 ADD PROJECTION my_name (SELECT)")
|
.parse_sql_statements("ALTER TABLE t0 ADD PROJECTION my_name (SELECT)")
|
||||||
.unwrap_err(),
|
.unwrap_err(),
|
||||||
ParserError("Expected: an expression:, found: )".to_string())
|
ParserError("Expected: an expression, found: )".to_string())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -498,13 +498,13 @@ fn parse_optimize_table() {
|
||||||
clickhouse_and_generic()
|
clickhouse_and_generic()
|
||||||
.parse_sql_statements("OPTIMIZE TABLE t0 DEDUPLICATE BY")
|
.parse_sql_statements("OPTIMIZE TABLE t0 DEDUPLICATE BY")
|
||||||
.unwrap_err(),
|
.unwrap_err(),
|
||||||
ParserError("Expected: an expression:, found: EOF".to_string())
|
ParserError("Expected: an expression, found: EOF".to_string())
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
clickhouse_and_generic()
|
clickhouse_and_generic()
|
||||||
.parse_sql_statements("OPTIMIZE TABLE t0 PARTITION")
|
.parse_sql_statements("OPTIMIZE TABLE t0 PARTITION")
|
||||||
.unwrap_err(),
|
.unwrap_err(),
|
||||||
ParserError("Expected: an expression:, found: EOF".to_string())
|
ParserError("Expected: an expression, found: EOF".to_string())
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
clickhouse_and_generic()
|
clickhouse_and_generic()
|
||||||
|
@ -1479,7 +1479,7 @@ fn parse_freeze_and_unfreeze_partition() {
|
||||||
clickhouse_and_generic()
|
clickhouse_and_generic()
|
||||||
.parse_sql_statements(format!("ALTER TABLE t0 {operation_name} PARTITION").as_str())
|
.parse_sql_statements(format!("ALTER TABLE t0 {operation_name} PARTITION").as_str())
|
||||||
.unwrap_err(),
|
.unwrap_err(),
|
||||||
ParserError("Expected: an expression:, found: EOF".to_string())
|
ParserError("Expected: an expression, found: EOF".to_string())
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
clickhouse_and_generic()
|
clickhouse_and_generic()
|
||||||
|
|
|
@ -2051,7 +2051,7 @@ fn parse_tuple_invalid() {
|
||||||
let sql = "select (), 2";
|
let sql = "select (), 2";
|
||||||
let res = parse_sql_statements(sql);
|
let res = parse_sql_statements(sql);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
ParserError::ParserError("Expected: an expression:, found: )".to_string()),
|
ParserError::ParserError("Expected: an expression, found: )".to_string()),
|
||||||
res.unwrap_err()
|
res.unwrap_err()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -9556,7 +9556,7 @@ fn parse_projection_trailing_comma() {
|
||||||
trailing_commas
|
trailing_commas
|
||||||
.parse_sql_statements("SELECT * FROM track ORDER BY milliseconds,")
|
.parse_sql_statements("SELECT * FROM track ORDER BY milliseconds,")
|
||||||
.unwrap_err(),
|
.unwrap_err(),
|
||||||
ParserError::ParserError("Expected: an expression:, found: EOF".to_string())
|
ParserError::ParserError("Expected: an expression, found: EOF".to_string())
|
||||||
);
|
);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
|
|
|
@ -64,7 +64,7 @@ fn test_databricks_exists() {
|
||||||
let res = databricks().parse_sql_statements("SELECT EXISTS (");
|
let res = databricks().parse_sql_statements("SELECT EXISTS (");
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
// TODO: improve this error message...
|
// TODO: improve this error message...
|
||||||
ParserError::ParserError("Expected: an expression:, found: EOF".to_string()),
|
ParserError::ParserError("Expected: an expression, found: EOF".to_string()),
|
||||||
res.unwrap_err(),
|
res.unwrap_err(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -487,7 +487,7 @@ fn parse_convert() {
|
||||||
|
|
||||||
let error_sql = "SELECT CONVERT(INT, 'foo',) FROM T";
|
let error_sql = "SELECT CONVERT(INT, 'foo',) FROM T";
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
ParserError::ParserError("Expected: an expression:, found: )".to_owned()),
|
ParserError::ParserError("Expected: an expression, found: )".to_owned()),
|
||||||
ms().parse_sql_statements(error_sql).unwrap_err()
|
ms().parse_sql_statements(error_sql).unwrap_err()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1230,13 +1230,13 @@ fn parse_snowflake_declare_result_set() {
|
||||||
|
|
||||||
let error_sql = "DECLARE res RESULTSET DEFAULT";
|
let error_sql = "DECLARE res RESULTSET DEFAULT";
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
ParserError::ParserError("Expected: an expression:, found: EOF".to_owned()),
|
ParserError::ParserError("Expected: an expression, found: EOF".to_owned()),
|
||||||
snowflake().parse_sql_statements(error_sql).unwrap_err()
|
snowflake().parse_sql_statements(error_sql).unwrap_err()
|
||||||
);
|
);
|
||||||
|
|
||||||
let error_sql = "DECLARE res RESULTSET :=";
|
let error_sql = "DECLARE res RESULTSET :=";
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
ParserError::ParserError("Expected: an expression:, found: EOF".to_owned()),
|
ParserError::ParserError("Expected: an expression, found: EOF".to_owned()),
|
||||||
snowflake().parse_sql_statements(error_sql).unwrap_err()
|
snowflake().parse_sql_statements(error_sql).unwrap_err()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1328,13 +1328,13 @@ fn parse_snowflake_declare_variable() {
|
||||||
|
|
||||||
let error_sql = "DECLARE profit INT DEFAULT";
|
let error_sql = "DECLARE profit INT DEFAULT";
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
ParserError::ParserError("Expected: an expression:, found: EOF".to_owned()),
|
ParserError::ParserError("Expected: an expression, found: EOF".to_owned()),
|
||||||
snowflake().parse_sql_statements(error_sql).unwrap_err()
|
snowflake().parse_sql_statements(error_sql).unwrap_err()
|
||||||
);
|
);
|
||||||
|
|
||||||
let error_sql = "DECLARE profit DEFAULT";
|
let error_sql = "DECLARE profit DEFAULT";
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
ParserError::ParserError("Expected: an expression:, found: EOF".to_owned()),
|
ParserError::ParserError("Expected: an expression, found: EOF".to_owned()),
|
||||||
snowflake().parse_sql_statements(error_sql).unwrap_err()
|
snowflake().parse_sql_statements(error_sql).unwrap_err()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -432,7 +432,7 @@ fn invalid_empty_list() {
|
||||||
let sql = "SELECT * FROM t1 WHERE a IN (,,)";
|
let sql = "SELECT * FROM t1 WHERE a IN (,,)";
|
||||||
let sqlite = sqlite_with_options(ParserOptions::new().with_trailing_commas(true));
|
let sqlite = sqlite_with_options(ParserOptions::new().with_trailing_commas(true));
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
"sql parser error: Expected: an expression:, found: ,",
|
"sql parser error: Expected: an expression, found: ,",
|
||||||
sqlite.parse_sql_statements(sql).unwrap_err().to_string()
|
sqlite.parse_sql_statements(sql).unwrap_err().to_string()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue