Impala 轉換函式和其他函式

2021-10-10 15:41:32 字數 1068 閱讀 6020

基於impala 3.2版本

1.轉換函式:

cast(expr as type)

2.資料型別判斷:

typeof(type value)

3.uuid函式

select uuid() uuid;

2e2e4db5-6fe3-436d-92a8-bdecc40f1ddd

4.資料庫的輔助資訊函式:

4.1 查詢登入的資料庫:curren_database()

4.2.查詢登入的使用者:user() ,effective_user() ,logged_in_user()

4.3查詢版本:version()

select version();

impalad version 3.2.0-cdh6.3.2 release (build 60867a3991e22a74e541ea7332eb9e7a34dca2a5)

built on wed jan 29 22:38:21 pst 2020

4.4. 查詢impala中擔任coordinator的主機:coordinator()

4.5 休眠函式:sleep(n)

select current_database() db,user() users,effective_user() users,logged_in_user() users ,pid() pid,coordinator() coordinator ;

db users users users pid coordinator

default hive hive hive 116720 sz102.example.com

參考:

型別轉換和其他函式

sql select to char salary,999,999.00 from employees sql select last name,to char hire date,dd mon rr from employees sql select to char sysdate,yyyy mm...

impala 時間函式

當前時間戳 now current timestamp 當前時間戳相對於 linux epoch 的秒數 unix timestamp 不帶引數,則返回 1970 01 01 00 00 00 utc 到現在的秒數 轉換到相對於 linux epoch 的秒數 unix timestamp now ...

Impala 條件函式

支援的條件函式列表 case 標準通用的函式 coalesce 標準通用函式 decode oracle和impala專用函式 if impala和mysql的函式 ifnull impala和mysql的函式 isfalse isnotfalse isnottrue isnull istrue n...