简体   繁体   English

BigQuery:部分表数据“无法将 NUMERIC 类型的字段读取为 INT64 字段”

[英]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.

相关问题 不能将 r.Condition.AgeInDays(int64 类型的变量)用作结构文字中的 *int64 类型 - cannot use r.Condition.AgeInDays (variable of type int64) as type *int64 in struct literal 不支持的变量类型:STRUCT<int64></int64> - Unsupported variable type: STRUCT<INT64> bigquery 错误:“无法将‘41.66666667’解析为 INT64” - bigquery error: "Could not parse '41.66666667' as INT64" BigQuery - operator = 参数类型没有匹配的签名:INT64,STRING - BigQuery - No matching signature for operator = for argument types: INT64, STRING Terraform 使用模式创建 BigQuery 表 - 错误:json:无法将数组解组为 Go 字符串类型的结构字段 TableFieldSchema.type - Terraform BigQuery table creeation with schema - Error: json: cannot unmarshal array into Go struct field TableFieldSchema.type of type string 如何将 pandas float64 类型转换为 NUMERIC Bigquery 类型? - How to convert pandas float64 type to NUMERIC Bigquery type? BigQuery 无法将“null”解析为字段的 int - BigQuery Could not parse 'null' as int for field Bigquery - 自定义字段中的数据验证 - Bigquery - Data Validation in custom field mk 操作中的 BigQuery 错误:读取表时出错...“无法将分区键 &lt; &gt;(类型:TYPE_INT64)添加到架构 - BigQuery error in mk operation: Error while reading table... "failed to add partition key < > (type: TYPE_INT64) to schema 当我将 int64 类型号写入 function 时,返回不同的数字 - When I write an int64 type number to the function, a different number is returned
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM