主仆调教SM束缚绳索捆绑,成品人和精品人的区别三叶草,双性受被各种性器调教学生小说,精品一区二区三区水蜜桃

尚硅谷大數據技術之Hive(新)第6章 查詢

5.2 數據導出

5.2.1 Insert導出

1.將查詢的結果導出到本地

hive (default)> insert overwrite local directory '/opt/module/datas/export/student'

????????????select * from student;

2.將查詢的結果格式化導出到本地

hive(default)>insert overwrite local directory '/opt/module/datas/export/student1'

???????????ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' ????????????select * from student;

3.將查詢的結果導出到HDFS上(沒有local)

hive (default)> insert overwrite directory '/user/atguigu/student2'

?????????????ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'

?????????????select * from student;

5.2.2 Hadoop命令導出到本地

hive (default)> dfs -get /user/hive/warehouse/student/month=201709/000000_0

/opt/module/datas/export/student3.txt;

5.2.3 Hive Shell 命令導出

基本語法:(hive -f/-e 執行語句或者腳本 > file)

[atguigu@hadoop102 hive]$ bin/hive -e 'select * from default.student;' >

?/opt/module/datas/export/student4.txt;

5.2.4 Export導出到HDFS上

(defahiveult)>?export table default.student to

?'/user/hive/warehouse/export/student';

5.2.5 Sqoop導出

后續課程專門講。

5.3 清除表中數據(Truncate)

注意:Truncate只能刪除管理表,不能刪除外部表中數據

hive (default)> truncate table student;

https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Select

查詢語句語法:

[WITH CommonTableExpression (, CommonTableExpression)*]??? (Note: Only available

?starting with Hive?0.13.0)

SELECT [ALL | DISTINCT] select_expr, select_expr, ...

??FROM table_reference

??[WHERE where_condition]

??[GROUP BY col_list]

??[ORDER BY col_list]

??[CLUSTER BY col_list

????| [DISTRIBUTE BY col_list] [SORT BY col_list]

??]

?[LIMIT number]

6.1 基本查詢(Select…From)

6.1.1 全表和特定列查詢

1.全表查詢

hive (default)> select * from emp;

2.選擇特定列查詢

hive (default)> select empno, ename from emp;

注意:

(1)SQL 語言大小寫不敏感。?

(2)SQL 可以寫在一行或者多行

(3)關鍵字不能被縮寫也不能分行

(4)各子句一般要分行寫。

(5)使用縮進提高語句的可讀性。

 

 

 

<center id="k5hyo"><tr id="k5hyo"></tr></center>
  • <pre id="k5hyo"><abbr id="k5hyo"></abbr></pre>
    <ul id="k5hyo"></ul>

      主站蜘蛛池模板: 鄂伦春自治旗| 石楼县| 大埔区| 莒南县| 宝鸡市| 临朐县| 惠水县| 九龙城区| 青州市| 吴堡县| 内丘县| 拜泉县| 通化县| 平顺县| 巴林左旗| 青州市| 日喀则市| 吉隆县| 新建县| 竹山县| 贵德县| 延寿县| 清新县| 慈利县| 资阳市| 类乌齐县| 左权县| 克什克腾旗| 德保县| 綦江县| 长阳| 通州市| 赤城县| 禄劝| 云龙县| 南华县| 固镇县| 来宾市| 高陵县| 滦平县| 霍林郭勒市|