大数据第五天(操作hive的方式)

文章目录

操作hive的方式

hive 存储位置

hive 操作语法

创建数据表的方式

-- 创建数据库

sql 复制代码
create database if not exists test

我们创建数据库表的时候,hive是将我们的数据自动添加到数据表中,但是需要我们注意,自动添加的方式我们需要按照特定格式添加到数据库中,\001添加到数据表中的方式

我们写一个案例的方式

我们这里可以看到SOH默认的制表是\001的方式,

我们这个soh是打不出来的,我们只能通过替换的方式

创建数据表

sql 复制代码
create table student(
    id int comment "id",
    name string comment "名字",
    age int comment "年龄"
) comment "学生表";

我们将数据库上传到hive中 ,查询数据库

上传hive中

shell 复制代码
 hadoop fs -put student.txt /user/hive/warehouse/test.db/student

查数据

sql 复制代码
select * from student;

本地加载数据

sql 复制代码
load data local inpath '/root/hivedata/student.txt' into table student;

2024-04-23 17:40:35\] org.apache.hadoop.hive.ql.parse.SemanticException:Line 1:23 Invalid path ''/root/hivedata/student.txt'': No files matching path file:/root/hivedata/student.txt ![在这里插入图片描述](https://file.jishuzhan.net/article/1785642731364683778/2047cf6862bdd298c7afc3802ff5ebb8.webp) 成功解决了 刚才问题有点尴尬是这样的一个问题 我们连接是hive的hadoop03的服务器但是我们操作hadoop01服务器哎

相关推荐
IT研究所11 分钟前
IT 资产管理 (ITAM) 与 ITSM 协同实践:构建从资产到服务的闭环管理体系
大数据·运维·人工智能·科技·安全·低代码·自动化
辣椒种子25 分钟前
Elasticsearch 基础入门--开发elasticsearch搜索数据篇
大数据·elasticsearch·jenkins
geneculture4 小时前
人机互助新时代超级个体(OPC)的学术述评——基于人文学科与数理学科的双重视域
大数据·人工智能·哲学与科学统一性·信息融智学·融智时代(杂志)
zchxzl4 小时前
亲测2026京津冀可靠广告展会
大数据·人工智能·python
J2虾虾5 小时前
在Kylin Server上安装并配置MariaDB
大数据·mariadb·kylin
Elastic 中国社区官方博客7 小时前
Elasticsearch:创建 geocoding workflow,并在 agent 中使用它进行位置搜索
大数据·人工智能·elasticsearch·搜索引擎·ai·语言模型
TechubNews8 小时前
燦谷(Cango Inc)入局AI 資本重組彰顯決心
大数据·网络·人工智能·区块链
keke.shengfengpolang9 小时前
2026大专大数据技术专业男生就业岗位全攻略:从入门到进阶
大数据
heimeiyingwang9 小时前
企业内部知识管理:AI 驱动的文档检索与知识问答
大数据
yohalaser10 小时前
硬核智测赋能 武汉曜华激光加速钙钛矿产线产业化进程
大数据·运维·人工智能