-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
These are weird but the type inference and function lookup code needs to handle them.
- Loading branch information
Showing
2 changed files
with
53 additions
and
10 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
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,29 @@ | ||
-- SUM(SUM(x)) is a thing. This affects the design of the type system. | ||
|
||
create temp table t1 ( | ||
g1 STRING, | ||
g2 STRING, | ||
x INT64 | ||
); | ||
|
||
insert into t1 values | ||
('a', 'x', 1), | ||
('a', 'y', 2), | ||
('b', 'x', 3), | ||
('b', 'y', 4); | ||
|
||
CREATE OR REPLACE TABLE __result1 AS | ||
SELECT g1, g2, SUM(SUM(x)) OVER (PARTITION BY g2) AS `sum` | ||
FROM t1 | ||
GROUP BY g1, g2; | ||
|
||
CREATE OR REPLACE TABLE __expected1 ( | ||
g1 STRING, | ||
g2 STRING, | ||
`sum` INT64 | ||
); | ||
INSERT INTO __expected1 VALUES | ||
('a', 'x', 4), | ||
('a', 'y', 6), | ||
('b', 'x', 4), | ||
('b', 'y', 6); |