我正在使用(see here)将我们的数据存储日志加载到大查询(BQ),并且将数据存储区实体导出到大查询运行正常但是我在流式数据中遇到大查询。错误指向BigQueryIngester.java的相关行:
response = bigquery.tabledata().insertAll(projectId, datasetId, tableId, content).execute();
提出NullPointerException
,我不知道出了什么问题。有人可以给我一个提示
Uncaught exception from servlet java.lang.NullPointerException at
com.fasterxml.jackson.core.json.UTF8JsonGenerator._writeFieldName(UTF8JsonGenerator.java:289)
at
com.fasterxml.jackson.core.json.UTF8JsonGenerator.writeFieldName(UTF8JsonGenerator.java:179)
at
com.google.api.client.json.jackson2.JacksonGenerator.writeFieldName(JacksonGenerator.java:73)
at
com.google.api.client.json.JsonGenerator.serialize(JsonGenerator.java:171)
at
com.google.api.client.json.JsonGenerator.serialize(JsonGenerator.java:172)
at
com.google.api.client.json.JsonGenerator.serialize(JsonGenerator.java:145)
at
com.google.api.client.json.JsonGenerator.serialize(JsonGenerator.java:172)
at
com.google.api.client.json.JsonGenerator.serialize(JsonGenerator.java:106)
at
com.google.api.client.http.json.JsonHttpContent.writeTo(JsonHttpContent.java:78)
at
com.google.api.client.http.GZipEncoding.encode(GZipEncoding.java:49)
at
com.google.api.client.http.HttpEncodingStreamingContent.writeTo(HttpEncodingStreamingContent.java:51)
at com.google.api.client.util.IOUtils.computeLength(IOUtils.java:113)
at
com.google.api.client.http.HttpRequest.execute(HttpRequest.java:917)
at
com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:410)
at
com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:343)
at
com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:460)
at
com.streak.logging.utils.BigqueryIngester.streamingRowIngestion(BigqueryIngester.java:54)
at
com.streak.logging.analysis.LogExportDirectToBigqueryTask.doGet(LogExportDirectToBigqueryTask.java:178)
答案 0 :(得分:1)
看起来错误在于写入json请求中的一个字段名称。你的行可能有问题。可能是您具有不可解析的嵌套数据,或者您具有名称 - 对象映射的缺失键。你能打印一个例子并将其添加到问题或你的pastebin链接吗?