Skip to content

Commit 2ab257c

Browse files
committed
Intermediate changes
commit_hash:aff487dca81f60c9c0d8987ab87c614d8edba48d
1 parent 542ca06 commit 2ab257c

File tree

2,391 files changed

+68194
-10063
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,391 files changed

+68194
-10063
lines changed

yql/essentials/tests/sql/sql2yql/canondata/result.json

Lines changed: 5284 additions & 10062 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* syntax version 1 *//* postgres can not */
2+
$cluster = "pla" || "to";
3+
$name = "In" || "put";
4+
5+
SELECT
6+
count(*)
7+
FROM yt: $cluster.$name;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* syntax version 1 *//* postgres can not */
2+
$foo = CAST(Unicode::ToLower("PLATO"u) AS String);
3+
4+
INSERT INTO yt: $foo.Output
5+
SELECT
6+
*
7+
FROM yt: $foo.Input
8+
WHERE key < "100"
9+
ORDER BY
10+
key;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* syntax version 1 *//* postgres can not */
2+
DEFINE ACTION $a($x) AS
3+
$foo = CAST(Unicode::ToLower($x) AS String);
4+
5+
INSERT INTO yt: $foo.Output
6+
SELECT
7+
*
8+
FROM yt: $foo.Input
9+
WHERE key < "100"
10+
ORDER BY
11+
key;
12+
END DEFINE;
13+
14+
EVALUATE FOR $i IN AsList("PLATO"u)
15+
DO $a($i);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* syntax version 1 *//* postgres can not */
2+
$foo = CAST(Unicode::ToLower("PLATO"u) AS String);
3+
USE yt: $foo;
4+
5+
INSERT INTO Output
6+
SELECT
7+
*
8+
FROM Input
9+
WHERE key < "100"
10+
ORDER BY
11+
key;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* yt can not */
2+
PRAGMA CompactNamedExprs;
3+
$foo = CAST(Unicode::ToLower("PLATO"u) AS String);
4+
5+
INSERT INTO yt: $foo.Output
6+
SELECT
7+
*
8+
FROM yt: $foo.Input
9+
WHERE key < "100"
10+
ORDER BY
11+
key;
12+
13+
DEFINE ACTION $bar() AS
14+
$x = CAST(Unicode::ToLower("PLaTO"u) AS String);
15+
16+
INSERT INTO yt: $x.Output
17+
SELECT
18+
*
19+
FROM yt: $foo.Input
20+
WHERE key < "100"
21+
ORDER BY
22+
key;
23+
END DEFINE;
24+
DO $bar();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* syntax version 1 *//* postgres can not */
2+
USE plato;
3+
4+
DEFINE ACTION $action() AS
5+
$sub = (
6+
SELECT
7+
*
8+
FROM Input
9+
);
10+
11+
SELECT
12+
*
13+
FROM $sub
14+
ORDER BY
15+
key;
16+
END DEFINE;
17+
DO $action();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* syntax version 1 *//* postgres can not */
2+
DEFINE ACTION $action($a, $b?) AS
3+
SELECT
4+
$a + ($b ?? 0);
5+
END DEFINE;
6+
DO $action(1);
7+
DO $action(2, 3);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* syntax version 1 *//* postgres can not */
2+
DEFINE ACTION $f($x) AS
3+
SELECT
4+
$x;
5+
END DEFINE;
6+
$x = CAST(Unicode::ToUpper("abc"u) AS String);
7+
DO $f($x);
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/* syntax version 1 *//* postgres can not */
2+
DEFINE ACTION $action($b, $c) AS
3+
$d = $b + $c;
4+
5+
SELECT
6+
$b;
7+
8+
SELECT
9+
$c;
10+
11+
SELECT
12+
$d;
13+
END DEFINE;
14+
15+
DEFINE ACTION $closure_action($a) AS
16+
DO $a(3, 4);
17+
END DEFINE;
18+
DO $closure_action($action);

0 commit comments

Comments
 (0)