Jean-Pierre Milhau created NIFI-10957:
-----------------------------------------

             Summary: JsonTreeReader: schema inference gives wrong result
                 Key: NIFI-10957
                 URL: https://issues.apache.org/jira/browse/NIFI-10957
             Project: Apache NiFi
          Issue Type: Bug
    Affects Versions: 1.19.0, 1.16.3
            Reporter: Jean-Pierre Milhau


I am using the JsonTreeReader with the schema access strategy set to Infer 
schema.

 

For the following data in input:
{code:java}
{"alt": 12}
{"alt": null}{code}
the inferred schema gives field "alt" as a nullable INT, what is good.

 

But for the following data in input:
{code:java}
{"location": {"alt": 12}}
{"location": {"alt": null}}{code}
the inferred schema gives field "alt" (inside record "location") as a nullable 
CHOICE(STRING, INT), what seems to me incorrect because there is no string 
value for field "alt". I am expecting field "alt" as a nullable INT as when it 
is on the root of the json document.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to