Updated on 2022-08-16 GMT+08:00

Loading Data

Function Description

This section describes how to use Impala SQL to load data to the existing employees_info table. You can learn how to load data from a cluster.

Sample Code

--Load the employee_info.txt file from the /opt/impala_examples_data/ directory of the local file system to the employees_info table.
LOAD DATA LOCAL INPATH '/opt/impala_examples_data/employee_info.txt' OVERWRITE INTO TABLE employees_info;

-- Load /user/impala_examples_data/employee_info.txt from HDFS to the employees_info table.
LOAD DATA INPATH '/user/impala_examples_data/employee_info.txt' OVERWRITE INTO TABLE employees_info;   

The essence of loading data is to copy the data to the specified table directory in HDFS.

The LOAD DATA LOCAL INPATH command can be used to load files from a local file system to Impala. If LOCAL is specified, the path refers to the path of the local file system of the currently connected Impalad.