[英]BigQuery: "Cannot read field of type NUMERIC as INT64 Field" for part of table data
I was trying to update BQ table schema by performing:我试图通过执行以下操作来更新 BQ 表架构:
CREATE TABLE {TABLE_WITH_NEW_SCHEMA} ... AS SELECT ... FROM {TABLE_WITH_OLD_SCHEMA}
While doing that I am receiving error:这样做时我收到错误:
Cannot read field of type NUMERIC as INT64 Field {field_name}
While inspecting schema current type of field is INTEGER
.在检查模式时,字段的当前类型是
INTEGER
。 I tried to extract data with select for multiple timespans from table and it seems like only part of data is affected by this issue - queries with particular start_date
/ end_date
are returning data, and some are raising mentioned exception.我尝试使用 select 从表中提取多个时间跨度的数据,似乎只有部分数据受此问题影响 - 具有特定
start_date
/ end_date
的查询正在返回数据,有些正在引发上述异常。
I tried to export data to GC Bucket, but job fails with same error.我尝试将数据导出到 GC Bucket,但作业因同样的错误而失败。
Question: Is there a ways to fix table schema/error or at least extract data from table into new table so reason of this error is fixed?问题:有没有办法修复表架构/错误,或者至少将表中的数据提取到新表中,从而解决此错误的原因?
UPDATE更新
I already tried @ammar-tech suggestion to cast data:我已经尝试过@ammar-tech 建议来投射数据:
SELECT CAST({field_name} AS INT64) ... FROM {TABLE_NAME}
and I am getting same error.我得到了同样的错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.