BigQuery Data.ErrorProto.Reason"已停止"

RCa*_*laf 7 google-bigquery

我正在插入数据insertAll()DataInsertAllRespone.InsertErrors返回我插入的每一行的相同错误.

这些错误只会给我这个领域

**Data.ErrorProto.Reason** which contains: **"stopped"**.

这是调用insertAll()的方法:

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;
}
Run Code Online (Sandbox Code Playgroud)

怎么了?为什么无法上传数据?

*编辑:*我意识到,如果我上传少于6行正常工作,但行大小约为1.6 Kb,最大行大小为20Kb.

谢谢,罗杰

RCa*_*laf 11

好吧,几天前我找到了解决方案.使用insertAll()方法将数据流式传输到BigQuery时,可以一次流式传输多行.如果其中一行是错误的,Data.ErrorProto.Reason包含此错误的消息,例如,"无法将值转换为字符串".其他行在Data.ErrorProto.Reason中包含"stopped" .

如果您看到此错误,可能是行格式存在不一致

谢谢和问候,罗杰