hive中關於表的一些操作指令

2021-10-10 12:35:47 字數 1682 閱讀 1958

1.建表

create

table

`test_part_category`

(> rowkey string comment

'hbase中rowkey'

,> mid string,

> market_id bigint

,> code string,

>

key string,

>

value string,

> create_time string comment

'建立時間'

,> update_time string comment

'修改時間'

)>

comment

'測試表'

> partitioned by

(category_key string comment

'屬性分割槽字段(101:人口,102:社會)'

)>

row format delimited fields

terminated

by'\u0001'

>

lines

terminated

by'\n'

>

null defined as

''> stored as textfile;

2.新增分割槽

alter

table test_part_category add

partition

(category_key=

'101'

);

3.刪除分割槽

alter

table test_part_category drop

ifexists

partition

(category_key=

'101'

);

4.查詢分割槽

show partitions test_part_category;
5.新增列

alter

table test_part_category add

columns

(market_name string)

;

6.刪除列(將rowkey這個欄位算刪除),原始欄位的值不會隨之丟失

alter

table test_part_category replace

columns

(mid string,

market_id bigint

,code string,

key string,

value string,

create_time string comment

'建立時間'

,update_time string comment

'修改時間'

))

7.修改字段

alter

table tablename change column column_orign column_new int

(修改後列的屬性)

Hive 一些操作記錄

1.建立 建立資料庫 create database database name 建立表 列按 分割 create table table name id int,name string row format delimited fields terminated by 建立分割槽表 列按 分割 按...

MySQL的一些指令操作

這個連線的也不錯 如何給mysql資料可新增乙個使用者 首先以root身份登入到mysql伺服器中。mysql u root p 當驗證提示出現的時候,輸入mysql的root帳號的密碼。建立乙個mysql使用者 使用如下命令建立乙個使用者名稱和密碼分別為 myuser 和 mypassword 的...

關於鍊錶的一些操作總結

這是乙個簡單的鍊錶操作問題,在leetcode上面有52.7 的通過率,難度是簡單。但是還是想在這裡基於python做一下總結,順便總結一下鍊錶的各種操作。首先先看一下leetcode上面的題目 反轉乙個單鏈表。示例 輸入 1 2 3 4 5 null 輸出 5 4 3 2 1 null 高階 你可...