這篇文章將為大家詳細(xì)講解有關(guān)Hive常用的SQL有哪些,小編覺(jué)得挺實(shí)用的,因此分享給大家做個(gè)參考,希望大家閱讀完這篇文章后可以有所收獲。

成都創(chuàng)新互聯(lián)-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設(shè)、高性價(jià)比橋西網(wǎng)站開(kāi)發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫(kù),直接使用。一站式橋西網(wǎng)站制作公司更省心,省錢,快速模板網(wǎng)站建設(shè)找我們,業(yè)務(wù)覆蓋橋西地區(qū)。費(fèi)用合理售后完善,十多年實(shí)體公司更值得信賴。
-- 創(chuàng)建和刪除數(shù)據(jù)庫(kù) create database if not exists userdb; drop databases if exists userdb; --查看表的詳細(xì)信息 show create table tablename; --查詢一張表,創(chuàng)建一張新的表 create table tablename as select * from tablename
-- 創(chuàng)建hive表 create external table if not exists table_name ( `id` string comment 'id號(hào)', `name` string comment '名字', `height` double comment '身高', ) comment '學(xué)生信息表' partition by (dt string) row format delimited fields terminated by '\t' lines terminated by '\n' stored as textfile location 'hdfs文件路徑'; -- 刪除hive表 drop table if exists table_name;
-- 刪除分區(qū) alter table table_name drop if exists partition(dt = '20200820'); -- 新建分區(qū),存入數(shù)據(jù) alter table table_name add if not exists partition(dt = '20200820') location 'hdfs文件路徑'; -- 重命名分區(qū) alter table table_name partition xxxxx rename to partition xxxxx;
關(guān)于“Hive常用的SQL有哪些”這篇文章就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,使各位可以學(xué)到更多知識(shí),如果覺(jué)得文章不錯(cuò),請(qǐng)把它分享出去讓更多的人看到。
分享題目:Hive常用的SQL有哪些
當(dāng)前網(wǎng)址:http://www.yijiale78.com/article2/gddgic.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供營(yíng)銷型網(wǎng)站建設(shè)、網(wǎng)站策劃、微信公眾號(hào)、外貿(mào)網(wǎng)站建設(shè)、用戶體驗(yàn)、小程序開(kāi)發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)