NIFI-12536: This closes #8178. Used proper method for converting byte array to String

Signed-off-by: Joseph Witt <joewitt@apache.org>
This commit is contained in:
Mark Payne 2023-12-21 10:41:14 -05:00 committed by Joseph Witt
parent 1f54d5d1fc
commit 2897618635
No known key found for this signature in database
GPG Key ID: 9093BF854F811A1A

View File

@ -177,7 +177,7 @@ class ParseDocument(FlowFileTransform):
input_format = context.getProperty(self.INPUT_FORMAT).evaluateAttributeExpressions(flowFile).getValue()
if input_format == PLAIN_TEXT:
return [Document(page_content=str(flowFile.getContentsAsBytes()), metadata=metadata)]
return [Document(page_content=flowFile.getContentsAsBytes().decode('utf-8'), metadata=metadata)]
element_strategy = context.getProperty(self.ELEMENT_STRATEGY).getValue()
if element_strategy == SINGLE_DOCUMENT: