Hive_内置函数

第一篇博客啦~~~哈哈哈,作为一个学习笔记用,如有叙述错误或者有其它更好的方法,还望大佬们在评论区不吝赐教哦!!!嘿嘿~

查询Hive内置函数

进入hive客户端:

[user1@master ~]$hive

查询Hive内置函数:

hive (default)>show functions;
OK
tab_name
!
!=
$sum0
%
&
*
+
-
/
<
<=
<=>
<>
=
==
>
>=
^
abs
acos
add_months
aes_decrypt
aes_encrypt
and
array
array_contains
ascii
asin
assert_true
atan
avg
base64
between
bin
bround
case
cbrt
ceil
ceiling
chr
coalesce
collect_list
collect_set
compute_stats
concat
concat_ws
context_ngrams
conv
corr
cos
count
covar_pop
covar_samp
crc32
create_union
cume_dist
current_database
current_date
current_timestamp
current_user
date_add
date_format
date_sub
datediff
day
dayofmonth
decode
degrees
dense_rank
div
e
elt
encode
ewah_bitmap
ewah_bitmap_and
ewah_bitmap_empty
ewah_bitmap_or
exp
explode
factorial
field
find_in_set
first_value
floor
format_number
from_unixtime
from_utc_timestamp
get_json_object
get_splits
greatest
hash
hex
histogram_numeric
hour
if
in
in_file
index
initcap
inline
instr
isnotnull
isnull
java_method
json_tuple
lag
last_day
last_value
lcase
lead
least
length
levenshtein
like
ln
locate
log
log10
log2
lower
lpad
ltrim
map
map_keys
map_values
mask
mask_first_n
mask_hash
mask_last_n
mask_show_first_n
mask_show_last_n
matchpath
max
md5
min
minute
month
months_between
named_struct
negative
next_day
ngrams
noop
noopstreaming
noopwithmap
noopwithmapstreaming
not
ntile
nvl
or
parse_url
parse_url_tuple
percent_rank
percentile
percentile_approx
pi
pmod
posexplode
positive
pow
power
printf
quarter
radians
rand
rank
reflect
reflect2
regexp
regexp_extract
regexp_replace
repeat
replace
reverse
rlike
round
row_number
rpad
rtrim
second
sentences
sha
sha1
sha2
shiftleft
shiftright
shiftrightunsigned
sign
sin
size
sort_array
soundex
space
split
sqrt
stack
std
stddev
stddev_pop
stddev_samp
str_to_map
struct
substr
substring
substring_index
sum
tan
to_date
to_unix_timestamp
to_utc_timestamp
translate
trim
trunc
ucase
unbase64
unhex
unix_timestamp
upper
var_pop
var_samp
variance
version
weekofyear
when
windowingtablefunction
xpath
xpath_boolean
xpath_double
xpath_float
xpath_int
xpath_long
xpath_number
xpath_short
xpath_string
year

显示函数具体用法:

hive (default)> desc function sum;
OK
tab_name
sum(x) - Returns the sum of a set of numbers
Time taken: 0.856 seconds, Fetched: 1 row(s)

详细显示函数的用法:

hive (default)> desc function extended sum;
OK
tab_name
sum(x) - Returns the sum of a set of numbers

这是Hive中的内置函数,我们可以直接使用。如果Hive的内置函数不能满足需求,我们还可以根据需求自定义函数。通常在使用过程中我们很少会这样直接查询出所有的函数,因为我们只能看见函数名,却不能知道函数的作用,所以在需要时,我们通常都会按需求去查找使用什么函数(比如在百度上,博客上查找)。

你可能感兴趣的:(大数据之Hive)