[Hive - LanguageManual] Import/Export

LanguageManual ImportExport

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‘;
时间: 2024-08-13 01:00:28

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

使用 sqoop 将mysql数据导入到hive(import)

Sqoop 将mysql 数据导入到hive(import) 1.创建mysql表 CREATE TABLE `sqoop_test` ( `id` int(11) DEFAULT NULL, `name` varchar(255) DEFAULT NULL, `age` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 插入数据 2.hive 建表 hive> create external table sqoop_test

RequireJS-CommonJS-AMD-ES6 Import/Export详解

RequireJS-CommonJS-AMD-ES6 Import/Export详解 为什么起了一个这个抽象的名字呢,一下子提了四个名词分别是:RequireJS,CommonJS,AMD,ES6,答案是因为现实很骨感,我们必须很勇敢才能正视这一段悲催的往事.如今的JavaScript平台正值如日中天,大家可能会忽略他的过去和弊端,这些弊端中一直被人诟病的就是JavaScript的包管理,比如类似Java中的import,其实理论上来讲这种基本元素的缺失大大的阻碍了人们对一种语言的认可,认为他难

JavaScript import/export

定义模块 ES6之后,使用模块语法(import/export)时,每个文件都会成为它自己的模块,带有一个私有全名空间.顶层的函数和变量不会污染全局全名空间.要为其他模块暴露函数,类,和变量以便import的话,可以用export关键字. // not exported function somethingPrivate() { console.log('TOP SECRET') } export const PI = 3.14; export function doSomething() {

[Dynamics AX] Data import/export framework(DIXF, DMF) on AX2012 and above

After install Data import/export framework (DIXF, DMF) on AX 2012 R2 and above, we should make sure two following things ready The "Microsoft Dynamics Ax Data Import Export Framework Service Users" group exist under Local Users and Groups > G

ES6常用语法简介import export

let与var用法区别 //var var a = []; for (var i = 0; i < 10; i++) { a[i] = function () { console.log(i); }; } a[6](); // 10 ------------------------------ //let var a = []; for (let i = 0; i < 10; i++) { a[i] = function () { console.log(i); }; } a[6](); //

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

一.启动服务自动打开浏览器运行 二.配置简要说明 1.node_modules 安装好的依赖文件,中间件等,所在位置 2.package.jason 配置当前项目要安装的中间件和依赖文件 { "name": "my-app", "version": "1.0.0", "description": "A Vue.js project", "author": "

Amd,Cmd, Commonjs, ES6 import/export的异同点

Amd,Cmd, Commonjs, ES6 import/export等均是模块化方案 1.Commonjs使用在Nodejs上,加载模块是同步的. 2.Amd是requirejs在推广过程中对模块定义的规范化产出,异步模块定义,requirejs是对这个概念的实现,好比JavaScript语言是对ECMAScript规范的实现. 3.Cmd是seajs在推广过程中对模块定义的规范化产出,是一个同步模块定义,seajs是cmd概念的一个实现,seajs是淘宝团队提供的一个模块开发的js框架.

Node.js 中使用 ES6 中的 import / export 的方法大全

转自原文 Node.js 中使用 ES6 中的 import / export 的方法大全, 2018.11 如何在 Node.js 中使用 import / export 的三种方法, 2018.8 nodejs_es6_tutorials 因为一些历史原因,虽然 Node.js 已经实现了 99% 的 ES6 新特性,不过截止 2018.8.10,How To Enable ES6 Imports in Node.JS 仍然是老大难问题 下面我来介绍三种方法可以让我们在 Node.js 中使

彻底搞懂 module.exports/exports/import/export/export default

module.exports/exports module.exports 是模块系统创建的(全局内置对象):当你创建完成一个模块时,需要将此模块暴露出去,以便使用:module.exports 便提供了暴露出去的接口方法: 例如暴露出去一个对象(暴露一个全局变量或方法): /**创建模块 module.exports.js */ let object = { name: 'zhangsan', age: 24, hasSay: () => { console.info('This is zha