Re: Record path API chooses CHOICE[STRING, RECORD] when the field is missing

2019-07-30 Thread Mike Thomsen
It was JsonTreeReader. Thanks, Mike On Mon, Jul 29, 2019 at 3:36 PM Mark Payne wrote: > Mike, > > What Record Reader is being used here? The problem appears to be due to > the Record Reader itself assigning that as the field type. > > I created a dummy unit test to verify the RecordPath stuff

Re: Record path API chooses CHOICE[STRING, RECORD] when the field is missing

2019-07-29 Thread Mark Payne
Mike, What Record Reader is being used here? The problem appears to be due to the Record Reader itself assigning that as the field type. I created a dummy unit test to verify the RecordPath stuff is correct: @Test public void testFromEmail() { final List fields = new ArrayList<>();

Re: Record path API chooses CHOICE[STRING, RECORD] when the field is missing

2019-07-28 Thread Mike Thomsen
Doesn't explain WHY it happened, but I was able to resolve it like this: Optional _temp = fieldValue.getParentRecord().get().getSchema().getField(fieldValue.getField().getFieldName()); RecordField _rf = _temp.get(); value = DataTypeUtils.convertType(value, _rf.getDataType(), _rf.getFieldName());

Record path API chooses CHOICE[STRING, RECORD] when the field is missing

2019-07-28 Thread Mike Thomsen
I have a simple avro schema in a test case that looks like this: { "type": "record", "name": "PersonRecord", "fields": [ { "name": "firstName", "type": "string" }, { "name": "lastName", "type": "string" }, { "name": "creationDateTime", "type": [ "null", "type":