version()
查看 Hive 版本相关信息
select version();
current_database()
查看当前使用的数据库
use <库名>
default
select current_database();
current_user()
从配置好的 authenticator manager 返回当前使用的用户名
select current_user();
logged_in_user()
从会话状态返回当前用户名
select logged_in_user();
reflect(class, method[, arg1[, arg2..]]) 或 java_method(class, method[, arg1[, arg2..]])
reflect(class, method[, arg1[, arg2..]])
java_method(class, method[, arg1[, arg2..]])
SELECT reflect("java.lang.String", "valueOf", 1), reflect("java.lang.String", "isEmpty"), reflect("java.lang.String", "endsWith", 'test'), reflect("java.lang.Math", "max", 2, 3), reflect("java.lang.Math", "min", 2, 3), reflect("java.lang.Math", "round", cast(2.5 as float)), reflect("java.lang.Math", "exp", cast(1.0 as double)), reflect("java.lang.Math", "floor", cast(1.9 as double));
reflect2(arg0,method[,arg1[,arg2..]])
SELECT reflect2("Hello World!","length"), reflect2("Hello World!", "isEmpty"), reflect2("Hello World!", "compareTo", "Hello"), reflect2("Hello World!", "compareTo", "Hello World!"), reflect2("Hello World!", "endsWith", "World!"), reflect2("Hello World!", "indexOf", "W"), reflect2("Hello World!", "matches", "^.{0,}llo.{0,}$");
uuid() 函数
uuid()
生成一个 UUID
select uuid();
surrogate_key([write_id_bits, task_id_bits]) 函数
surrogate_key([write_id_bits, task_id_bits])