| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -444,26 +444,5 @@ class OracleType(SqlglotType): | |
| dialect = "oracle" | ||
|
|
||
|
|
||
| class SQLiteType(SqlglotType): | ||
| dialect = "sqlite" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| SELECT | ||
| t0.double_col AS double_col | ||
| FROM functional_alltypes AS t0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| SELECT | ||
| t0.bigint_col AS bigint_col | ||
| FROM functional_alltypes AS t0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| SELECT | ||
| t0.bool_col AS bool_col | ||
| FROM functional_alltypes AS t0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| SELECT | ||
| t0.date_string_col AS date_string_col | ||
| FROM functional_alltypes AS t0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| SELECT | ||
| t0.double_col AS double_col | ||
| FROM functional_alltypes AS t0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| SELECT | ||
| t0.float_col AS float_col | ||
| FROM functional_alltypes AS t0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| SELECT | ||
| t0.id AS id | ||
| FROM functional_alltypes AS t0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| SELECT | ||
| t0.int_col AS int_col | ||
| FROM functional_alltypes AS t0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| SELECT | ||
| t0.month AS month | ||
| FROM functional_alltypes AS t0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| SELECT | ||
| t0.smallint_col AS smallint_col | ||
| FROM functional_alltypes AS t0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| SELECT | ||
| t0.string_col AS string_col | ||
| FROM functional_alltypes AS t0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| SELECT | ||
| t0.timestamp_col AS timestamp_col | ||
| FROM functional_alltypes AS t0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| SELECT | ||
| t0.tinyint_col AS tinyint_col | ||
| FROM functional_alltypes AS t0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| SELECT | ||
| t0.year AS year | ||
| FROM functional_alltypes AS t0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,3 @@ | ||
| SELECT | ||
| t0.string_col LIKE 'foo%' OR t0.string_col LIKE '%bar' AS "Or(StringSQLLike(string_col, 'foo%'), StringSQLLike(string_col, '%bar'))" | ||
| FROM functional_alltypes AS t0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| SELECT | ||
| CAST(CEIL(t0.double_col) AS Nullable(Int64)) AS "Ceil(double_col)" | ||
| FROM functional_alltypes AS t0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,3 @@ | ||
| SELECT | ||
| LN(t0.int_col) + t0.double_col AS "Add(Log(int_col), double_col)" | ||
| FROM functional_alltypes AS t0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,5 @@ | ||
| SELECT | ||
| t0.tinyint_col + -( | ||
| t0.int_col + t0.double_col | ||
| ) AS "Add(tinyint_col, Negate(Add(int_col, double_col)))" | ||
| FROM functional_alltypes AS t0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| SELECT | ||
| t0.id IN (( | ||
| SELECT | ||
| arrayJoin(t1.ids) AS ids | ||
| FROM way_view AS t1 | ||
| )) AS "InSubquery(id)" | ||
| FROM node_view AS t0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| SELECT | ||
| t0.a AS a, | ||
| t0.b AS b, | ||
| t2.c AS c, | ||
| t2.d AS d, | ||
| t2.c / ( | ||
| t0.a - t0.b | ||
| ) AS e | ||
| FROM s AS t0 | ||
| INNER JOIN t AS t2 | ||
| ON t0.a = t2.c |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| SELECT | ||
| t0.a AS a, | ||
| COALESCE(countIf(NOT ( | ||
| t0.b | ||
| )), 0) AS A, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,17 @@ | ||
| SELECT | ||
| t0.id AS id, | ||
| t0.bool_col AS bool_col, | ||
| t0.tinyint_col AS tinyint_col, | ||
| t0.smallint_col AS smallint_col, | ||
| t0.int_col AS int_col, | ||
| t0.bigint_col AS bigint_col, | ||
| t0.float_col AS float_col, | ||
| t0.double_col AS double_col, | ||
| t0.date_string_col AS date_string_col, | ||
| t0.string_col AS string_col, | ||
| t0.timestamp_col AS timestamp_col, | ||
| t0.year AS year, | ||
| t0.month AS month | ||
| FROM functional_alltypes AS t0 | ||
| WHERE | ||
| t0.string_col IN ('foo', 'bar') |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,17 @@ | ||
| SELECT | ||
| t0.id AS id, | ||
| t0.bool_col AS bool_col, | ||
| t0.tinyint_col AS tinyint_col, | ||
| t0.smallint_col AS smallint_col, | ||
| t0.int_col AS int_col, | ||
| t0.bigint_col AS bigint_col, | ||
| t0.float_col AS float_col, | ||
| t0.double_col AS double_col, | ||
| t0.date_string_col AS date_string_col, | ||
| t0.string_col AS string_col, | ||
| t0.timestamp_col AS timestamp_col, | ||
| t0.year AS year, | ||
| t0.month AS month | ||
| FROM functional_alltypes AS t0 | ||
| INNER JOIN functional_alltypes AS t1 | ||
| ON t0.id = t1.id |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,17 @@ | ||
| SELECT | ||
| t1.key AS key, | ||
| SUM(( | ||
| ( | ||
| t1.value + 1 | ||
| ) + 2 | ||
| ) + 3) AS abc | ||
| FROM ( | ||
| SELECT | ||
| t0.key AS key, | ||
| t0.value AS value | ||
| FROM t0 AS t0 | ||
| WHERE | ||
| t0.value = 42 | ||
| ) AS t1 | ||
| GROUP BY | ||
| t1.key |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,17 @@ | ||
| SELECT | ||
| t1.key AS key, | ||
| SUM(( | ||
| ( | ||
| t1.value + 1 | ||
| ) + 2 | ||
| ) + 3) AS foo | ||
| FROM ( | ||
| SELECT | ||
| t0.key AS key, | ||
| t0.value AS value | ||
| FROM t0 AS t0 | ||
| WHERE | ||
| t0.value = 42 | ||
| ) AS t1 | ||
| GROUP BY | ||
| t1.key |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,26 @@ | ||
| SELECT | ||
| t0.playerID AS playerID, | ||
| t0.yearID AS yearID, | ||
| t0.stint AS stint, | ||
| t0.teamID AS teamID, | ||
| t0.lgID AS lgID, | ||
| t0.G AS G, | ||
| t0.AB AS AB, | ||
| t0.R AS R, | ||
| t0.H AS H, | ||
| t0.X2B AS X2B, | ||
| t0.X3B AS X3B, | ||
| t0.HR AS HR, | ||
| t0.RBI AS RBI, | ||
| t0.SB AS SB, | ||
| t0.CS AS CS, | ||
| t0.BB AS BB, | ||
| t0.SO AS SO, | ||
| t0.IBB AS IBB, | ||
| t0.HBP AS HBP, | ||
| t0.SH AS SH, | ||
| t0.SF AS SF, | ||
| t0.GIDP AS GIDP | ||
| FROM batting AS t0 | ||
| ANY JOIN awards_players AS t2 | ||
| ON t0.playerID = t2.awardID |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,26 @@ | ||
| SELECT | ||
| t0.playerID AS playerID, | ||
| t0.yearID AS yearID, | ||
| t0.stint AS stint, | ||
| t0.teamID AS teamID, | ||
| t0.lgID AS lgID, | ||
| t0.G AS G, | ||
| t0.AB AS AB, | ||
| t0.R AS R, | ||
| t0.H AS H, | ||
| t0.X2B AS X2B, | ||
| t0.X3B AS X3B, | ||
| t0.HR AS HR, | ||
| t0.RBI AS RBI, | ||
| t0.SB AS SB, | ||
| t0.CS AS CS, | ||
| t0.BB AS BB, | ||
| t0.SO AS SO, | ||
| t0.IBB AS IBB, | ||
| t0.HBP AS HBP, | ||
| t0.SH AS SH, | ||
| t0.SF AS SF, | ||
| t0.GIDP AS GIDP | ||
| FROM batting AS t0 | ||
| LEFT ANY JOIN awards_players AS t2 | ||
| ON t0.playerID = t2.awardID |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,26 @@ | ||
| SELECT | ||
| t0.playerID AS playerID, | ||
| t0.yearID AS yearID, | ||
| t0.stint AS stint, | ||
| t0.teamID AS teamID, | ||
| t0.lgID AS lgID, | ||
| t0.G AS G, | ||
| t0.AB AS AB, | ||
| t0.R AS R, | ||
| t0.H AS H, | ||
| t0.X2B AS X2B, | ||
| t0.X3B AS X3B, | ||
| t0.HR AS HR, | ||
| t0.RBI AS RBI, | ||
| t0.SB AS SB, | ||
| t0.CS AS CS, | ||
| t0.BB AS BB, | ||
| t0.SO AS SO, | ||
| t0.IBB AS IBB, | ||
| t0.HBP AS HBP, | ||
| t0.SH AS SH, | ||
| t0.SF AS SF, | ||
| t0.GIDP AS GIDP | ||
| FROM batting AS t0 | ||
| INNER JOIN awards_players AS t2 | ||
| ON t0.playerID = t2.awardID |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,26 @@ | ||
| SELECT | ||
| t0.playerID AS playerID, | ||
| t0.yearID AS yearID, | ||
| t0.stint AS stint, | ||
| t0.teamID AS teamID, | ||
| t0.lgID AS lgID, | ||
| t0.G AS G, | ||
| t0.AB AS AB, | ||
| t0.R AS R, | ||
| t0.H AS H, | ||
| t0.X2B AS X2B, | ||
| t0.X3B AS X3B, | ||
| t0.HR AS HR, | ||
| t0.RBI AS RBI, | ||
| t0.SB AS SB, | ||
| t0.CS AS CS, | ||
| t0.BB AS BB, | ||
| t0.SO AS SO, | ||
| t0.IBB AS IBB, | ||
| t0.HBP AS HBP, | ||
| t0.SH AS SH, | ||
| t0.SF AS SF, | ||
| t0.GIDP AS GIDP | ||
| FROM batting AS t0 | ||
| LEFT OUTER JOIN awards_players AS t2 | ||
| ON t0.playerID = t2.awardID |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,26 @@ | ||
| SELECT | ||
| t0.playerID AS playerID, | ||
| t0.yearID AS yearID, | ||
| t0.stint AS stint, | ||
| t0.teamID AS teamID, | ||
| t0.lgID AS lgID, | ||
| t0.G AS G, | ||
| t0.AB AS AB, | ||
| t0.R AS R, | ||
| t0.H AS H, | ||
| t0.X2B AS X2B, | ||
| t0.X3B AS X3B, | ||
| t0.HR AS HR, | ||
| t0.RBI AS RBI, | ||
| t0.SB AS SB, | ||
| t0.CS AS CS, | ||
| t0.BB AS BB, | ||
| t0.SO AS SO, | ||
| t0.IBB AS IBB, | ||
| t0.HBP AS HBP, | ||
| t0.SH AS SH, | ||
| t0.SF AS SF, | ||
| t0.GIDP AS GIDP | ||
| FROM batting AS t0 | ||
| ANY JOIN awards_players AS t2 | ||
| ON t0.playerID = t2.playerID |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,26 @@ | ||
| SELECT | ||
| t0.playerID AS playerID, | ||
| t0.yearID AS yearID, | ||
| t0.stint AS stint, | ||
| t0.teamID AS teamID, | ||
| t0.lgID AS lgID, | ||
| t0.G AS G, | ||
| t0.AB AS AB, | ||
| t0.R AS R, | ||
| t0.H AS H, | ||
| t0.X2B AS X2B, | ||
| t0.X3B AS X3B, | ||
| t0.HR AS HR, | ||
| t0.RBI AS RBI, | ||
| t0.SB AS SB, | ||
| t0.CS AS CS, | ||
| t0.BB AS BB, | ||
| t0.SO AS SO, | ||
| t0.IBB AS IBB, | ||
| t0.HBP AS HBP, | ||
| t0.SH AS SH, | ||
| t0.SF AS SF, | ||
| t0.GIDP AS GIDP | ||
| FROM batting AS t0 | ||
| LEFT ANY JOIN awards_players AS t2 | ||
| ON t0.playerID = t2.playerID |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,26 @@ | ||
| SELECT | ||
| t0.playerID AS playerID, | ||
| t0.yearID AS yearID, | ||
| t0.stint AS stint, | ||
| t0.teamID AS teamID, | ||
| t0.lgID AS lgID, | ||
| t0.G AS G, | ||
| t0.AB AS AB, | ||
| t0.R AS R, | ||
| t0.H AS H, | ||
| t0.X2B AS X2B, | ||
| t0.X3B AS X3B, | ||
| t0.HR AS HR, | ||
| t0.RBI AS RBI, | ||
| t0.SB AS SB, | ||
| t0.CS AS CS, | ||
| t0.BB AS BB, | ||
| t0.SO AS SO, | ||
| t0.IBB AS IBB, | ||
| t0.HBP AS HBP, | ||
| t0.SH AS SH, | ||
| t0.SF AS SF, | ||
| t0.GIDP AS GIDP | ||
| FROM batting AS t0 | ||
| INNER JOIN awards_players AS t2 | ||
| ON t0.playerID = t2.playerID |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,26 @@ | ||
| SELECT | ||
| t0.playerID AS playerID, | ||
| t0.yearID AS yearID, | ||
| t0.stint AS stint, | ||
| t0.teamID AS teamID, | ||
| t0.lgID AS lgID, | ||
| t0.G AS G, | ||
| t0.AB AS AB, | ||
| t0.R AS R, | ||
| t0.H AS H, | ||
| t0.X2B AS X2B, | ||
| t0.X3B AS X3B, | ||
| t0.HR AS HR, | ||
| t0.RBI AS RBI, | ||
| t0.SB AS SB, | ||
| t0.CS AS CS, | ||
| t0.BB AS BB, | ||
| t0.SO AS SO, | ||
| t0.IBB AS IBB, | ||
| t0.HBP AS HBP, | ||
| t0.SH AS SH, | ||
| t0.SF AS SF, | ||
| t0.GIDP AS GIDP | ||
| FROM batting AS t0 | ||
| LEFT OUTER JOIN awards_players AS t2 | ||
| ON t0.playerID = t2.playerID |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,21 @@ | ||
| SELECT | ||
| SUM(t1.float_col) AS "Sum(float_col)" | ||
| FROM ( | ||
| SELECT | ||
| t0.id AS id, | ||
| t0.bool_col AS bool_col, | ||
| t0.tinyint_col AS tinyint_col, | ||
| t0.smallint_col AS smallint_col, | ||
| t0.int_col AS int_col, | ||
| t0.bigint_col AS bigint_col, | ||
| t0.float_col AS float_col, | ||
| t0.double_col AS double_col, | ||
| t0.date_string_col AS date_string_col, | ||
| t0.string_col AS string_col, | ||
| t0.timestamp_col AS timestamp_col, | ||
| t0.year AS year, | ||
| t0.month AS month | ||
| FROM functional_alltypes AS t0 | ||
| WHERE | ||
| t0.int_col > 0 | ||
| ) AS t1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,28 @@ | ||
| SELECT | ||
| t2.string_col AS string_col | ||
| FROM ( | ||
| SELECT | ||
| t1.string_col AS string_col, | ||
| SUM(t1.float_col) AS total | ||
| FROM ( | ||
| SELECT | ||
| t0.id AS id, | ||
| t0.bool_col AS bool_col, | ||
| t0.tinyint_col AS tinyint_col, | ||
| t0.smallint_col AS smallint_col, | ||
| t0.int_col AS int_col, | ||
| t0.bigint_col AS bigint_col, | ||
| t0.float_col AS float_col, | ||
| t0.double_col AS double_col, | ||
| t0.date_string_col AS date_string_col, | ||
| t0.string_col AS string_col, | ||
| t0.timestamp_col AS timestamp_col, | ||
| t0.year AS year, | ||
| t0.month AS month | ||
| FROM functional_alltypes AS t0 | ||
| WHERE | ||
| t0.int_col > 0 | ||
| ) AS t1 | ||
| GROUP BY | ||
| t1.string_col | ||
| ) AS t2 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,17 @@ | ||
| SELECT | ||
| t0.id AS id, | ||
| t0.bool_col AS bool_col, | ||
| t0.tinyint_col AS tinyint_col, | ||
| t0.smallint_col AS smallint_col, | ||
| t0.int_col AS int_col, | ||
| t0.bigint_col AS bigint_col, | ||
| t0.float_col AS float_col, | ||
| t0.double_col AS double_col, | ||
| t0.date_string_col AS date_string_col, | ||
| t0.string_col AS string_col, | ||
| t0.timestamp_col AS timestamp_col, | ||
| t0.year AS year, | ||
| t0.month AS month | ||
| FROM functional_alltypes AS t0 | ||
| WHERE | ||
| t0.int_col > 0 AND t0.float_col BETWEEN 0 AND 1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| SELECT | ||
| t0.uuid AS uuid, | ||
| minIf(t0.ts, t0.search_level = 1) AS min_date | ||
| FROM t AS t0 | ||
| GROUP BY | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,74 +1,11 @@ | ||
| from __future__ import annotations | ||
|
|
||
| import numpy as np | ||
|
|
||
| from ibis.formats.pandas import PandasData | ||
|
|
||
|
|
||
| class DuckDBPandasData(PandasData): | ||
| @staticmethod | ||
| def convert_Array(s, dtype, pandas_type): | ||
| return s.replace(np.nan, None) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| SELECT | ||
| * | ||
| FROM "functional_alltypes" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| SELECT | ||
| ST_DWITHIN(t0.geom, t0.geom, CAST(3.0 AS DOUBLE)) AS "GeoDWithin(geom, geom, 3.0)" | ||
| FROM t AS t0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| SELECT | ||
| ST_ASTEXT(t0.geom) AS "GeoAsText(geom)" | ||
| FROM t AS t0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| SELECT | ||
| ST_NPOINTS(t0.geom) AS "GeoNPoints(geom)" | ||
| FROM t AS t0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,62 +1,55 @@ | ||
| SELECT | ||
| t5.street AS street, | ||
| t5.key AS key, | ||
| t5.key_right AS key_right | ||
| FROM ( | ||
| SELECT | ||
| t1.street AS street, | ||
| ROW_NUMBER() OVER (ORDER BY t1.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS key, | ||
| t3.key AS key_right | ||
| FROM ( | ||
| SELECT | ||
| t0.street AS street, | ||
| ROW_NUMBER() OVER (ORDER BY t0.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS key | ||
| FROM data AS t0 | ||
| ) AS t1 | ||
| INNER JOIN ( | ||
| SELECT | ||
| t1.key AS key | ||
| FROM ( | ||
| SELECT | ||
| t0.street AS street, | ||
| ROW_NUMBER() OVER (ORDER BY t0.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS key | ||
| FROM data AS t0 | ||
| ) AS t1 | ||
| ) AS t3 | ||
| ON t1.key = t3.key | ||
| ) AS t5 | ||
| INNER JOIN ( | ||
| SELECT | ||
| t5.key AS key | ||
| FROM ( | ||
| SELECT | ||
| t1.street AS street, | ||
| ROW_NUMBER() OVER (ORDER BY t1.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS key, | ||
| t3.key AS key_right | ||
| FROM ( | ||
| SELECT | ||
| t0.street AS street, | ||
| ROW_NUMBER() OVER (ORDER BY t0.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS key | ||
| FROM data AS t0 | ||
| ) AS t1 | ||
| INNER JOIN ( | ||
| SELECT | ||
| t1.key AS key | ||
| FROM ( | ||
| SELECT | ||
| t0.street AS street, | ||
| ROW_NUMBER() OVER (ORDER BY t0.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS key | ||
| FROM data AS t0 | ||
| ) AS t1 | ||
| ) AS t3 | ||
| ON t1.key = t3.key | ||
| ) AS t5 | ||
| ) AS t7 | ||
| ON t5.key = t7.key |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| SELECT | ||
| "t5"."street" AS "street", | ||
| "t5"."key" AS "key", | ||
| "t5"."key_right" AS "key_right" | ||
| FROM ( | ||
| SELECT | ||
| "t1"."street" AS "street", | ||
| ROW_NUMBER() OVER (ORDER BY "t1"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key", | ||
| "t2"."key" AS "key_right" | ||
| FROM ( | ||
| SELECT | ||
| "t0"."street" AS "street", | ||
| ROW_NUMBER() OVER (ORDER BY "t0"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key" | ||
| FROM "data" AS "t0" | ||
| ) AS "t1" | ||
| INNER JOIN ( | ||
| SELECT | ||
| "t1"."key" AS "key" | ||
| FROM ( | ||
| SELECT | ||
| "t0"."street" AS "street", | ||
| ROW_NUMBER() OVER (ORDER BY "t0"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key" | ||
| FROM "data" AS "t0" | ||
| ) AS "t1" | ||
| ) AS "t2" | ||
| ON "t1"."key" = "t2"."key" | ||
| ) AS "t5" | ||
| INNER JOIN ( | ||
| SELECT | ||
| "t5"."key" AS "key" | ||
| FROM ( | ||
| SELECT | ||
| "t1"."street" AS "street", | ||
| ROW_NUMBER() OVER (ORDER BY "t1"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key", | ||
| "t2"."key" AS "key_right" | ||
| FROM ( | ||
| SELECT | ||
| "t0"."street" AS "street", | ||
| ROW_NUMBER() OVER (ORDER BY "t0"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key" | ||
| FROM "data" AS "t0" | ||
| ) AS "t1" | ||
| INNER JOIN ( | ||
| SELECT | ||
| "t1"."key" AS "key" | ||
| FROM ( | ||
| SELECT | ||
| "t0"."street" AS "street", | ||
| ROW_NUMBER() OVER (ORDER BY "t0"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key" | ||
| FROM "data" AS "t0" | ||
| ) AS "t1" | ||
| ) AS "t2" | ||
| ON "t1"."key" = "t2"."key" | ||
| ) AS "t5" | ||
| ) AS "t6" | ||
| ON "t5"."key" = "t6"."key" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,32 +1,55 @@ | ||
| SELECT | ||
| t5.street AS street, | ||
| t5.key AS key, | ||
| t5.key_right AS key_right | ||
| FROM ( | ||
| SELECT | ||
| t1.street AS street, | ||
| ROW_NUMBER() OVER (ORDER BY t1.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - CAST(1 AS TINYINT) AS key, | ||
| t3.key AS key_right | ||
| FROM ( | ||
| SELECT | ||
| t0.street AS street, | ||
| ROW_NUMBER() OVER (ORDER BY t0.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - CAST(1 AS TINYINT) AS key | ||
| FROM data AS t0 | ||
| ) AS t1 | ||
| INNER JOIN ( | ||
| SELECT | ||
| t1.key AS key | ||
| FROM ( | ||
| SELECT | ||
| t0.street AS street, | ||
| ROW_NUMBER() OVER (ORDER BY t0.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - CAST(1 AS TINYINT) AS key | ||
| FROM data AS t0 | ||
| ) AS t1 | ||
| ) AS t3 | ||
| ON t1.key = t3.key | ||
| ) AS t5 | ||
| INNER JOIN ( | ||
| SELECT | ||
| t5.key AS key | ||
| FROM ( | ||
| SELECT | ||
| t1.street AS street, | ||
| ROW_NUMBER() OVER (ORDER BY t1.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - CAST(1 AS TINYINT) AS key, | ||
| t3.key AS key_right | ||
| FROM ( | ||
| SELECT | ||
| t0.street AS street, | ||
| ROW_NUMBER() OVER (ORDER BY t0.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - CAST(1 AS TINYINT) AS key | ||
| FROM data AS t0 | ||
| ) AS t1 | ||
| INNER JOIN ( | ||
| SELECT | ||
| t1.key AS key | ||
| FROM ( | ||
| SELECT | ||
| t0.street AS street, | ||
| ROW_NUMBER() OVER (ORDER BY t0.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - CAST(1 AS TINYINT) AS key | ||
| FROM data AS t0 | ||
| ) AS t1 | ||
| ) AS t3 | ||
| ON t1.key = t3.key | ||
| ) AS t5 | ||
| ) AS t7 | ||
| ON t5.key = t7.key |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,32 +1,55 @@ | ||
| SELECT | ||
| "t5"."street" AS "street", | ||
| "t5"."key" AS "key", | ||
| "t5"."key_right" AS "key_right" | ||
| FROM ( | ||
| SELECT | ||
| "t1"."street" AS "street", | ||
| ROW_NUMBER() OVER (ORDER BY "t1"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key", | ||
| "t3"."key" AS "key_right" | ||
| FROM ( | ||
| SELECT | ||
| "t0"."street" AS "street", | ||
| ROW_NUMBER() OVER (ORDER BY "t0"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key" | ||
| FROM "data" AS "t0" | ||
| ) AS "t1" | ||
| INNER JOIN ( | ||
| SELECT | ||
| "t1"."key" AS "key" | ||
| FROM ( | ||
| SELECT | ||
| "t0"."street" AS "street", | ||
| ROW_NUMBER() OVER (ORDER BY "t0"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key" | ||
| FROM "data" AS "t0" | ||
| ) AS "t1" | ||
| ) AS "t3" | ||
| ON "t1"."key" = "t3"."key" | ||
| ) AS "t5" | ||
| INNER JOIN ( | ||
| SELECT | ||
| "t5"."key" AS "key" | ||
| FROM ( | ||
| SELECT | ||
| "t1"."street" AS "street", | ||
| ROW_NUMBER() OVER (ORDER BY "t1"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key", | ||
| "t3"."key" AS "key_right" | ||
| FROM ( | ||
| SELECT | ||
| "t0"."street" AS "street", | ||
| ROW_NUMBER() OVER (ORDER BY "t0"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key" | ||
| FROM "data" AS "t0" | ||
| ) AS "t1" | ||
| INNER JOIN ( | ||
| SELECT | ||
| "t1"."key" AS "key" | ||
| FROM ( | ||
| SELECT | ||
| "t0"."street" AS "street", | ||
| ROW_NUMBER() OVER (ORDER BY "t0"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key" | ||
| FROM "data" AS "t0" | ||
| ) AS "t1" | ||
| ) AS "t3" | ||
| ON "t1"."key" = "t3"."key" | ||
| ) AS "t5" | ||
| ) AS "t7" | ||
| ON "t5"."key" = "t7"."key" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| SELECT | ||
| t3.key1 AS key1, | ||
| AVG(t3.value1 - t3.value2) AS avg_diff | ||
| FROM ( | ||
| SELECT | ||
| t0.value1 AS value1, | ||
| t0.key1 AS key1, | ||
| t0.key2 AS key2, | ||
| t1.value2 AS value2, | ||
| t1.key1 AS key1_right, | ||
| t1.key4 AS key4 | ||
| FROM table1 AS t0 | ||
| LEFT OUTER JOIN table2 AS t1 | ||
| ON t0.key1 = t1.key1 | ||
| ) AS t3 | ||
| GROUP BY | ||
| 1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,49 +1,40 @@ | ||
| SELECT | ||
| t2.key AS key, | ||
| t3.key AS key_right, | ||
| t6.key_right AS key_right_right | ||
| FROM ( | ||
| SELECT | ||
| t0.key AS key | ||
| FROM leaf AS t0 | ||
| WHERE | ||
| TRUE | ||
| ) AS t2 | ||
| INNER JOIN ( | ||
| SELECT | ||
| t0.key AS key | ||
| FROM leaf AS t0 | ||
| WHERE | ||
| TRUE | ||
| ) AS t3 | ||
| ON t2.key = t3.key | ||
| INNER JOIN ( | ||
| SELECT | ||
| t2.key AS key, | ||
| t3.key AS key_right | ||
| FROM ( | ||
| SELECT | ||
| t0.key AS key | ||
| FROM leaf AS t0 | ||
| WHERE | ||
| TRUE | ||
| ) AS t2 | ||
| INNER JOIN ( | ||
| SELECT | ||
| t0.key AS key | ||
| FROM leaf AS t0 | ||
| WHERE | ||
| TRUE | ||
| ) AS t3 | ||
| ON t2.key = t3.key | ||
| ) AS t6 | ||
| ON t6.key = t6.key |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| SELECT | ||
| "t1"."key" AS "key", | ||
| "t2"."key" AS "key_right", | ||
| "t4"."key_right" AS "key_right_right" | ||
| FROM ( | ||
| SELECT | ||
| * | ||
| FROM "leaf" AS "t0" | ||
| WHERE | ||
| TRUE | ||
| ) AS "t1" | ||
| INNER JOIN ( | ||
| SELECT | ||
| "t1"."key" AS "key" | ||
| FROM ( | ||
| SELECT | ||
| * | ||
| FROM "leaf" AS "t0" | ||
| WHERE | ||
| TRUE | ||
| ) AS "t1" | ||
| ) AS "t2" | ||
| ON "t1"."key" = "t2"."key" | ||
| INNER JOIN ( | ||
| SELECT | ||
| "t1"."key" AS "key", | ||
| "t2"."key" AS "key_right" | ||
| FROM ( | ||
| SELECT | ||
| * | ||
| FROM "leaf" AS "t0" | ||
| WHERE | ||
| TRUE | ||
| ) AS "t1" | ||
| INNER JOIN ( | ||
| SELECT | ||
| "t1"."key" AS "key" | ||
| FROM ( | ||
| SELECT | ||
| * | ||
| FROM "leaf" AS "t0" | ||
| WHERE | ||
| TRUE | ||
| ) AS "t1" | ||
| ) AS "t2" | ||
| ON "t1"."key" = "t2"."key" | ||
| ) AS "t4" | ||
| ON "t1"."key" = "t1"."key" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,40 @@ | ||
| SELECT | ||
| t1.key AS key, | ||
| t2.key AS key_right, | ||
| t5.key_right AS key_right_right | ||
| FROM ( | ||
| SELECT | ||
| t0.key AS key | ||
| FROM leaf AS t0 | ||
| WHERE | ||
| TRUE | ||
| ) AS t1 | ||
| INNER JOIN ( | ||
| SELECT | ||
| t0.key AS key | ||
| FROM leaf AS t0 | ||
| WHERE | ||
| TRUE | ||
| ) AS t2 | ||
| ON t1.key = t2.key | ||
| INNER JOIN ( | ||
| SELECT | ||
| t1.key AS key, | ||
| t2.key AS key_right | ||
| FROM ( | ||
| SELECT | ||
| t0.key AS key | ||
| FROM leaf AS t0 | ||
| WHERE | ||
| TRUE | ||
| ) AS t1 | ||
| INNER JOIN ( | ||
| SELECT | ||
| t0.key AS key | ||
| FROM leaf AS t0 | ||
| WHERE | ||
| TRUE | ||
| ) AS t2 | ||
| ON t1.key = t2.key | ||
| ) AS t5 | ||
| ON t1.key = t5.key |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,40 @@ | ||
| SELECT | ||
| "t1"."key" AS "key", | ||
| "t2"."key" AS "key_right", | ||
| "t5"."key_right" AS "key_right_right" | ||
| FROM ( | ||
| SELECT | ||
| "t0"."key" AS "key" | ||
| FROM "leaf" AS "t0" | ||
| WHERE | ||
| TRUE | ||
| ) AS "t1" | ||
| INNER JOIN ( | ||
| SELECT | ||
| "t0"."key" AS "key" | ||
| FROM "leaf" AS "t0" | ||
| WHERE | ||
| TRUE | ||
| ) AS "t2" | ||
| ON "t1"."key" = "t2"."key" | ||
| INNER JOIN ( | ||
| SELECT | ||
| "t1"."key" AS "key", | ||
| "t2"."key" AS "key_right" | ||
| FROM ( | ||
| SELECT | ||
| "t0"."key" AS "key" | ||
| FROM "leaf" AS "t0" | ||
| WHERE | ||
| TRUE | ||
| ) AS "t1" | ||
| INNER JOIN ( | ||
| SELECT | ||
| "t0"."key" AS "key" | ||
| FROM "leaf" AS "t0" | ||
| WHERE | ||
| TRUE | ||
| ) AS "t2" | ||
| ON "t1"."key" = "t2"."key" | ||
| ) AS "t5" | ||
| ON "t1"."key" = "t5"."key" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| SELECT | ||
| CASE "t0"."continent" | ||
| WHEN 'NA' | ||
| THEN 'North America' | ||
| WHEN 'SA' | ||
| THEN 'South America' | ||
| WHEN 'EU' | ||
| THEN 'Europe' | ||
| WHEN 'AF' | ||
| THEN 'Africa' | ||
| WHEN 'AS' | ||
| THEN 'Asia' | ||
| WHEN 'OC' | ||
| THEN 'Oceania' | ||
| WHEN 'AN' | ||
| THEN 'Antarctica' | ||
| ELSE 'Unknown continent' | ||
| END AS "cont", | ||
| SUM("t0"."population") AS "total_pop" | ||
| FROM "countries" AS "t0" | ||
| GROUP BY | ||
| 1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,9 @@ | ||
| SELECT | ||
| t0.x IN (( | ||
| SELECT | ||
| t0.x AS x | ||
| FROM t AS t0 | ||
| WHERE | ||
| t0.x > 2 | ||
| )) AS "InSubquery(x)" | ||
| FROM t AS t0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| SELECT | ||
| "t0"."x" IN (( | ||
| SELECT | ||
| "t1"."x" AS "x" | ||
| FROM ( | ||
| SELECT | ||
| * | ||
| FROM "t" AS "t0" | ||
| WHERE | ||
| ( | ||
| "t0"."x" > 2 | ||
| ) | ||
| ) AS "t1" | ||
| )) AS "InSubquery(x)" | ||
| FROM "t" AS "t0" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,9 @@ | ||
| SELECT | ||
| t0.x IN (( | ||
| SELECT | ||
| t0.x AS x | ||
| FROM t AS t0 | ||
| WHERE | ||
| t0.x > CAST(2 AS TINYINT) | ||
| )) AS "InSubquery(x)" | ||
| FROM t AS t0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,9 @@ | ||
| SELECT | ||
| "t0"."x" IN (( | ||
| SELECT | ||
| "t0"."x" AS "x" | ||
| FROM "t" AS "t0" | ||
| WHERE | ||
| "t0"."x" > 2 | ||
| )) AS "InSubquery(x)" | ||
| FROM "t" AS "t0" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,94 +1,96 @@ | ||
| SELECT | ||
| t10.field_of_study AS field_of_study, | ||
| t10.diff AS diff | ||
| FROM ( | ||
| SELECT | ||
| t5.field_of_study AS field_of_study, | ||
| t5.diff AS diff | ||
| FROM ( | ||
| SELECT | ||
| t4.field_of_study AS field_of_study, | ||
| any(t4.diff) AS diff | ||
| FROM ( | ||
| SELECT | ||
| t3.field_of_study AS field_of_study, | ||
| t3.years AS years, | ||
| t3.degrees AS degrees, | ||
| t3.earliest_degrees AS earliest_degrees, | ||
| t3.latest_degrees AS latest_degrees, | ||
| t3.latest_degrees - t3.earliest_degrees AS diff | ||
| FROM ( | ||
| SELECT | ||
| t2.field_of_study AS field_of_study, | ||
| t2.years AS years, | ||
| t2.degrees AS degrees, | ||
| any(t2.degrees) OVER (PARTITION BY t2.field_of_study ORDER BY t2.years ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS earliest_degrees, | ||
| anyLast(t2.degrees) OVER (PARTITION BY t2.field_of_study ORDER BY t2.years ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS latest_degrees | ||
| FROM ( | ||
| SELECT | ||
| t1.field_of_study AS field_of_study, | ||
| CAST(t1.__pivoted__.1 AS Nullable(String)) AS years, | ||
| CAST(t1.__pivoted__.2 AS Nullable(Int64)) AS degrees | ||
| FROM ( | ||
| SELECT | ||
| t0.field_of_study AS field_of_study, | ||
| arrayJoin( | ||
| [CAST(tuple('1970-71', t0."1970-71") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('1975-76', t0."1975-76") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('1980-81', t0."1980-81") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('1985-86', t0."1985-86") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('1990-91', t0."1990-91") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('1995-96', t0."1995-96") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2000-01', t0."2000-01") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2005-06', t0."2005-06") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2010-11', t0."2010-11") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2011-12', t0."2011-12") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2012-13', t0."2012-13") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2013-14', t0."2013-14") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2014-15', t0."2014-15") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2015-16', t0."2015-16") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2016-17', t0."2016-17") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2017-18', t0."2017-18") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2018-19', t0."2018-19") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2019-20', t0."2019-20") AS Tuple(years Nullable(String), degrees Nullable(Int64)))] | ||
| ) AS __pivoted__ | ||
| FROM humanities AS t0 | ||
| ) AS t1 | ||
| ) AS t2 | ||
| ) AS t3 | ||
| ) AS t4 | ||
| GROUP BY | ||
| t4.field_of_study | ||
| ) AS t5 | ||
| ORDER BY | ||
| t5.diff DESC | ||
| LIMIT 10 | ||
| UNION ALL | ||
| SELECT | ||
| t5.field_of_study AS field_of_study, | ||
| t5.diff AS diff | ||
| FROM ( | ||
| SELECT | ||
| t4.field_of_study AS field_of_study, | ||
| any(t4.diff) AS diff | ||
| FROM ( | ||
| SELECT | ||
| t3.field_of_study AS field_of_study, | ||
| t3.years AS years, | ||
| t3.degrees AS degrees, | ||
| t3.earliest_degrees AS earliest_degrees, | ||
| t3.latest_degrees AS latest_degrees, | ||
| t3.latest_degrees - t3.earliest_degrees AS diff | ||
| FROM ( | ||
| SELECT | ||
| t2.field_of_study AS field_of_study, | ||
| t2.years AS years, | ||
| t2.degrees AS degrees, | ||
| any(t2.degrees) OVER (PARTITION BY t2.field_of_study ORDER BY t2.years ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS earliest_degrees, | ||
| anyLast(t2.degrees) OVER (PARTITION BY t2.field_of_study ORDER BY t2.years ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS latest_degrees | ||
| FROM ( | ||
| SELECT | ||
| t1.field_of_study AS field_of_study, | ||
| CAST(t1.__pivoted__.1 AS Nullable(String)) AS years, | ||
| CAST(t1.__pivoted__.2 AS Nullable(Int64)) AS degrees | ||
| FROM ( | ||
| SELECT | ||
| t0.field_of_study AS field_of_study, | ||
| arrayJoin( | ||
| [CAST(tuple('1970-71', t0."1970-71") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('1975-76', t0."1975-76") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('1980-81', t0."1980-81") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('1985-86', t0."1985-86") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('1990-91', t0."1990-91") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('1995-96', t0."1995-96") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2000-01', t0."2000-01") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2005-06', t0."2005-06") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2010-11', t0."2010-11") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2011-12', t0."2011-12") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2012-13', t0."2012-13") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2013-14', t0."2013-14") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2014-15', t0."2014-15") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2015-16', t0."2015-16") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2016-17', t0."2016-17") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2017-18', t0."2017-18") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2018-19', t0."2018-19") AS Tuple(years Nullable(String), degrees Nullable(Int64))), CAST(tuple('2019-20', t0."2019-20") AS Tuple(years Nullable(String), degrees Nullable(Int64)))] | ||
| ) AS __pivoted__ | ||
| FROM humanities AS t0 | ||
| ) AS t1 | ||
| ) AS t2 | ||
| ) AS t3 | ||
| ) AS t4 | ||
| GROUP BY | ||
| t4.field_of_study | ||
| ) AS t5 | ||
| WHERE | ||
| t5.diff < 0 | ||
| ORDER BY | ||
| t5.diff ASC | ||
| LIMIT 10 | ||
| ) AS t10 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,75 +1,96 @@ | ||
| SELECT | ||
| t10.field_of_study AS field_of_study, | ||
| t10.diff AS diff | ||
| FROM ( | ||
| SELECT | ||
| t5.field_of_study AS field_of_study, | ||
| t5.diff AS diff | ||
| FROM ( | ||
| SELECT | ||
| t4.field_of_study AS field_of_study, | ||
| FIRST(t4.diff) AS diff | ||
| FROM ( | ||
| SELECT | ||
| t3.field_of_study AS field_of_study, | ||
| t3.years AS years, | ||
| t3.degrees AS degrees, | ||
| t3.earliest_degrees AS earliest_degrees, | ||
| t3.latest_degrees AS latest_degrees, | ||
| t3.latest_degrees - t3.earliest_degrees AS diff | ||
| FROM ( | ||
| SELECT | ||
| t2.field_of_study AS field_of_study, | ||
| t2.years AS years, | ||
| t2.degrees AS degrees, | ||
| FIRST(t2.degrees) OVER (PARTITION BY t2.field_of_study ORDER BY t2.years ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS earliest_degrees, | ||
| LAST(t2.degrees) OVER (PARTITION BY t2.field_of_study ORDER BY t2.years ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS latest_degrees | ||
| FROM ( | ||
| SELECT | ||
| t1.field_of_study AS field_of_study, | ||
| t1.__pivoted__['years'] AS years, | ||
| t1.__pivoted__['degrees'] AS degrees | ||
| FROM ( | ||
| SELECT | ||
| t0.field_of_study AS field_of_study, | ||
| UNNEST( | ||
| [{'years': '1970-71', 'degrees': t0."1970-71"}, {'years': '1975-76', 'degrees': t0."1975-76"}, {'years': '1980-81', 'degrees': t0."1980-81"}, {'years': '1985-86', 'degrees': t0."1985-86"}, {'years': '1990-91', 'degrees': t0."1990-91"}, {'years': '1995-96', 'degrees': t0."1995-96"}, {'years': '2000-01', 'degrees': t0."2000-01"}, {'years': '2005-06', 'degrees': t0."2005-06"}, {'years': '2010-11', 'degrees': t0."2010-11"}, {'years': '2011-12', 'degrees': t0."2011-12"}, {'years': '2012-13', 'degrees': t0."2012-13"}, {'years': '2013-14', 'degrees': t0."2013-14"}, {'years': '2014-15', 'degrees': t0."2014-15"}, {'years': '2015-16', 'degrees': t0."2015-16"}, {'years': '2016-17', 'degrees': t0."2016-17"}, {'years': '2017-18', 'degrees': t0."2017-18"}, {'years': '2018-19', 'degrees': t0."2018-19"}, {'years': '2019-20', 'degrees': t0."2019-20"}] | ||
| ) AS __pivoted__ | ||
| FROM humanities AS t0 | ||
| ) AS t1 | ||
| ) AS t2 | ||
| ) AS t3 | ||
| ) AS t4 | ||
| GROUP BY | ||
| 1 | ||
| ) AS t5 | ||
| ORDER BY | ||
| t5.diff DESC | ||
| LIMIT 10 | ||
| UNION ALL | ||
| SELECT | ||
| t5.field_of_study AS field_of_study, | ||
| t5.diff AS diff | ||
| FROM ( | ||
| SELECT | ||
| t4.field_of_study AS field_of_study, | ||
| FIRST(t4.diff) AS diff | ||
| FROM ( | ||
| SELECT | ||
| t3.field_of_study AS field_of_study, | ||
| t3.years AS years, | ||
| t3.degrees AS degrees, | ||
| t3.earliest_degrees AS earliest_degrees, | ||
| t3.latest_degrees AS latest_degrees, | ||
| t3.latest_degrees - t3.earliest_degrees AS diff | ||
| FROM ( | ||
| SELECT | ||
| t2.field_of_study AS field_of_study, | ||
| t2.years AS years, | ||
| t2.degrees AS degrees, | ||
| FIRST(t2.degrees) OVER (PARTITION BY t2.field_of_study ORDER BY t2.years ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS earliest_degrees, | ||
| LAST(t2.degrees) OVER (PARTITION BY t2.field_of_study ORDER BY t2.years ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS latest_degrees | ||
| FROM ( | ||
| SELECT | ||
| t1.field_of_study AS field_of_study, | ||
| t1.__pivoted__['years'] AS years, | ||
| t1.__pivoted__['degrees'] AS degrees | ||
| FROM ( | ||
| SELECT | ||
| t0.field_of_study AS field_of_study, | ||
| UNNEST( | ||
| [{'years': '1970-71', 'degrees': t0."1970-71"}, {'years': '1975-76', 'degrees': t0."1975-76"}, {'years': '1980-81', 'degrees': t0."1980-81"}, {'years': '1985-86', 'degrees': t0."1985-86"}, {'years': '1990-91', 'degrees': t0."1990-91"}, {'years': '1995-96', 'degrees': t0."1995-96"}, {'years': '2000-01', 'degrees': t0."2000-01"}, {'years': '2005-06', 'degrees': t0."2005-06"}, {'years': '2010-11', 'degrees': t0."2010-11"}, {'years': '2011-12', 'degrees': t0."2011-12"}, {'years': '2012-13', 'degrees': t0."2012-13"}, {'years': '2013-14', 'degrees': t0."2013-14"}, {'years': '2014-15', 'degrees': t0."2014-15"}, {'years': '2015-16', 'degrees': t0."2015-16"}, {'years': '2016-17', 'degrees': t0."2016-17"}, {'years': '2017-18', 'degrees': t0."2017-18"}, {'years': '2018-19', 'degrees': t0."2018-19"}, {'years': '2019-20', 'degrees': t0."2019-20"}] | ||
| ) AS __pivoted__ | ||
| FROM humanities AS t0 | ||
| ) AS t1 | ||
| ) AS t2 | ||
| ) AS t3 | ||
| ) AS t4 | ||
| GROUP BY | ||
| 1 | ||
| ) AS t5 | ||
| WHERE | ||
| t5.diff < CAST(0 AS TINYINT) | ||
| ORDER BY | ||
| t5.diff ASC | ||
| LIMIT 10 | ||
| ) AS t10 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,7 @@ | ||
| SELECT DISTINCT | ||
| * | ||
| FROM ( | ||
| SELECT | ||
| t0.string_col AS string_col | ||
| FROM functional_alltypes AS t0 | ||
| ) AS t1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1 @@ | ||
| t0.int_col + CAST(4 AS TINYINT) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1 @@ | ||
| t0.int_col + CAST(4 AS TINYINT) AS foo |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,14 @@ | ||
| SELECT | ||
| t1.string_col AS string_col, | ||
| COUNT(DISTINCT t1.int_col) AS nunique | ||
| FROM ( | ||
| SELECT | ||
| * | ||
| FROM functional_alltypes AS t0 | ||
| WHERE | ||
| ( | ||
| t0.bigint_col > CAST(0 AS TINYINT) | ||
| ) | ||
| ) AS t1 | ||
| GROUP BY | ||
| 1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,29 @@ | ||
| SELECT | ||
| t5.key AS key | ||
| FROM ( | ||
| SELECT | ||
| t1.string_col AS key, | ||
| CAST(t1.float_col AS DOUBLE) AS value | ||
| FROM ( | ||
| SELECT | ||
| * | ||
| FROM functional_alltypes AS t0 | ||
| WHERE | ||
| ( | ||
| t0.int_col > CAST(0 AS TINYINT) | ||
| ) | ||
| ) AS t1 | ||
| EXCEPT | ||
| SELECT | ||
| t2.string_col AS key, | ||
| t2.double_col AS value | ||
| FROM ( | ||
| SELECT | ||
| * | ||
| FROM functional_alltypes AS t0 | ||
| WHERE | ||
| ( | ||
| t0.int_col <= CAST(0 AS TINYINT) | ||
| ) | ||
| ) AS t2 | ||
| ) AS t5 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,28 @@ | ||
| SELECT | ||
| t3.b AS b, | ||
| t3.sum AS sum | ||
| FROM ( | ||
| SELECT | ||
| * | ||
| FROM ( | ||
| SELECT | ||
| t1.b AS b, | ||
| SUM(t1.a) AS sum, | ||
| MAX(t1.a) AS "Max(a)" | ||
| FROM ( | ||
| SELECT | ||
| * | ||
| FROM t AS t0 | ||
| WHERE | ||
| ( | ||
| t0.b = 'm' | ||
| ) | ||
| ) AS t1 | ||
| GROUP BY | ||
| 1 | ||
| ) AS t2 | ||
| WHERE | ||
| ( | ||
| t2."Max(a)" = CAST(2 AS TINYINT) | ||
| ) | ||
| ) AS t3 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,20 @@ | ||
| SELECT | ||
| t2.string_col AS string_col, | ||
| t2."CountStar()" AS "CountStar()" | ||
| FROM ( | ||
| SELECT | ||
| * | ||
| FROM ( | ||
| SELECT | ||
| t0.string_col AS string_col, | ||
| COUNT(*) AS "CountStar()", | ||
| MAX(t0.double_col) AS "Max(double_col)" | ||
| FROM functional_alltypes AS t0 | ||
| GROUP BY | ||
| 1 | ||
| ) AS t1 | ||
| WHERE | ||
| ( | ||
| t1."Max(double_col)" = CAST(1 AS TINYINT) | ||
| ) | ||
| ) AS t2 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,29 @@ | ||
| SELECT | ||
| t5.key AS key | ||
| FROM ( | ||
| SELECT | ||
| t1.string_col AS key, | ||
| CAST(t1.float_col AS DOUBLE) AS value | ||
| FROM ( | ||
| SELECT | ||
| * | ||
| FROM functional_alltypes AS t0 | ||
| WHERE | ||
| ( | ||
| t0.int_col > CAST(0 AS TINYINT) | ||
| ) | ||
| ) AS t1 | ||
| INTERSECT | ||
| SELECT | ||
| t2.string_col AS key, | ||
| t2.double_col AS value | ||
| FROM ( | ||
| SELECT | ||
| * | ||
| FROM functional_alltypes AS t0 | ||
| WHERE | ||
| ( | ||
| t0.int_col <= CAST(0 AS TINYINT) | ||
| ) | ||
| ) AS t2 | ||
| ) AS t5 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,7 @@ | ||
| SELECT | ||
| t0.string_col AS string_col, | ||
| COUNT(DISTINCT t0.int_col) AS int_card, | ||
| COUNT(DISTINCT t0.smallint_col) AS smallint_card | ||
| FROM functional_alltypes AS t0 | ||
| GROUP BY | ||
| 1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,18 @@ | ||
| SELECT | ||
| * | ||
| FROM functional_alltypes AS t0 | ||
| WHERE | ||
| ( | ||
| t0.double_col > CAST(3.14 AS DOUBLE) | ||
| ) | ||
| AND CONTAINS(t0.string_col, 'foo') | ||
| AND ( | ||
| ( | ||
| ( | ||
| t0.int_col - CAST(1 AS TINYINT) | ||
| ) = CAST(0 AS TINYINT) | ||
| ) | ||
| OR ( | ||
| t0.float_col <= CAST(1.34 AS DOUBLE) | ||
| ) | ||
| ) |