1

I am trying to set values on BigQuery table using java big query api but its throwing NullPointerException (java.lang.NullPointerException: null value in entry: popup=null ) every time I send the null value.

The null value should be completely acceptable since my Mode is NULLABLE on schema itself. I have bunch of other fields that have null value on them.

Any suggestion on this issue would be really helpful for me, I am stuck no where due to this.

Note : I may ignore and not set those fields having null values on them but that is not the solution I am looking for. My piece of code is below:

TableRow row = new TableRow();
                row.set("ip", "test");
                row.set("popup", null);

1 Answer 1

4

Don't explicitly set the value to null. Simply ignore it. If it's not present in the payload to BigQuery, it will be set to null. You will not be able to set it to null anyway, because the API is checking for null parameters, and you can't change that behaviour.

So, do this instead:

TableRow row = new TableRow();
row.set("ip", "test");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.