Google bigquery 将unix时间戳转换为avro并存储在BigQuery中

Google bigquery 将unix时间戳转换为avro并存储在BigQuery中,google-bigquery,avro,Google Bigquery,Avro,Avro模式: { "name": "Entity", "type": "record", "namespace": "com.foobar.entity", "fields": [ { "name": "attribute", "type": "string" }, { "name": "value", "type": "int" }, { "name": "timestamp"

Avro模式:

{
  "name": "Entity",
  "type": "record",
  "namespace": "com.foobar.entity",
  "fields": [
    {
      "name": "attribute",
      "type": "string"
    },
    {
      "name": "value",
      "type": "int"
    },
    {
      "name": "timestamp",
      "type": { "type": "long", "logicalType": "timestamp-micros" }
    }
  ]
}
源时间戳为Unix格式,精度为毫秒

当我将这些记录放入BigQuery时,我会在BigQuery数据预览中获得类似于
1970-01-19 01:18:19.415 UTC
的值。但是,我存储的值是
1559899418
,即
7月7日星期五。2019年6月09:23:38
。你知道为什么吗


参考资料:

您的时间戳被关闭了1000倍。实际上,
1559899418
对应于7月7日星期五。2019年6月09:23:38,但这是秒精度(),不是毫秒。 而
1559899
(1559899418的千分之一)确实对应于
1970-01-19 01:18:19