Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google bigquery BigQuery Data.ErrorProto.Reason“;“停止”;_Google Bigquery - Fatal编程技术网

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;
}