像SQL这样的Hive插入查询 [英] Hive insert query like SQL

查看:144
本文介绍了像SQL这样的Hive插入查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是配置单元的新手,并且想知道是否有将数据插入到像SQL中那样的配置单元表中。我想插入我的数据到蜂巢中,例如

pre $ INSERT INTO tablename VALUES(value1,value2 ..)

code>

我已经读过,您可以将数据从文件加载到配置单元表中,或者您可以将数据从一个表导入配置单元表,但是有没有什么办法可以像SQL一样添加数据?

解决方案

这里的一些答案已过时,因为Hive 0.14

https:// cwiki .apache.org / confluence / display / Hive / LanguageManual + DML#LanguageManualDML-InsertingvaluesintototablesfromSQL

现在可以使用以下语法来插入: p>

  CREATE TABLE students(name VARCHAR(64),age INT,gpa DECIMAL(3,2)); 

INSERT INTO TABLE学生
VALUES('fred flintstone',35,1.28),('barney碎石',32,2.32);


I am new to hive, and want to know if there is anyway to insert data into hive table like we do in SQL. I want to insert my data into hive like

INSERT INTO tablename VALUES (value1,value2..)

I have read that you can load the data from a file to hive table or you can import data from one table to hive table but is there any way to append the data as in SQL?

解决方案

Some of the answers here are out of date as of Hive 0.14

https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DML#LanguageManualDML-InsertingvaluesintotablesfromSQL

It is now possible to insert using syntax such as:

CREATE TABLE students (name VARCHAR(64), age INT, gpa DECIMAL(3, 2));

INSERT INTO TABLE students
  VALUES ('fred flintstone', 35, 1.28), ('barney rubble', 32, 2.32);

这篇关于像SQL这样的Hive插入查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆