I’m trying to insert data with INSERT INTO function, but one little part keep me stuck. Here is my query:
<code>INSERT INTO mydataset (event_date, event_name, event_params)
VALUES
('20221016', 'test', [STRUCT('key' AS key, STRUCT('NULL' AS string_value, NULL AS int_value, 12.34 AS float_value, NULL AS double_value)
)
]
);
</code>
<code>INSERT INTO mydataset (event_date, event_name, event_params)
VALUES
('20221016', 'test', [STRUCT('key' AS key, STRUCT('NULL' AS string_value, NULL AS int_value, 12.34 AS float_value, NULL AS double_value)
)
]
);
</code>
INSERT INTO mydataset (event_date, event_name, event_params)
VALUES
('20221016', 'test', [STRUCT('key' AS key, STRUCT('NULL' AS string_value, NULL AS int_value, 12.34 AS float_value, NULL AS double_value)
)
]
);
I got this error message: Cannot be inserted into column event_params, which has type ARRAY<STRUCT<key STRING, value STRUCT<string_value STRING, int_value INT64, float value FLOAT64, …>>>
problem part is value STRUCT. How I get value thing before STRUCT?
Schema
New contributor
Hegetsu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.