【发布时间】:2021-10-21 19:07:48
【问题描述】:
我正在尝试使用以下命令在 BigQuery 中创建一个表。在我的原始数据集中,“customDimensions”是一个包含 2 个子字段的嵌套列:值和索引。在我的查询中,我想要一个 where 条件来过滤掉带有 customDimensions.value IS NOT NULL 的记录。但是,在我的输出数据中,仍然有 PCF_CUST_ID 为空的记录。为什么我的 where 条件不起作用?
create table `putput_folder.output_data` as
select visitId
,(select value FROM t.customDimensions where index = 4) AS PCF_CUST_ID
from `input_folder.input_data_*` as t, UNNEST(customDimensions) as customDimensions
where _TABLE_SUFFIX between '20210101' and '20210131' and customDimensions.value is not null
order by visitId;
【问题讨论】:
标签: google-bigquery nested where-clause