-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implement CALL statement * Update testdata
- Loading branch information
Showing
11 changed files
with
233 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CALL cancel_query("12345") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
-- https://github.com/google/zetasql/blob/a516c6b26d183efc4f56293256bba92e243b7a61/zetasql/parser/testdata/call.test#L92C1-L93C1 | ||
call myprocedure(TABLE my.table, (SELECT * FROM my.another_table), mytvf(1, 2)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
-- https://github.com/google/zetasql/blob/a516c6b26d183efc4f56293256bba92e243b7a61/zetasql/parser/testdata/call.test#L15C1-L15C26 | ||
call schema.myprocedure() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- call_cancel_query.sql | ||
CALL cancel_query("12345") | ||
--- AST | ||
&ast.Call{ | ||
Rparen: 25, | ||
Name: &ast.Path{ | ||
Idents: []*ast.Ident{ | ||
&ast.Ident{ | ||
NamePos: 5, | ||
NameEnd: 17, | ||
Name: "cancel_query", | ||
}, | ||
}, | ||
}, | ||
Args: []ast.TVFArg{ | ||
&ast.ExprArg{ | ||
Expr: &ast.StringLiteral{ | ||
ValuePos: 18, | ||
ValueEnd: 25, | ||
Value: "12345", | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
--- SQL | ||
CALL cancel_query("12345") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
--- call_complex_args.sql | ||
-- https://github.com/google/zetasql/blob/a516c6b26d183efc4f56293256bba92e243b7a61/zetasql/parser/testdata/call.test#L92C1-L93C1 | ||
call myprocedure(TABLE my.table, (SELECT * FROM my.another_table), mytvf(1, 2)) | ||
--- AST | ||
&ast.Call{ | ||
Call: 129, | ||
Rparen: 207, | ||
Name: &ast.Path{ | ||
Idents: []*ast.Ident{ | ||
&ast.Ident{ | ||
NamePos: 134, | ||
NameEnd: 145, | ||
Name: "myprocedure", | ||
}, | ||
}, | ||
}, | ||
Args: []ast.TVFArg{ | ||
&ast.TableArg{ | ||
Table: 146, | ||
Name: &ast.Path{ | ||
Idents: []*ast.Ident{ | ||
&ast.Ident{ | ||
NamePos: 152, | ||
NameEnd: 154, | ||
Name: "my", | ||
}, | ||
&ast.Ident{ | ||
NamePos: 155, | ||
NameEnd: 160, | ||
Name: "table", | ||
}, | ||
}, | ||
}, | ||
}, | ||
&ast.ExprArg{ | ||
Expr: &ast.ScalarSubQuery{ | ||
Lparen: 162, | ||
Rparen: 193, | ||
Query: &ast.Select{ | ||
Select: 163, | ||
Results: []ast.SelectItem{ | ||
&ast.Star{ | ||
Star: 170, | ||
}, | ||
}, | ||
From: &ast.From{ | ||
From: 172, | ||
Source: &ast.PathTableExpr{ | ||
Path: &ast.Path{ | ||
Idents: []*ast.Ident{ | ||
&ast.Ident{ | ||
NamePos: 177, | ||
NameEnd: 179, | ||
Name: "my", | ||
}, | ||
&ast.Ident{ | ||
NamePos: 180, | ||
NameEnd: 193, | ||
Name: "another_table", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
&ast.ExprArg{ | ||
Expr: &ast.CallExpr{ | ||
Rparen: 206, | ||
Func: &ast.Ident{ | ||
NamePos: 196, | ||
NameEnd: 201, | ||
Name: "mytvf", | ||
}, | ||
Args: []ast.Arg{ | ||
&ast.ExprArg{ | ||
Expr: &ast.IntLiteral{ | ||
ValuePos: 202, | ||
ValueEnd: 203, | ||
Base: 10, | ||
Value: "1", | ||
}, | ||
}, | ||
&ast.ExprArg{ | ||
Expr: &ast.IntLiteral{ | ||
ValuePos: 205, | ||
ValueEnd: 206, | ||
Base: 10, | ||
Value: "2", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
--- SQL | ||
CALL myprocedure(TABLE my.table, (SELECT * FROM my.another_table), mytvf(1, 2)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- call_path.sql | ||
-- https://github.com/google/zetasql/blob/a516c6b26d183efc4f56293256bba92e243b7a61/zetasql/parser/testdata/call.test#L15C1-L15C26 | ||
call schema.myprocedure() | ||
--- AST | ||
&ast.Call{ | ||
Call: 130, | ||
Rparen: 154, | ||
Name: &ast.Path{ | ||
Idents: []*ast.Ident{ | ||
&ast.Ident{ | ||
NamePos: 135, | ||
NameEnd: 141, | ||
Name: "schema", | ||
}, | ||
&ast.Ident{ | ||
NamePos: 142, | ||
NameEnd: 153, | ||
Name: "myprocedure", | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
--- SQL | ||
CALL schema.myprocedure() |