Google bigquery BigQuery Data.ErrorProto.Reason“;“停止”;
我正在使用Google bigquery BigQuery Data.ErrorProto.Reason“;“停止”;,google-bigquery,Google Bigquery,我正在使用insertAll()插入数据,但是DataInsertAllRespone.InsertErrors返回我插入的每一行的相同错误 错误只给了我字段 **Data.ErrorProto.Reason**其中包含:**“已停止”** 这是调用insertAll()的方法: public bool InsertAll(BigqueryService s、字符串datasetId、字符串tableId、列表数据) { TabledataResource t=s.Tabledata; Tabl
insertAll()
插入数据,但是DataInsertAllRespone.InsertErrors
返回我插入的每一行的相同错误
错误只给了我字段
**Data.ErrorProto.Reason**其中包含:**“已停止”**
这是调用insertAll()的方法:
public bool InsertAll(BigqueryService s、字符串datasetId、字符串tableId、列表数据)
{
TabledataResource t=s.Tabledata;
TableDataInsertAllRequest req=新的TableDataInsertAllRequest()
{
Kind=“bigquery#tableDataInsertAllRequest”,
Rows=data/*Posar aqíles每个pujar al-BigQuery文件*/
};
TableDataInsertAllResponse=t.InsertAll(req,projectId,datasetId,tableId).Execute();
if(response.InsertErrors!=null)返回true;
返回false;
}
会发生什么?为什么不能上传数据
*编辑:*我意识到,如果上传的行数少于6行,则可以正常工作,但行大小约为1,6KB,最大行大小为20Kb
谢谢,
罗杰好吧,几天前我找到了解决办法。使用insertAll()方法将数据流式传输到BigQuery时,可以一次流式传输多行数据。如果这些行中有一行错误Data.ErrorProto.Reason包含此错误的消息,例如,“无法将值转换为字符串”。其他行包含Data.ErrorProto.Reason中的“stopped” 如果您看到此错误,可能是因为行格式不一致 感谢和问候,
罗杰你能粘贴更多的代码以便我们复制吗?谢谢分享解决方案!(在您之前找不到原因)
public bool InsertAll(BigqueryService s, String datasetId, String tableId, List<TableDataInsertAllRequest.RowsData> data)
{
TabledataResource t = s.Tabledata;
TableDataInsertAllRequest req = new TableDataInsertAllRequest()
{
Kind = "bigquery#tableDataInsertAllRequest",
Rows = data /*Posar aquí les files per pujar al BigQuery*/
};
TableDataInsertAllResponse response = t.InsertAll(req, projectId, datasetId, tableId).Execute();
if (response.InsertErrors != null) return true;
return false;
}