Skip to content

Commit

Permalink
chore(cli): fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sundy-li committed Dec 31, 2024
1 parent 7a9ac94 commit 069a97f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion src/query/ast/tests/it/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ fn test_statement() {
r#"SELECT first_value(d) respect nulls OVER (w) FROM e;"#,
r#"SELECT sum(d) IGNORE NULLS OVER (w) FROM e;"#,
r#"SELECT sum(d) OVER w FROM e WINDOW w AS (PARTITION BY f ORDER BY g);"#,
r#"SELECT number, rank() OVER ( PARTITION BY number % 3 ORDER BY number )
r#"SELECT number, rank() OVER (PARTITION BY number % 3 ORDER BY number)
FROM numbers(10) where number > 10 and number > 9 and number > 8;"#,
r#"GRANT OWNERSHIP ON d20_0014.* TO ROLE 'd20_0015_owner';"#,
r#"GRANT OWNERSHIP ON d20_0014.t TO ROLE 'd20_0015_owner';"#,
Expand Down
54 changes: 27 additions & 27 deletions src/query/ast/tests/it/testdata/stmt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23079,21 +23079,21 @@ Query(


---------- Input ----------
SELECT number, rank() OVER ( PARTITION BY number % 3 ORDER BY number )
SELECT number, rank() OVER (PARTITION BY number % 3 ORDER BY number)
FROM numbers(10) where number > 10 and number > 9 and number > 8;
---------- Output ---------
SELECT number, rank() OVER (PARTITION BY number % 3 ORDER BY number) FROM numbers(10) WHERE number > 10 AND number > 9 AND number > 8
---------- AST ------------
Query(
Query {
span: Some(
0..135,
0..133,
),
with: None,
body: Select(
SelectStmt {
span: Some(
0..135,
0..133,
),
hints: None,
distinct: false,
Expand Down Expand Up @@ -23124,7 +23124,7 @@ Query(
AliasedExpr {
expr: FunctionCall {
span: Some(
15..70,
15..68,
),
func: FunctionCall {
distinct: false,
Expand All @@ -23147,20 +23147,20 @@ Query(
partition_by: [
BinaryOp {
span: Some(
49..50,
48..49,
),
op: Modulo,
left: ColumnRef {
span: Some(
42..48,
41..47,
),
column: ColumnRef {
database: None,
table: None,
column: Name(
Identifier {
span: Some(
42..48,
41..47,
),
name: "number",
quote: None,
Expand All @@ -23171,7 +23171,7 @@ Query(
},
right: Literal {
span: Some(
51..52,
50..51,
),
value: UInt64(
3,
Expand All @@ -23183,15 +23183,15 @@ Query(
OrderByExpr {
expr: ColumnRef {
span: Some(
62..68,
61..67,
),
column: ColumnRef {
database: None,
table: None,
column: Name(
Identifier {
span: Some(
62..68,
61..67,
),
name: "number",
quote: None,
Expand All @@ -23218,12 +23218,12 @@ Query(
from: [
TableFunction {
span: Some(
76..87,
74..85,
),
lateral: false,
name: Identifier {
span: Some(
76..83,
74..81,
),
name: "numbers",
quote: None,
Expand All @@ -23232,7 +23232,7 @@ Query(
params: [
Literal {
span: Some(
84..86,
82..84,
),
value: UInt64(
10,
Expand All @@ -23247,30 +23247,30 @@ Query(
selection: Some(
BinaryOp {
span: Some(
121..124,
119..122,
),
op: And,
left: BinaryOp {
span: Some(
106..109,
104..107,
),
op: And,
left: BinaryOp {
span: Some(
101..102,
99..100,
),
op: Gt,
left: ColumnRef {
span: Some(
94..100,
92..98,
),
column: ColumnRef {
database: None,
table: None,
column: Name(
Identifier {
span: Some(
94..100,
92..98,
),
name: "number",
quote: None,
Expand All @@ -23281,7 +23281,7 @@ Query(
},
right: Literal {
span: Some(
103..105,
101..103,
),
value: UInt64(
10,
Expand All @@ -23290,20 +23290,20 @@ Query(
},
right: BinaryOp {
span: Some(
117..118,
115..116,
),
op: Gt,
left: ColumnRef {
span: Some(
110..116,
108..114,
),
column: ColumnRef {
database: None,
table: None,
column: Name(
Identifier {
span: Some(
110..116,
108..114,
),
name: "number",
quote: None,
Expand All @@ -23314,7 +23314,7 @@ Query(
},
right: Literal {
span: Some(
119..120,
117..118,
),
value: UInt64(
9,
Expand All @@ -23324,20 +23324,20 @@ Query(
},
right: BinaryOp {
span: Some(
132..133,
130..131,
),
op: Gt,
left: ColumnRef {
span: Some(
125..131,
123..129,
),
column: ColumnRef {
database: None,
table: None,
column: Name(
Identifier {
span: Some(
125..131,
123..129,
),
name: "number",
quote: None,
Expand All @@ -23348,7 +23348,7 @@ Query(
},
right: Literal {
span: Some(
134..135,
132..133,
),
value: UInt64(
8,
Expand Down

0 comments on commit 069a97f

Please sign in to comment.