小编Mar*_*ima的帖子

通过 BigQuery 库发送的时间戳对象返回错误“此字段不是记录”

当将日期字段作为对象发送到类型为时间戳的 BigQuery 表时,Google Java API 库不会引发异常,但不会出现数据着陆。检查“InsertAllResponse”响应类型返回包括错误“此字段不是记录”。

例如

Hashmap<String,Object> rowContent = new Hashmap<>();
rowContent.put("Time", new Date());
rowContent.put("Name", "Harry");
Run Code Online (Sandbox Code Playgroud)

进而

BigQuery bq = BigQueryOptions.getDefaultInstance().getService();
TableId tableId = TableId.of(datasetName, tableName);
InsertAllRequest.Builder insertReqBuilder = InsertAllRequest.newBuilder(tableId);
insertReqBuilder.addRow({some string}, row);
InsertAllResponse response = bigquery.insertAll(insertReqBuilder.build());
Run Code Online (Sandbox Code Playgroud)

返回一个response.hasErrors() true。

还报告了python 这里firebase 这里javascript 这里

datetime google-bigquery

3
推荐指数
1
解决办法
3899
查看次数

标签 统计

datetime ×1

google-bigquery ×1