当我从子选择中选择并最终想要对结果进行"不在"时,BQ查询会给出以下错误:
Error: Join attribute is not defined: t1.customer_id
当我用一个简单where t1.customer_id = 1的例子更改"not in"部分时,查询将执行.
查询看起来不像是一个连接,但是从错误中,BigQuery似乎认为它是.
select t1.customer_id , GROUP_CONCAT(t1.id) from (
select customer.id as customer_id, id
from (TABLE_QUERY(redacted , 'table_id in ( "x_201502", "x_201503")'))
where created >= '2014-09-05 00:00:00'
and created < '2015-03-04 00:00:00'
group by customer_id, id
) t1
where t1.customer_id not in (
select customer.id as customer_id
from (TABLE_QUERY(redacted , 'table_id in ("y_201503")'))
where created >= '2015-03-03 18:55:59'
group by customer_id
)
group by t1.customer_id;
Run Code Online (Sandbox Code Playgroud)
我最初试图在子选择中放入"not in"子选择,但BQ也为该方法投掷了错误,因此我尝试了这个构造.请注意,当跟随2个子选择的连接时,"not …
已完成的 BigQuery 作业返回的 stats.query.totalSlotMs 值有何含义?除了表明一项工作相对于另一项工作的相对成本外,尚不清楚人们还应该如何解释这一数字。例如,槽毫秒数与给定项目的堆栈驱动程序报告的总槽使用量(需要保持在 2000 以下以实现按需 BigQuery 使用)有何关系?
这些文档有点简洁(“[仅输出]作业的时隙毫秒数。”)