Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Default Value Error by JsonTreeReader on using InferAvroSchema generated schema

Solved Go to solution
Highlighted

Default Value Error by JsonTreeReader on using InferAvroSchema generated schema

New Contributor
{
	"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

Accepted Solutions

Re: Default Value Error by JsonTreeReader on using InferAvroSchema generated schema

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.

2 REPLIES 2

Re: Default Value Error by JsonTreeReader on using InferAvroSchema generated schema

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.

Re: Default Value Error by JsonTreeReader on using InferAvroSchema generated schema

New Contributor

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

Don't have an account?
Coming from Hortonworks? Activate your account here