BigQuery表装饰对比AppEngine RequestLog时间戳
问题描述:
我想在BigQuery中的AppEngine RequestLog表之一中使用表装饰器范围。根据文档日志条目是LogEntry https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry类型的对象。BigQuery表装饰对比AppEngine RequestLog时间戳
有两列timestamp和receiveTimestamp。第一列描述为“发生日志条目描述的事件发生的时间”,第二列描述为“Stackdriver日志记录收到日志条目的时间”。
我试图比较表查询表中使用时间戳列和表修饰器范围的时间范围和记录数。
查询我在哪里使用时间戳列。
SELECT count(*), MIN(timestamp), max(timestamp)
FROM [project_id:dataset.appengine_googleapis_com_request_log_20170622]
WHERE timestamp between timestamp('2017-06-22 01:00:00') and
date_add(timestamp('2017-06-22 01:00:00'), 1, 'hour')
查询结果。
1698320 | 2017-06-22 01:00:00 UTC | 2017-06-22 01:59:59 UTC
查询我在哪里使用table decorator范围。
--select timestamp_to_msec(timestamp('2017-06-22 01:00:00')) as time1,
timestamp_to_msec(date_add(timestamp('2017-06-22 01:00:00'), 1, 'hour')) as time2
SELECT count(*), min(timestamp), max(timestamp)
FROM [project_id:[email protected]000-1498096800000]
查询结果。
1534754 | 2017-06-22 00:40:45 UTC | 2017-06-22 01:35:59 UTC
我没有得到相同的日期范围和相同数量的记录。这三个时间戳各是什么意思?以及table decorators范围如何在引擎盖下工作? (BigQuery是否创建了表的快照)
答
表装饰器doc enter link description here解释说它使用snapshot.But它“在表中引用表的快照” - 意味着数据被摄入到bigquery中的时间。但是这与表格中的时间戳字段完全无关,因为这些字段表示相关事件发生的时间,而不是该字段被摄入bigquery的时间。