You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by Mike Thomsen <mi...@gmail.com> on 2019/02/13 14:55:44 UTC

QueryRecord fails on nullable records

I have a pretty simple statement like this:

SELECT * FROM FLOWFILE WHERE action = 'X'

We have a long field that is nullable ( ["null", "long"] so we're clear)
and QueryRecord throws an exception saying that it couldn't handle a null
in that field.


NullPointerException: null of long in field [name] of
org.apache.nifi.nifiRecord

Am I missing something here?

Thanks,

Mike

Re: QueryRecord fails on nullable records

Posted by Mark Payne <ma...@hotmail.com>.
Thanks. Unfortunately, I am not able to replicate locally, running master. Any chance that you have a recent build of master
that you can use to try to replicate? There were quite a few changes this time around for the record API in order to support
schema inference, etc.

On Feb 13, 2019, at 10:46 AM, Mike Thomsen <mi...@gmail.com>> wrote:

Schema access strategy is inherit record schema and the version is 1.8.

Thanks,

Mike

On Wed, Feb 13, 2019 at 10:37 AM Mark Payne <ma...@hotmail.com>> wrote:
Mike,

That should fine. The NullPointerException seems to be coming from the Avro Writer. I presume that's what you are using as the Writer?
What do you have set as the Avro Writer's Schema Access Strategy? What version of NiFi are you running?

Thanks
-Mark


> On Feb 13, 2019, at 9:55 AM, Mike Thomsen <mi...@gmail.com>> wrote:
>
> I have a pretty simple statement like this:
>
> SELECT * FROM FLOWFILE WHERE action = 'X'
>
> We have a long field that is nullable ( ["null", "long"] so we're clear) and QueryRecord throws an exception saying that it couldn't handle a null in that field.
>
>
> NullPointerException: null of long in field [name] of org.apache.nifi.nifiRecord
>
> Am I missing something here?
>
> Thanks,
>
> Mike



Re: QueryRecord fails on nullable records

Posted by Mike Thomsen <mi...@gmail.com>.
Schema access strategy is inherit record schema and the version is 1.8.

Thanks,

Mike

On Wed, Feb 13, 2019 at 10:37 AM Mark Payne <ma...@hotmail.com> wrote:

> Mike,
>
> That should fine. The NullPointerException seems to be coming from the
> Avro Writer. I presume that's what you are using as the Writer?
> What do you have set as the Avro Writer's Schema Access Strategy? What
> version of NiFi are you running?
>
> Thanks
> -Mark
>
>
> > On Feb 13, 2019, at 9:55 AM, Mike Thomsen <mi...@gmail.com>
> wrote:
> >
> > I have a pretty simple statement like this:
> >
> > SELECT * FROM FLOWFILE WHERE action = 'X'
> >
> > We have a long field that is nullable ( ["null", "long"] so we're clear)
> and QueryRecord throws an exception saying that it couldn't handle a null
> in that field.
> >
> >
> > NullPointerException: null of long in field [name] of
> org.apache.nifi.nifiRecord
> >
> > Am I missing something here?
> >
> > Thanks,
> >
> > Mike
>
>

Re: QueryRecord fails on nullable records

Posted by Mark Payne <ma...@hotmail.com>.
Mike,

That should fine. The NullPointerException seems to be coming from the Avro Writer. I presume that's what you are using as the Writer?
What do you have set as the Avro Writer's Schema Access Strategy? What version of NiFi are you running?

Thanks
-Mark


> On Feb 13, 2019, at 9:55 AM, Mike Thomsen <mi...@gmail.com> wrote:
> 
> I have a pretty simple statement like this:
> 
> SELECT * FROM FLOWFILE WHERE action = 'X'
> 
> We have a long field that is nullable ( ["null", "long"] so we're clear) and QueryRecord throws an exception saying that it couldn't handle a null in that field.
> 
> 
> NullPointerException: null of long in field [name] of org.apache.nifi.nifiRecord
> 
> Am I missing something here?
> 
> Thanks,
> 
> Mike