hive基礎命令

2021-07-09 03:05:43 字數 476 閱讀 2175

小白上路嘍,從命令列開始

show database;

use db_name;

show tables;

desc tb_name;

show functions;

desc function fc_name;

–執行hive sql指令碼

hive -f script.sql

–設定mapreduce 佇列(設定root,避免佇列許可權報錯)

set mapreduce.job.queuename=root.default

–遇到的坑

1.timestamp型別日期加減1天

cast(from_unixtime(unix_timestamp(t.created_at) +/- 24*3600) as timestamp)

2.order by 支援使用別名,但不支援order by 1(執行不報錯,但結果不準確)

hive庫基礎命令

建立資料庫 hive create database base1 使用資料庫 hive use base1 建立表 hive create table table1 cols string,cols1 string 建立乙個表與當前hive存在的表結構一樣 hive create table tab...

hive基礎命令實驗

環境 centos7 hadoop2.6.5 hive 1.x 一.從普通文字載入資料到hive倉庫 1.使用 命令hive 進入hive命令列 2.建立資料庫 create database if not exists hivetest 3.切換資料庫 use hivetest 4.建立表 cre...

Hive知識之Hive基礎

5 hive的基本操作 5.2 資料表相關操作 6 資料的匯入和匯出 1 hive簡介 2 hive與傳統關係型資料庫的比較 專案hive rdbms 查詢語言 hqlsql 資料儲存 hdfs raw device or local fs 執行mapreduce excuter 執行延遲高低 處理...