下表中只有两列(ts 和 transaction_id)和 3 行。我只是尝试创建基于时间戳列的分区表,但收到错误消息。
create table myfirstdataset.partition_table1(ts timestamp, transaction_id int64)partition by ts as
select timestamp '2013-12-31 01:55:02.000 UTC' ts, 10 transaction_id union all
select timestamp '2013-12-31 02:10:02.000 UTC' ts, 5 transaction_id union all
select timestamp '2013-12-31 04:20:02.000 UTC' ts, 6 transaction_id
Error: PARTITION BY expression must be DATE(<timestamp_column>) or else a DATE column
Run Code Online (Sandbox Code Playgroud) 如何在结构体数组中排列数组中的元素?
with races as(
select "800m" race, "Rudisha" name,23.4 s1, 26.3 s2, 26.4 s3, 26.1 s4 union all
select "800m" race, "Makhloufi" name,24.5 , 25.4, 26.6, 26.1 union all
select "800m" race, "Murphy" name,23.9, 26.0, 27.0, 26.0 union all
select "800m" race, "Bosse" name,23.6, 26.2, 26.5, 27.1 union all
select "800m" race, "Rotich" name,24.7, 25.6, 26.9, 26.4 union all
select "800m" race, "Lewandowski" name,25.0, 25.7, 26.3, 27.2 union all
select "800m" race, "Kipketer" name,23.2, 26.1, 27.3, 29.4 union all
select …Run Code Online (Sandbox Code Playgroud)