Support Questions

Find answers, ask questions, and share your expertise

Impala was not able to query hive table with column type date

avatar
Explorer

Hi,

 

I have successfully created a table in Hive by ingesting a CSV file, but I cannot query this table with Impala which does not recognize the column with the data type "date":

Create table elections (
  id string,
  name string,
  dt date)
    row format delimited 
    fields terminated by ','
    stored as textfile;

LOAD DATA LOCAL INPATH "/home/cloudera/datasets/vox/elections.csv" overwrite INTO TABLE elections ;

I was able to successfully query that table in hive. Below the result of describe within each query editor:

HIVE

deschive.png

 

IMPALA

descimpala.png

 

Would you be able to explain that difference ? I'm using Hive version 1.1.0 and Impala version 2.3.0

 

Thanks

1 ACCEPTED SOLUTION

avatar
Super Collaborator

Not sure this is the latest documentation for Impala but the Hive "Date" type is not supported in Impala.

Use TIMESTAMP instead for example.

 

Check "Impala supported data types" in google. (Sorry I can't paste the url I don't know why).

 

 

View solution in original post

1 REPLY 1

avatar
Super Collaborator

Not sure this is the latest documentation for Impala but the Hive "Date" type is not supported in Impala.

Use TIMESTAMP instead for example.

 

Check "Impala supported data types" in google. (Sorry I can't paste the url I don't know why).