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

Support json arrays #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sbaldwin-rs
Copy link
Contributor

Adds support for parsing JSON arrays with multiple values

@sbaldwin-rs sbaldwin-rs force-pushed the sbaldwin_json_array_support branch from 0f136fb to de7031d Compare April 7, 2022 01:14
@sbaldwin-rs sbaldwin-rs force-pushed the sbaldwin_json_array_support branch from de7031d to c9d4332 Compare April 7, 2022 16:35
@sbaldwin-rs sbaldwin-rs marked this pull request as ready for review April 7, 2022 19:09
@sbaldwin-rs
Copy link
Contributor Author

Just tested to confirm this works. The _id don't conflict because each batch is assigned an _id, then a suffix is used to denote the position in the list of the batch write.

@@ -70,10 +71,7 @@ public Map<String, Object> parseValue(SinkRecord record) {
log.warn(message, cause);
throw new RuntimeException(message, e);
}

int size = maps.size();
checkArgument(size == 1, "Only 1 object allowed in list type messages. Found %s", size);

Choose a reason for hiding this comment

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

Just curious, why do we even have this constraint before?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

An additional backend change is required if there is more than one document in the payload.

@sbaldwin-rs
Copy link
Contributor Author

I will hold off on merging until backend changes are ready.

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.

3 participants