Skip to end of metadata

 

Go to start of metadata

 

Import/Export

Version

Icon

The EXPORT and IMPORT commands were added in Hive 0.8.0 (see HIVE-1918).

Overview

The EXPORT command exports the data of a table or partition, along with the metadata, into a specified output location. This output location can then be moved over to a different Hadoop or Hive instance and imported from there with the IMPORT command.

When exporting a partitioned table, the original data may be located in different HDFS locations. The ability to export/import a subset of the partition is also supported.

Exported metadata is stored in the target directory, and data files are stored in subdirectories.

The EXPORT and IMPORT commands work independently(独立地) of the source and target metastore DBMS used; for example, they can be used between Derby and MySQL databases.

Export Syntax

EXPORT TABLE tablename [PARTITION (part_column="value"[, ...])]
  TO 'export_target_path'

Import Syntax

IMPORT [[EXTERNAL] TABLE new_or_original_tablename [PARTITION (part_column="value"[, ...])]]
  FROM 'source_path'
  [LOCATION 'import_target_path']

Examples

Simple export and import:

export table department to 'hdfs_exports_location/department';
import from 'hdfs_exports_location/department';

Rename table on import:

export table department to 'hdfs_exports_location/department';
import table imported_dept from 'hdfs_exports_location/department';

Export partition and import:

export table employee partition (emp_country="in", emp_state="ka") to 'hdfs_exports_location/employee';
import from 'hdfs_exports_location/employee';

Export table and import partition:

export table employee to 'hdfs_exports_location/employee';
import table employee partition (emp_country="us", emp_state="tn") from 'hdfs_exports_location/employee';

Specify the import location:

export table department to 'hdfs_exports_location/department';
import table department from 'hdfs_exports_location/department'
location 'import_target_location/department';

Import as an external table:

export table department to 'hdfs_exports_location/department';
import external table department from 'hdfs_exports_location/department';
 

[Hive - LanguageManual] Import/Export的更多相关文章

  1. Hive之import和export使用详解

    在hive-0.8.0后引入了import/export命令. Export命令可以导出一张表或分区的数据和元数据信息到一个输出位置,并且导出数据可以被移动到另一个hadoop集群或hive实例,并且 ...

  2. sqoop import/export使用经验

    一.先创建一个小表(test_01)进行测试(主节点IP:169.254.109.130/oracle服务器IP:169.254.109.100) 1.测试连接oracle; sqoop list-t ...

  3. Data import/export of Netezza using external table

    Introduction External table is a special table in Netezza system, which could be  used to import/exp ...

  4. require/exports 和 import/export 区别

    零.区别 1.require/exports 是 CommonJS 的标准,适用范围如 Node.js 2.import/export 是 ES6 的标准,适用范围如 React 一.间接获取对象 ( ...

  5. 前端 高级 (二十五)vue2.0项目实战一 配置简要说明、代码简要说明、Import/Export、轮播和列表例子

    一.启动服务自动打开浏览器运行 二.配置简要说明 1.node_modules 安装好的依赖文件,中间件等,所在位置 2.package.jason 配置当前项目要安装的中间件和依赖文件 { &quo ...

  6. require/exports 与 import/export 的区别?

    文章作者:寸志链接:https://www.zhihu.com/question/56820346/answer/150724784来源:知乎 遵循的模块化规范不一样 模块化规范:即为 JavaScr ...

  7. gulp 配置达到实现import export支持

    gulp.task('tojs', () => { return gulp.src('./es/**/*.js') .pipe(babel({ babelrc: false, plugins: ...

  8. 探讨ES6的import export default 和CommonJS的require module.exports

    今天来扒一扒在node和ES6中的module,主要是为了区分node和ES6中的不同意义,避免概念上的混淆,同时也分享一下,自己在这个坑里获得的心得. 在ES6之前 模块的概念是在ES6发布之前就出 ...

  9. es6中的import,export浏览器已经支持

    直接上代码, 成功测验了es6的新特性 import , export语法. 服务器返回 js文件时,要加上content-type: applicaiton/javascript 这个字段. ind ...

随机推荐

  1. 【Spring】Redis的两个典型应用场景--good

    原创 BOOT Redis简介 Redis是目前业界使用最广泛的内存数据存储.相比memcached,Redis支持更丰富的数据结构,例如hashes, lists, sets等,同时支持数据持久化. ...

  2. opencv 图像阴影检测

    参数说明: IplImage *workImg-当前全局变量,表示正在显示的图片. downleft, upright- 检测出的阴影部分矩形框的两个对角顶点. /****************** ...

  3. Mysql:常用代码

    C/S: Client Server B/S: Brower Server Php主要实现B/S .net IIS Jave TomCat LAMP:L Mysql:常用代码 Create table ...

  4. BZOJ 2326 数学作业(矩阵)

    题目链接:http://61.187.179.132/JudgeOnline/problem.php?id=2326 题意:定义Concatenate(1,N)=1234567……n.比如Concat ...

  5. Ibatis,Spring整合(注解方式注入)

    applicationContext.xml <?xml version="1.0" encoding="UTF-8"?> <beans xm ...

  6. useradd和adduser的区别

    1. 在root权限下,useradd只是创建了一个用户名,如 (useradd  +用户名 ),它并没有在/home目录下创建同名文件夹,也没有创建密码,因此利用这个用户登录系统,是登录不了的,为了 ...

  7. 使用ssh公钥密钥自动登陆linux服务器

    转自:http://7056824.blog.51cto.com/69854/403669 作为一名 linux 管理员,在多台 Linux 服务器上登陆进行远程操作是每天工作的一部分.但随着服务器的 ...

  8. if(username.equals(“zxx”){}

    1. if(username.equals(“zxx”){} username可能为NULL,会报空指针错误:改为"zxx".equals(username) 2.  int  x ...

  9. UVa 1349 (二分图最小权完美匹配) Optimal Bus Route Design

    题意: 给出一个有向带权图,找到若干个圈,使得每个点恰好属于一个圈.而且这些圈所有边的权值之和最小. 分析: 每个点恰好属于一个有向圈 就等价于 每个点都有唯一后继. 所以把每个点i拆成两个点,Xi  ...

  10. bzoj3275: Number

    最小割...然后推一下可知不能的情况必定为一奇一偶,于是s->奇->偶->t.跑最小割即可. #include<cstdio> #include<cstring&g ...