You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Pierre Villard (Jira)" <ji...@apache.org> on 2026/01/05 10:36:08 UTC
[jira] [Resolved] (NIFI-7435) JoltTransformReccord throws ClassCastException
[ https://issues.apache.org/jira/browse/NIFI-7435?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pierre Villard resolved NIFI-7435.
----------------------------------
Resolution: Feedback Received
Apache NiFi 1.x is no longer maintained and no new release is planned on the 1.x release line. Marking as resolved as part of a cleanup operation. Please open a new one with an updated description if this is still relevant for NiFi 2.x.
> JoltTransformReccord throws ClassCastException
> ----------------------------------------------
>
> Key: NIFI-7435
> URL: https://issues.apache.org/jira/browse/NIFI-7435
> Project: Apache NiFi
> Issue Type: Bug
> Components: Extensions
> Affects Versions: 1.11.4
> Reporter: Pavel
> Priority: Minor
> Attachments: Snímek z 2020-05-08 21-33-08.png
>
>
> I would like to implement a user case as shown in the picture in the attachment:
> !Snímek z 2020-05-08 21-33-08.png|width=936,height=181!
> If the records are non-empty, everything works.
> However, if I first send first empty and then filled in, an exception is raised. In reverse order it works.
> Even manual schema setup for the input JsonTreeReader did not help.
>
> Test use case:
> input flowfile:
> {code:java}
> [{
> "CODE_ONE":null,
> "CODE_TWO":null
> },
> {
> "CODE_ONE":"a",
> "CODE_TWO":null
> }]{code}
> {{jolt:}}
> {code:java}
> [
> {
> "operation": "shift",
> "spec": {
> "CODE_*": "CODES",
> "*": "&"
> }
> }
> ]
> {code}
> log:
> JoltTransformRecord[id=f596e13d-0171-1000-7957-5abd51aa5ea0] Failed to write MapRecord[\{CODES=[Ljava.lang.Object;@6589e3eb}] with schema ["CODES" : "ARRAY[STRING]"] as a JSON Object due to java.lang.ClassCastException: null
>
> JoltTransformRecord[id=f596e13d-0171-1000-7957-5abd51aa5ea0] Unable to transform StandardFlowFileRecord[uuid=db74cbdf-673b-4af4-ae3e-cab5915aa46e,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1588966927548-947, container=default, section=947], offset=766896, length=120],offset=0,name=db74cbdf-673b-4af4-ae3e-cab5915aa46e,size=120] due to java.lang.ClassCastException: null
--
This message was sent by Atlassian Jira
(v8.20.10#820010)