Quantcast
Channel: Hortonworks » All Topics
Viewing all articles
Browse latest Browse all 5121

date field gave result as a NULL

$
0
0

Replies: 0

I have created 2 tables belos is the schema:

create external table test_date(
first_date DATE,last_date DATE,name string)
row format delimited
fields terminated by ‘|’
location ‘/data/test_date';

create external table part_test_date(
last_date DATE,name string)
PARTITIONED by (first_date date)
STORED AS ORC
location ‘/ORC/test_date';

I used below command to add some data into partitioned table.
insert overwrite table part_test_date partition(first_date) select
last_date,name,first_date
from test_date where first_date between ‘2014-10-01′ and ‘2014-10-15′;

When I use below query the data is retrived in a correctly.
select * from part_test_date where first_date between ‘2014-10-01′ and ‘2014-10-15′;
But when i fire below query I get result as a NULL.
select first_date from part_test_date where first_date between ‘2014-10-01′ and ‘2014-10-15′;
NULL
NULL
NULL
NULL
NULL
NULL

Please let me know what is wrong here.


Viewing all articles
Browse latest Browse all 5121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>