Created
February 13, 2022 15:27
-
-
Save FurcyPin/3e4e467d5f79cdf034aa6ee3ccb4a122 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
bq = BigQueryBuilder(get_bq_client()) | |
df = bq.sql('''SELECT 1 as id, STRUCT(1 as a, STRUCT(1 as c, 1 as d) as b) as s''') | |
df.printSchema() | |
# root | |
# |-- id: INTEGER (NULLABLE) | |
# |-- s: RECORD (NULLABLE) | |
# | |-- a: INTEGER (NULLABLE) | |
# | |-- b: RECORD (NULLABLE) | |
# | | |-- c: INTEGER (NULLABLE) | |
# | | |-- d: INTEGER (NULLABLE) | |
flatten(df).printSchema() | |
# root | |
# |-- id: INTEGER (NULLABLE) | |
# |-- s_a: INTEGER (NULLABLE) | |
# |-- s_b_c: INTEGER (NULLABLE) | |
# |-- s_b_d: INTEGER (NULLABLE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment