大数据第五天(操作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服务器哎

相关推荐
萤丰信息1 小时前
智慧园区系统:赋能园区数字化升级,开启智慧运营新时代
大数据·人工智能·科技·架构·智慧城市·智慧园区
KG_LLM图谱增强大模型3 小时前
Palantir官方揭秘AIP:企业级人工智能平台的端到端架构
大数据·人工智能
姚生3 小时前
Tushare全解析:金融量化分析的数据基石
大数据·python
2501_948114244 小时前
OpenClaw + 星链4SAPI:打造AI自动化“智能体舰队”,从数据采集到模型调度的终极实战
大数据·人工智能
九河云4 小时前
教育行业上云实践:从在线课堂到智慧校园的架构升级
大数据·运维·人工智能·安全·架构·数字化转型
网络工程小王4 小时前
【大数据技术详解】——Sqoop技术(学习笔记)
大数据·学习·sqoop
IT果果日记5 小时前
K8S+Dinky+Flink管理你的计算资源
大数据·后端·flink
TDengine (老段)5 小时前
TDengine IDMP 组态面板 —— 创建组态
大数据·数据库·物联网·时序数据库·iot·tdengine·涛思数据
SelectDB5 小时前
Apache Doris + SelectDB:定义 AI 时代,实时分析的三大范式
大数据·数据库·数据分析
SelectDB5 小时前
OLAP 无需事务?Apache Doris 如何让实时分析兼具事务保障
大数据·数据库·mysql