Support Questions
Find answers, ask questions, and share your expertise

Remove null values from hive table

Explorer

I created table from hive and add some data using txt file.

when i check the below command it shows me last 4 lines are null.

hive> select * from txnrecords;

84    05-26-2011    4006771    41.0    39    Exercise & Fitness    Machine Weight Accessories    Singapore    Changi
85    05-26-2011    4006771    41.0    39    Exercise & Fitness    Machine Weight Accessories    Singapore    Changi
NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL
NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL
NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL
NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL

1) How can i remove these null values?

2 REPLIES 2

Re: Remove null values from hive table

Mentor

@Aruna Sameera can you paste a sample txt file you are using as well as your Hive DDL statement.

Re: Remove null values from hive table

Expert Contributor

I think you have extra white spaces/line breaks at the end of file.