您现在的位置是:热点 >>正文
聊聊Hive数据类型和简单使用
热点9463人已围观
简介...
Hive使用的语句是Hql,和sql百分之九十都是相近的,因此,只要对SQL比较熟悉的,Hql基本不用怎么学。
基本数据类型 「基本数据类型」 tinyint/smallint/int/bigint: 整数类型 float/double: 浮点数类型 boolean:布尔类型 string:字符串类型 「复杂数据类型」 Array:数聊聊组类型,由一系列相同数据类型的元素组成 Map:集合类型,包含key->value键值对,可以通过key来访问元素 Struct:结构类型,可以包含不同数据类型的元。这些元素可以通过"点语法"的方式来得到所需要的元素 「时间类型」 Date:从Hive0.12.0开始支持 Timestamp:从Hive0.8.0开始支Hi持 常用DDL操作 查看数据列表 show databases;
使用数据库 USE database_name; 新建数据库
语法:
CREATE (DATABASE|SCHEMA) [IF NOT EXISTS] databaseve_name --DATABASE|SCHEMA 是等价的 [COMMENT database_comment] --数据库注释 [LOCATION hdfs_path] 数据--存储在 HDFS 上的位置 [WITH DBPROPERTIES (property_name=property_value, ...)]; --指定额外属性
示例:
CREATE DATABASE 类型IF NOT EXISTS hive_test COMMENT 'hive database for test' WITH DBPROPERTIES ('cr和简eate'='heibaiying');
创建一个数据库,数据库在HDFS 上的默认存储路径是/user/hive/warehouse/*.db。
创建一个数据库,可以指定数据库在 HDFS 上存放的位置
hive > CREATE DATABASE hive_test 单使;location '/db_hive.db'; 查看数据库信息
语法:
DESC DATABASE [EXTENDED] db_name; --EXTENDED 表示是否显示额外属性
示例:
DESC DATABASE 聊聊 EXTENDED hive_test; 删除数据库
语法:
DROP (DATABASE|SCHEMA) [IF EXISTS] database_name [RESTRICT|CASCADE];
默认行为是 RESTRICT,如Hi果数据库中存在表则删除失败。要想删除库及其中的表,可以使用 CASCADE 级联删除。
示例:
DROP DATABASE IF EXISTS hive_test CASCADE; 案例实操
本地文件导入Hive
[hadoop@node02 ~]$&nbsvep;vim student.txt student.id student.name 1 Runsen 2 Zhangsan 3 Lisi hive>&数据nbsp;CREATE DATABASE db_hive; hive> use db_hive; hive> create table student(id int, name stri类型ng) ROW FORMAT DELIMITED FIELDS TERMINATED BY ' '; hive> load data local inpath 'student.和简txt' into table student; hive> select * from student; OK student.id student.name 1 Runsen单使 2 Zhangsan 3 Lisi
除了可以将本地文件导入到HIve中,我们先把文件上传到HDFS,然后使用HDFS将数据导入到Hive中。
Tags:
下一篇:标签: 番茄音乐
相关文章
巨大争议之下 纽约警方将其配备的机器狗退回波士顿动力
热点在收到有关 "乌托邦"技术的激烈批评后,纽约警察局取消了对美国公司波士顿动力公司制造的机器狗的试验。"纽约警察局的一位发言人告诉《纽约邮报》:"合同已经终止,这只狗将被退回。该部门负责情报和反恐的副专...
【热点】
阅读更多标签: 东鹏饮料
热点撰文 | 许 芸 编辑 | 杨博丞 题图 | 豆包AI 前脚因为赞助的张雪机车夺冠在社交媒体收获大量流量,并发出双位数增长的财报释放利好云梦级消息,后脚股价却跌停。这是在东鹏饮料身上上演的“魔幻”一幕...
【热点】
阅读更多云计算核心技术Docker教程:Java镜像停止、启动和命名容器
热点您可以启动、停止和重新启动 Docker 容器。当我们停止一个容器时,它并没有被移除,而是状态变成了stopped,容器内的进程也停止了。当我们docker ps在上一个模块中运行命令时,默认输出仅显...
【热点】
阅读更多
热门文章
最新文章
友情链接
- 标签: 康师傅
- https://www.jusoen.com/addreng.asp?p1=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】T7r
- https://www.stormberg.com/no/search?q=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,vtm
- https://www.so.com/s?ie=utf-8&src=360sou_home&_re=0&q=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,Bj9
- https://www.remit.co.jp/vi/?s=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】i6D
- https://www.teamlab.art/it/?submit=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,0OJ
- https://www.rea.govt.nz/search?searchterm=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,NJG
- https://www.samen-maier.at/search/谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,YHu
- https://www.zutari.com/search/谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,p5M
- https://www.losgatoschamber.com/list/search?action=SEARCH&q=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,Yia
- https://www.nissin.com/jp/search/?cat=105&q=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,b6U
- https://www.kaiyueleather.com/search/谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,m2h
- https://www.tahiti-infos.com/search/谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,LfA
- https://www.spicebar.de/catalogsearch/result/?q=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,Sdx
- https://www.temu.com/search_result.html?search_key=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】w59
- https://www.pearlstonecenter.org/search/谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,yUu
- https://www.valuecolleges.com/?action=QUERY&s=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,A1T
- https://www.normani.de/search?q=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,Vq4
- https://www.madebyoranges.com/nl/search/谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,LR7
- https://www.kubb-tool.bfs.admin.ch/en/search?action=CHECK&q=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,2P3
- https://www.teamlab.art/zh-hans/?submit=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,oix
- https://www.scivee.tv/?s=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,3Uz
- https://www.realsporting.com/buscador?buscar=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,47d
- https://xn--lgernevedlystskoven-lxb.dk/search/谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,p5e
- https://www.metaltix.com/?view=tours&filter=search&q=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,5PZ
- https://www.lgnewsroom.com/search/谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,ozV
- https://www.teamlab.art/th/?submit=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,3U4
- https://www.stonerealestate.com.au/?cat=100&s=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,Njo
- https://www.partilerdunyasi.com/index.php?route=product/search&tag=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,3FR
- https://www.kawainter.com/catalogsearch/result/?q=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,ziB
- https://www.vietnamconsulate-sf.org/?action=CHECK&s=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,LR7
- https://www.unclefossil.com/search/谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】gad_source=1&gclid=Cj0KCQjw_-GxBhC1ARIsADGgDjsNKplUXa2F6YGlHBK2sHDQ88cgsJBb05DyO99TV9jNq_cT0kGMqyQaAgHQEALw_wcB
- https://www.mdbg.net/chinese/dictionary?page=worddict&wdrst=0&wdqb=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,WsZ
- https://www.solerpalau.com/en-en/catalogsearch/result/?q=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,u2m
- https://yscc1986.net/search/谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】pSk
- https://www.mygrandma.com/Items.aspx?search=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,KMx
- https://www.paulaschoice.hk/zh_hant/catalogsearch/result/?q=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,EsK
- https://www.quarterjacksurgery.co.uk/?AT=3rBy&s=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,YY3
- https://www.tullygroup.us/?ID=hbkq8jFjrQlVRrwzEmvoUJJAY4e1Lfo5&s=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,7PI
- https://www.vet-direct.com/search?cat=72&term=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,1xE
- https://www.hanbat.ac.kr/search/front/Search.jsp?qt=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】ODr
- https://www.teamlab.art/fr/?submit=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,PUN
- https://www.openspaceinstitute.org/search?q=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,oIE
- https://www.rotherham.gov.uk/site-search/results/?q=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,xOW
- https://www.maigoo.com/search/?block=&q=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,wVn
- https://www.ng-slo.si/si/iskanje?cat=114&q=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,TNb
- https://www.searcychamber.com/list/search?AsfnA=DtkTQzs&q=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,lBD
- https://www.kaliastyle.com/catalogsearch/result/?q=GOOGLE谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,1ak
- https://www.televes.com/es/catalogsearch/result/?q=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,2xe
- https://www.oprny.com/search.php?search_query=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,lue
- https://www.revere.org/search?action=SEARCH&q=谷歌留痕技术教程-教程要点与实践【tg:seogoogle987】,XJv