0

Just a simple question, I'm new in Impala.

I want to load data from the HDFS to my datalake using impala.

So I have a csv this_is_my_data.csv and what I want to do is load the file without specify all the extension, I mean something like the following:

LOAD DATA INPATH 'user/myuser/this_is.* INTO TABLE my_table

This is, a string starting with this_is and whatever follows.

If you need some additional information, please let me know. Thanks in advance.

Henry Navarro
  • 943
  • 8
  • 34

1 Answers1

0

The documentation says:

You can specify the HDFS path of a single file to be moved, or the HDFS path of a directory to move all the files inside that directory. You cannot specify any sort of wildcard to take only some of the files from a directory.

The workaround is to put your files into table directory using mv or cp command. Check your table directory using DESCRIBE FORMATTED command and run mv or cp command (in a shell, not Impala of course):

hdfs dfs -mv "user/myuser/this_is.*" "/user/cloudera/mytabledir"

Or put files you need to load into some directory first then load all the directory.

leftjoin
  • 36,950
  • 8
  • 57
  • 116