---
title: "hive 快速插入测试数据"
author: "chenchangqun"
date: "2014-05-20T17:52:05Z"
tags: []
categories: ["开源软件"]
slug: "hive"
draft: false
lastmod: "2014-05-20T17:52:05Z"
id: 2068759
url: "https://chenchangqun.iteye.com/blog/2068759"
---

vi  /root/data.txt
1,sss
2,dfdf
3,dfdf
4,changqun


data.txt中不要有空行,空行也是一条数据.
$ hive
创建一个表
hive>create table test(id int,name string) row format delimited fields terminated by ',';
加载数据
 hive>LOAD DATA LOCAL INPATH '/root/data.txt' OVERWRITE INTO TABLE test;

查询即可看到结果
 hive> select * from test;
OK
1	sss
2	dfdf
3	dfdf
4	changqun
Time taken: 2.701 seconds