*Hi Bejoy,* * * *Thanks for your reply !* * * *I had already thought of replacing NULLS with "NULL" strings, but that seems a bit overkill especially when you have lots of columns and you have to remember to do the CASE WHEN ... THEN ... ELSE everytime.* * * *I was thinking there should be a way, maybe with some Hive properties, or serde properties which would allow to change this NULL representation for your queries at runtime or when you define your table, do you know if something like that exists? I haven't looked at the code yet but I was assuming that the NULL representation isn't just hard-coded, but that it should be tied to a parameter somewhere.* * * *I'll probably go with your solution if there is no parameter to control the NULL representation, but that would be a really nice feature to have the ability to control that.* * * *Thanks,* * * *Charles Menguy*
On Fri, Sep 7, 2012 at 3:06 AM, Bejoy KS <bejoy...@yahoo.com> wrote: > Hi Charles > > You may need to replace the NULLS with 'NULL' string . > > INSERT OVERWRITE staging_table > SELECT ... > CASE WHEN clmn_1 IS NULL THEN "NULL" else clmn_1 > ... > > > Thank You > > > Regards, > Bejoy KS > > > > ________________________________ > From: Charles Menguy <menguy.char...@gmail.com> > To: user@hive.apache.org > Sent: Friday, September 7, 2012 4:29 AM > Subject: Changing Hive default representation of nulls from \N to > something else > > > Hi guys, > > I am trying to load some data extracts from Hive into a Netezza database, > but am having a few issues with null values. > > To make a long story short, Netezza won't allow me to interpret the > default "\N" representation from hive as nulls without some ugly hacks, so > "\N" just ends up as a string. > > I also think it makes more sense to do this on the extract side in Hive, > so I'm trying to figure out a way to tell Hive for example to represent > nulls as NULL and not \N. > > I haven't been able to find anything on the topic, but I would assume this > is related to the serde. > > Did anyone encounter a similar use case or know a way to change this > default value? > > Thanks ! > > Charles Menguy >