Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What are the common functions of Hive

Shulou Source: shulou.com Published: 2022-06-01 15:14:38 10月08日 Update

Editor to share with you what are the common functions of Hive, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

one

Mathematical function

Round (double d)

Round (double dline int n)

Floor (double d)

Ceil (double d)

Ceiling (double d)

Rand ()

Rand (int seed)

Exp (double d)

Ln (double d)

Log10 (double d)

Log2 (double d)

Log (double base,double d)

Pow (double djingheng double p)

Power (double djingheng double p)

Sqrt (double d)

Hex (bigint I)

Hex (string str)

Abs (double d)

PI ()

two

Set function

Size (Map)

Map_keys (Map)

Map_values (Map)

Array_contains (Array, value)

Sort_array (Array)

three

Type conversion function

Cast (expr as)

four

Date function

Date_add

Date_sub

Next_day

Last_day

From_unixtime (bigint unixtime, string format)

To_date (string timestamp)

Year (string date)

Month (string date)

Hour (string date)

Weekofyear (string date)

Datediff (string enddate, string startdate)

Add_months (string start_date, int num_months)

Date_format (date/timestamp/string ts, string fmt)

five

Conditional function

If (boolean testCondition, T valueTrue, T valueFalseOrNull)

Nvl (T value, T default_value)

COALESCE (T v1, T v2,...)

CASE a WHEN b THEN c [WHEN d THEN e] * [ELSE f] END

Isnull (a)

Isnotnull (a)

six

Character function

Concat (string | binary A, string | binary B...)

Concat_ws (string SEP, string A, string B...)

Length (string A)

Lower (string A) lcase (string A)

Parse_url (string urlString, string partToExtract [, string keyToExtract])

Regexp_replace (string INITIAL_STRING, string PATTERN, string REPLACEMENT)

Reverse (string A)

Split (string str, string pat)

Substr (string | binary A, int start) substring (string | binary A, int start)

seven

Aggregate function

Count (*)

Count (expr)

Count (distinct expr [, expr_.])

Sum (col)

Sum (distinct col)

Avg (col)

Avg (distinct col)

Min (col)

Max (col)

eight

Table generating function

Explode (ARRAY array)

Explode (MAP map)

Explode (ARRAY a)

Json_tuple (STRING jsonStr,p1p2, … , pn)-

Parse_url_tuple (url,partname1,partname2, … , partnameN)

These are all the contents of the article "what are the common functions of Hive?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Functions articles commonly used content not much most characters math dates more conditions knowledge types industry information information channels channels references learning help Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Huawei Xiaomi Apple MySQL