Uploading CSV for Impala

13,707

Solution 1

/user/hadoop/Gc_4 must be a directory. So you need to create a directory, for example, /user/hadoop/Gc_4. Then you upload your Gc_4 to it. So the file path is /user/hadoop/Gc_4/Gc_4. After that, you can use LOCATION to specify the directory path /user/hadoop/Gc_4.

LOCATION must be a directory. This requirement is same in Hive and Impala.

Solution 2

It's not the answer but a workaround.

In most cases I have seen that the table uploaded but the "status" was not successful. Also if you have stored the data with the help of Hive which gives you more control then "Don't forget to REFRESH the metadata on Impala UI." .Very Important.

Share:
13,707
LonelySoul
Author by

LonelySoul

Still wondering whether Robot will surpass us and make us their slave...

Updated on July 28, 2022

Comments

  • LonelySoul
    LonelySoul almost 2 years

    I am trying to upload the csv file on HDFS for Impala and failing many time. Not sure what is wrong here as I have followed the guide. And the csv is also on HDFS.

     CREATE EXTERNAL TABLE gc_imp 
                     (
                      asd INT,
                      full_name STRING,
                      sd_fd_date STRING,
                      ret INT,
                      ftyu INT,
                      qwerINT
                      ) 
    ROW FORMAT DELIMITED FIELDS TERMINATED BY','
    LOCATION '/user/hadoop/Gc_4';
    

    Error which I am getting. And I am using Hue for it.

    > TExecuteStatementResp(status=TStatus(errorCode=None,
    > errorMessage='MetaException: hdfs://nameservice1/user/hadoop/Gc_4 is
    > not a directory or unable to create one', sqlState='HY000',
    > infoMessages=None, statusCode=3), operationHandle=None)
    

    Any lead.

  • LonelySoul
    LonelySoul over 10 years
    I did it but it seems that my problem is still there. Is it because I am using Hue in comparison to shell commands.
  • LonelySoul
    LonelySoul over 10 years
    Also does it matter if I am using extension csv. The docs suggests that it won't but I am suspicious.