Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive >> mail # user >> Changing Hive default representation of nulls from \N to something else


Copy link to this message
-
Re: Changing Hive default representation of nulls from \N to something else
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 <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
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   
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB