You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "exceptionfactory (via GitHub)" <gi...@apache.org> on 2025/10/06 16:31:33 UTC
Re: [PR] NIFI-15001 - Fix PutElasticsearchRecord with recursive reads [nifi]
exceptionfactory commented on code in PR #10334:
URL: https://github.com/apache/nifi/pull/10334#discussion_r2407331846
##########
nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/PutElasticsearchRecord.java:
##########
@@ -420,22 +423,28 @@ public void onTrigger(final ProcessContext context, final ProcessSession session
try (final InputStream inStream = session.read(input);
final RecordReader reader = readerFactory.createRecordReader(input, inStream, getLogger())) {
final PushBackRecordSet recordSet = new PushBackRecordSet(reader.createRecordSet());
+ final RecordSchema recordSchema = reader.getSchema();
final List<IndexOperationRequest> operationList = new ArrayList<>();
- final List<Record> originals = new ArrayList<>();
+ final List<Record> processedRecords = new ArrayList<>();
+ final List<Record> originalRecords = new ArrayList<>();
Record record;
while ((record = recordSet.next()) != null) {
- addOperation(operationList, record, indexOperationParameters, indices, types);
- originals.add(record);
+ final Record originalRecord = cloneRecord(record);
+ final Record processedRecord = cloneRecord(record);
Review Comment:
Is it necessary to make two clones of the original `record`?
--
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.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org