You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/04/23 09:26:18 UTC

[GitHub] [beam] echauchot commented on a change in pull request #10433: [BEAM-5192] Add support for Elasticsearch v7 in ElasticsearchIO

echauchot commented on a change in pull request #10433:
URL: https://github.com/apache/beam/pull/10433#discussion_r413658743



##########
File path: sdks/java/io/elasticsearch/src/main/java/org/apache/beam/sdk/io/elasticsearch/ElasticsearchIO.java
##########
@@ -1317,8 +1341,10 @@ private String getDocumentMetadata(String document) throws IOException {
                   spec.getTypeFn() != null ? spec.getTypeFn().apply(parsedDocument) : null,
                   spec.getIdFn() != null ? spec.getIdFn().apply(parsedDocument) : null,
                   spec.getUsePartialUpdate() ? DEFAULT_RETRY_ON_CONFLICT : null);
+          SimpleModule module = new SimpleModule();
+          module.addSerializer(DocumentMetadata.class, new DocumentMetadataSerializer());
+          OBJECT_MAPPER.registerModule(module);

Review comment:
       Correct, thanks for pointing out, it should not be done for every element processed




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org