Database Reference
In-Depth Information
Commands for loading data into Impala
tables
This section covers activity to load data into Impala tables in two steps. First step
moves the file, which we have created previously, from the local filesystem to HDFS.
In the second step, the data is transferred into Impala tables, from the source file loc-
ated on HDFS.
HDFS specific commands
Now we will make sure that the preceding files are located in our Linux files system
as follows:
[cloudera@localhost ~]$ ls -l *.txt
-rw-rw-r-- 1 cloudera cloudera 985 Oct 15 18:48
automobiles.txt
-rw-rw-r-- 1 cloudera cloudera 932 Oct 15 18:49
motorcycles.txt
Our next step is to move these files from the local filesystem to HDFS in separate
folders. Depending on your Hadoop version, you can use either Hadoop fs or hdfs
dfs ; however, I have used hdfs dfs as follows:
[cloudera@localhost ~]$ hdfs dfs -mkdir /user/
cloudera/automobiles
[cloudera@localhost ~]$ hdfs dfs -mkdir /user/
cloudera/motorcycles
[cloudera@localhost ~]$ hdfs dfs -ls /user/
cloudera/
Found 2 items
drwxr-xr-x - cloudera cloudera 0
2013-10-15 19:16 /user/cloudera/automobiles
drwxr-xr-x - cloudera cloudera 0
2013-10-15 19:16 /user/cloudera/motorcycles
[cloudera@localhost ~]$ hdfs dfs -moveFromLocal
Search WWH ::




Custom Search