Hive 插入查询,如 SQL [英] Hive insert query like SQL

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

问题描述

我是 hive 的新手,想知道是否可以像在 SQL 中那样将数据插入到 Hive 表中.我想将我的数据插入到蜂巢中

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..)

我读到您可以将数据从文件加载到 hive 表,也可以将数据从一个表导入到 hive 表,但有什么方法可以像 SQL 一样附加数据?

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?

推荐答案

这里的一些答案从 Hive 0.14 开始已经过时

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);

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

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