【发布时间】:2020-12-29 16:32:37
【问题描述】:
我们需要将时间戳列存储在 PST 中,并且正在使用同一列对表进行分区。我看到虽然我已将列值转换为 PST,但 BigQuery 仍显示 UTC 时区。
有什么方法可以将数据存储在 UTC 以外的时区?这是我用来创建此列的方法。
public static Timestamp getTimestampInPST() {
ZonedDateTime nowPST = ZonedDateTime.ofInstant(Instant.now(), TimeZone.getTimeZone("PST").toZoneId());
return Timestamp.valueOf(nowPST.toLocalDateTime());
}
【问题讨论】:
-
您能分享您收到的完整错误消息吗?另外,表是否已经创建?你也可以分享架构吗?
标签: google-bigquery