Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Default Value Error by JsonTreeReader on using InferAvroSchema generated schema

avatar
New Member
{
	"name": "userAgreement",
        "type": [
        	"null",
                "boolean"
                ],
         "default": null
}

This is the schema for one of the fields of my json data, auto-generated using InferAvroSchema processor.

The field 'userAgreement is an optional field, and when missing the value should be set to null. So the schema seems to be generated correctly. However, on partitioning this data using PartitionRecord processor, the JsonTreeReader throws this error.

..will route to failure: org.apache.nifi.schema.access.SchemaNotFoundException: 
java.lang.IllegalArgumentException: Cannot set the deafult value for field 'userAgreement' to [org.apache.avro.JsonProperties$Null@5d0e5e41] because this is not a valid value for Data Type [Boolean]

Any ideas what's going wrong?

1 ACCEPTED SOLUTION

avatar
Master Guru

This should be resolved in Apache NiFi 1.4.0 and HDF 3.1...

https://issues.apache.org/jira/browse/NIFI-4029

The title of the issue refers to Hortonworks Schema Registry, but it was a general problem when using a default value of null.

View solution in original post

2 REPLIES 2

avatar
Master Guru

This should be resolved in Apache NiFi 1.4.0 and HDF 3.1...

https://issues.apache.org/jira/browse/NIFI-4029

The title of the issue refers to Hortonworks Schema Registry, but it was a general problem when using a default value of null.

avatar
New Member

Thanks a lot Bryan! I had been pulling my hair out for days now over this.