LOAD DATA
Description
LOAD DATA
statement loads the data into a table from the user specified directory or file. If a directory is specified then all the files from the directory are loaded. If a file is specified then only the single file is loaded. Additionally the LOAD DATA
statement takes an optional partition specification. When a partition is specified, the data files (when input source is a directory) or the single file (when input source is a file) are loaded into the partition of the target table.
Syntax
Parameters
path
- Path of the file system. It can be either an absolute or a relative path.
table_name
- The name of an existing table.
PARTITION ( partition_col_name = partition_col_val [ , ... ] )
- Specifies one or more partition column and value pairs.
LOCAL
- If specified, it causes the
INPATH
to be resolved against the local file system, instead of the default file system, which is typically a distributed storage.
OVERWRITE
- By default, new data is appended to the table. If
OVERWRITE
is used, the table is instead overwritten with new data.