标签:hdf conf for lang pre original event ... key
EXPORT 命令导出数据表或分区,与元数据一起输出到指定位置。又可以从这个输出位置移动到不同的Hadoop 或Hive 实例中,并且使用IMPORT 命令导入。
当导出一个分区表时,原始数据可能位于不同的HDFS位置,同时还支持导出/导入分区的子集。
导出的元数据存储在目标目录中,数据文件则存储在子目录中。
EXPORT 和IMPORT 命令独立于所用的数据源和目标元数据数据管理系统;例如,它们可以在Derby和MYSQL数据库之间使用
EXPORT TABLE tablename [PARTITION (part_column="value"[, ...])]
TO ‘export_target_path‘ [ FOR replication(‘eventid‘)
IMPORT [[EXTERNAL] TABLE new_or_original_tablename [PARTITION (part_column="value"[, ...])]]
FROM ‘source_path‘
[LOCATION ‘import_target_path‘]
export table department to ‘hdfs_exports_location/department‘;
import from ‘hdfs_exports_location/department‘;
export table department to ‘hdfs_exports_location/department‘;
import table imported_dept from ‘hdfs_exports_location/department‘;
export table employee partition (emp_country="in", emp_state="ka") to ‘hdfs_exports_location/employee‘;
import from ‘hdfs_exports_location/employee‘;
export table employee to ‘hdfs_exports_location/employee‘;
import table employee partition (emp_country="us", emp_state="tn") from ‘hdfs_exports_location
export table department to ‘hdfs_exports_location/department‘;
import table department from ‘hdfs_exports_location/department‘
location ‘import_target_location/department‘;
export table department to ‘hdfs_exports_location/department‘;
import external table department from ‘hdfs_exports_location/department‘;
参考:
https://www.shiyanlou.com/courses/38/labs/775/document
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+ImportExport
标签:hdf conf for lang pre original event ... key
原文地址:http://www.cnblogs.com/libin2015/p/7383044.html