Bigquery Java库会强制对一行的所有字段进行checkEntryNotNull检查,即使不是架构中的字段也是如此

时间:2018-07-03 13:56:53

标签: google-bigquery

Bigquery insertAll操作正在检查插入的行中的字段,该字段在架构中不存在。我已经将setIgnoreUnknownValues设置为true,并且还将setSkipInvalidRows设置为true。

这是Trace的异常,

java.lang.NullPointerException: null value in entry: xyz=null at com.google.common.collect.CollectPreconditions.checkEntryNotNull(CollectPreconditions.java:33)
~[bqstream.jar:?] at com.google.common.collect.RegularImmutableMap.fromEntryArray(RegularImmutableMap.java:69)
~[bqstream.jar:?] at com.google.common.collect.RegularImmutableMap.fromEntries(RegularImmutableMap.java:46)
~[bqstream.jar:?] at com.google.common.collect.ImmutableMap.copyOf(ImmutableMap.java:354)
~[bqstream.jar:?] at com.google.common.collect.ImmutableMap.copyOf(ImmutableMap.java:327)
~[bqstream.jar:?] at com.google.cloud.bigquery.InsertAllRequest$RowToInsert.<init>(InsertAllRequest.java:81)
~[bqstream.jar:?] at com.google.cloud.bigquery.InsertAllRequest$RowToInsert.of(InsertAllRequest.java:141)
~[bqstream.jar:?] at com.XXXXXXXXXX.bqstream.data.Data.lambda$getData$0(Data.java:46)
~[bqstream.jar:?] at java.util.ArrayList.forEach(Unknown Source)
~[?:1.8.0_141] at com.XXXXXXXXXX.bqstream.data.Data.getData(Data.java:34)
 [bqstream.jar:?] at com.XXXXXXXXXX.bqstream.BatchProcessor.apply(BatchProcessor.java:22)
 [bqstream.jar:?] at com.XXXXXXXXXX.mdaolib.controller.BatchOutHandler.run(BatchOutHandler.java:35)
 [bqstream.jar:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
 [?:1.8.0_141] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 [?:1.8.0_141] at java.lang.Thread.run(Unknown Source)
 [?:1.8.0_141]

在查看了InsertAll的代码之后,似乎在要插入的行上执行了一些Preconditons调用。但是,为什么对架构中未提供的数据执行相同的操作。

0 个答案:

没有答案