mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-29 10:24:06 +00:00
Change Word::keyword to a enum (#193)
This improves performance and paves the way to future API enhancements as discussed in the PR https://github.com/andygrove/sqlparser-rs/pull/193
This commit is contained in:
parent
0fe3a8ec39
commit
34548e890b
5 changed files with 395 additions and 342 deletions
|
@ -22,7 +22,7 @@ use matches::assert_matches;
|
|||
|
||||
use sqlparser::ast::*;
|
||||
use sqlparser::dialect::keywords::ALL_KEYWORDS;
|
||||
use sqlparser::parser::*;
|
||||
use sqlparser::parser::{Parser, ParserError};
|
||||
use sqlparser::test_utils::{all_dialects, expr_from_projection, number, only};
|
||||
|
||||
#[test]
|
||||
|
@ -1354,10 +1354,12 @@ fn parse_window_functions() {
|
|||
avg(bar) OVER (ORDER BY a \
|
||||
RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING), \
|
||||
max(baz) OVER (ORDER BY a \
|
||||
ROWS UNBOUNDED PRECEDING) \
|
||||
ROWS UNBOUNDED PRECEDING), \
|
||||
sum(qux) OVER (ORDER BY a \
|
||||
GROUPS BETWEEN 1 PRECEDING AND 1 FOLLOWING) \
|
||||
FROM foo";
|
||||
let select = verified_only_select(sql);
|
||||
assert_eq!(4, select.projection.len());
|
||||
assert_eq!(5, select.projection.len());
|
||||
assert_eq!(
|
||||
&Expr::Function(Function {
|
||||
name: ObjectName(vec![Ident::new("row_number")]),
|
||||
|
@ -2872,7 +2874,7 @@ fn parse_drop_index() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn keywords_sorted() {
|
||||
fn all_keywords_sorted() {
|
||||
// assert!(ALL_KEYWORDS.is_sorted())
|
||||
let mut copy = Vec::from(ALL_KEYWORDS);
|
||||
copy.sort();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue