hive分割槽無法刪除,特殊分割槽,分割槽亂碼

2021-09-24 23:58:22 字數 1395 閱讀 5298

應該有人在使用 hive 的時候 不小心建立了一些 特殊分割槽 , 分割槽的編碼 是看起來的亂碼, 我們現在來看看這個問題

create table  test.test_part

( a string,

b string,

c int

) comment '測試不正常分割槽'

partitioned by ( d string)

stored as orc;

原先有乙個已經有資料的表

insert into test.test_part partition(d='bb')

select

name10,

id2,

agefrom test.buf_bdptest_diy limit 100

本來執行

hive -hiveconf day_s='2019-07-03'  -f  檔名.sql

插入帶變數的, 但是沒有傳入引數 

insert into test.test_part partition(d='$')

select

name10,

id2,

agefrom test.buf_bdptest_diy limit 100

檢視分割槽

直接帶引號 '$%7bhiveconf%3aday_s}' 刪除這個分割槽是無法刪除的

需要把含有特殊字串的使用 雙引號包含

已經不存在那個分割槽了,

問題 原因 : 需要 使用 雙引號 "" 把你的特殊字元給引用起來 , 使用雙引號的時候不會吧對應的引數給進行 16進製制編碼, 這樣就不會出現這個問題

如果找不到 怎麼去解析這個字元  可以找乙個 url 解析**解析一下就行 

例如

hive無法刪除分割槽

hive中執行 alter table drop if exists partition xx 刪除某錶分割槽時,一直沒有執行,卡住不動。其它表執行沒有問題。info級別日誌沒什麼輸出,日誌一直停留在那。在hive命令列使用hive hiveconf hive.root.logger debug,c...

Hive分割槽 分桶

create table t user partition id int name string partitioned by country string row format delimited fields terminated by load data local inpath root h...

Hive分割槽 分桶

2 靜態分割槽 二 hive分桶 1.分割槽列的值將表劃分為乙個個的資料夾 2.查詢時語法使用 分割槽 列和常規列類似 3.查詢時hive會只從指定分割槽查詢資料,提高查詢效率 建立單級分割槽表 create table ifnot exists employee partition name st...