Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

json_tuple(jsonStr, k1, k2, )Breaks up n values V1,...,Vn into rrows. Each row will have n/r columns. r must be constant.

Row-set columns types

Name(Signature)

Description

T

explode(a ARRAY<T>)

Explodes an array to multiple rows. Returns a row-set with a single column (col), one row for each element from the array.

int,Tposexplode(a ARRAY<T>)Explodes an array to multiple rows with additional positional column of int type (position of items in the original array, starting with 0). Returns a row-set with two columns (pos,val), one row for each element from the array.

TkTkey,TvTvalue

explode(m MAP<Tk,Tv>MAP<Tkey,Tvalue>)

Explodes a map to multiple rows. Returns a row-set with a two columns (key,value) , one row for each key-value pair from the input map. (As of Hive 0.8.0.).

T1,T2T1,...,TnTn

inline(a ARRAY<STRUCT<f1:T1,f2:T2ARRAY<STRUCT<f1:T1,...,fn:Tn>>fn:Tn>>)

Explodes an array of structs to multiple rows. Returns a row-set with N columns (N = number of top level elements in the struct), one row per struct from the array. (As of Hive 0.10.)

tuple

T1,...,Tn/rstack(rows_num int, V1 T1,...,Vn-1 Tn/r-1,Vn Tn/r)Breaks up n values V1,...,Vn into rows_num rows. Each row will have n / rows_num  columns. rows_num  must be constant.
   

string1,...,stringn

json_tuple(jsonStr string,k1 string,...,kn string)

Takes JSON string and a set of n keys, and returns a tuple of n values. This is a more efficient version of the get_json_object UDF because it can get multiple keys with just one call.

string 1,...,stringn

parse_url_tuple(urlStr string,p1 string,...,pn string)

Takes URL string and a set of n URL parts, and returns a tuple of n values.

Takes a set of names (keys) and a JSON string, and returns a tuple of values. This is a more efficient version of the get_json_object UDF because it can get multiple keys with just one call.

tuple

parse_url_tuple(url, p1, p2, ...)

This is similar to the parse_url() UDF but can extract multiple parts at once out of a URL. Valid part names are: HOST, PATH, QUERY, REF, PROTOCOL, AUTHORITY, FILE, USERINFO, QUERY:<KEY>.

T1,...,Tn/r

stack(r int, V1 T1,V2 T2,...,Vn-1 Tn/r-1,Vn Tn/r)

 

Using the syntax "SELECT udtf(col) AS colAlias..." has a few limitations:

...