Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow complex types to be null when transforming to payload format #1318

Merged
merged 1 commit into from
Jul 6, 2020

Conversation

relud
Copy link
Contributor

@relud relud commented Jul 6, 2020

fixes #1317

@relud relud requested a review from jklukas July 6, 2020 19:41
updateParent(parent, jsonFieldName, bqFieldName, value);

// A record of key and value indicates we need to transformForBqSchema a map to an array.
} else if (isMapType(field)) {
expandMapType(jsonFieldName, (ObjectNode) value, field, parent, additionalProperties);
Copy link
Contributor Author

@relud relud Jul 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the exception in #1317 is thrown by this line trying to cast a literal null to ObjectNode here.

This PR fixes that by allowing null for any value passed to processField, which I believe is called on every type that is not an element of a list.

The resulting behavior omits the field, which BigQuery will interpret as an empty list if necessary.

@relud relud merged commit 593f0db into master Jul 6, 2020
@relud relud deleted the allow-null-map branch July 6, 2020 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ingestion-sink undeliverable message: java.lang.ClassCastException: null
2 participants