Data exchanging with LOAD
To move data, Hive uses the LOAD
statement. Move here means the original data is moved to the target table/partition and does not exist in the original place anymore. The LOCAL
keyword in the LOAD
statement specifies where the files are located on the client host. If theLOCAL
keyword is not specified, the files are loaded from the full Uniform Resource Identifier (URI) specified after INPATH
(most of the time, hdfs path
) or the value from the fs.default.name
property defined in hdfs-site.xml
by default. The path after INPATH
can be a relative path or an absolute path. The path either points to a file or a folder (referring to all files in the folder) to be loaded, but the subfolder is not allowed in the path specified. If the data is loaded into a partition table, the partition column must be specified. The OVERWRITE
keyword is used to decide whether to replace the existing data in the target table/partition or not. The following is an example of how to move data...