Last active
April 8, 2020 04:29
-
-
Save laclefyoshi/d41d06ce669178285ff5c61d24054e37 to your computer and use it in GitHub Desktop.
テーブル名と同じカラム名のカラムがあるテーブルに対するPostgresqlとBigQueryの結果の差異
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
WITH a AS ( SELECT 1 AS a, 2 AS b ) | |
SELECT a FROM a ; | |
-- result:: | |
-- | Row | a.a | a.b | | |
-- | 1 | 1 | 2 | | |
-- result (json):: | |
-- [ | |
-- { | |
-- "a": { | |
-- "a": "1", | |
-- "b": "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
WITH a AS ( SELECT 1 AS a, 2 AS b ) | |
SELECT a FROM a ; | |
-- result:: | |
-- a | |
-- --- | |
-- 1 | |
-- (1 row) |
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
-- https://github.com/apstndb/zetasql-sandbox | |
-- $ echo "WITH a AS ( SELECT 1 AS a, 2 AS b ) SELECT a FROM a ;"| docker run -i --rm zetasql-sandbox analyze-print | |
WITH | |
a AS ( | |
SELECT | |
1 AS a_1, | |
2 AS a_2 | |
) | |
SELECT | |
STRUCT< a INT64, b INT64 > (withrefscan_3.a_1, withrefscan_3.a_2) AS a | |
FROM | |
a AS withrefscan_3; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment