Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.9.2
Description
I used FetchElasticsearchHttp processor to fetch documents in Elasticsearch which have special UTF-8 chars, eg.: characters of foreign languages: accented chars or Japanese/Chinese chars.
It was working as expected on platforms that have UTF-8 as a default file.encoding. But on e.g.: SLES12 VM, the special chars in the document, turned to "?" in the fetched, output flow files.
Taking a look at the source code showed:
- AbstractElasticsearchProcessor declares CHARSET property descriptor, but it was not added to
AbstractElasticsearchHttpProcessor in the static initializer block.
- and in the place where the content of the document is written to the flowfile, : https://github.com/apache/nifi/blob/65c41ab917d7b5f323aa71d841cc03b29e12d480/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/main/java/org/apache/nifi/processors/elasticsearch/FetchElasticsearchHttp.java#L237 it uses
out.write(source.toString().getBytes());
which will only work if the JVM's file.encoding is UTF-8.
Attachments
Attachments
Issue Links
- links to