What is the syntax for creating table statement with struct fields? Below doesn't seem to work. I want to create a Record field such as id.level1.level2.level3
.
CREATE TABLE mayumi_load_test.struct_cre(
STRUCT<STRUCT<STRUCT<STRUCT<id INT64> level1> level2>level3,
t_ TIMESTAMP
)
PARTITION BY Date(t_)
Below is for BigQuery Standard SQL
Create Table
#standardSQL
CREATE TABLE mayumi_load_test.struct_cre (
id STRUCT<level1 STRUCT<level2 STRUCT<level3 INT64>>>,
t_ TIMESTAMP
)
PARTITION BY DATE(t_)
Insert Data
#standardSQL
INSERT INTO mayumi_load_test.struct_cre(id, t_)
VALUES(
STRUCT(STRUCT(STRUCT(777))),
CURRENT_TIMESTAMP()
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With