Versions Compared

Key

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

...

Return Type

Name(Signature)

Description


varies

java_method(class, method[, arg1[, arg2..]])

Synonym for reflect.


varies

reflect(class, method[, arg1[, arg2..]])

Calls a Java method by matching the argument signature, using reflection. See Reflect (Generic) UDF for examples.

GenericUDFReflect

int

hash(a1[, a2...])

Returns a hash value of the arguments. 

GenericUDFHash

stringcurrent_user()Returns current user name from the configured authenticator manager. Could be the same as the user provided when connecting, but with some authentication managers (for example HadoopDefaultAuthenticator) it could be different.GenericUDFCurrentUser
stringlogged_in_user()Returns the current user name from the session state. This is the username provided when connecting to Hive.GenericUDFLoggedInUser
stringcurrent_database()Returns current database name.GenericUDFCurrentDatabase
stringmd5(string/binary)Calculates an MD5 128-bit checksum for the string or binary. The value is returned as a string of 32 hex digits, or NULL if the argument was NULL. Example: md5('ABC') = '902fbdd2b1df0c4f70b4a5d23525e932'.UDFMd5
string

sha1(string/binary)

sha(string/binary)

Calculates the SHA-1 digest for string or binary and returns the value as a hex string.
Example: sha1('ABC') = '3c01bdbb26f358bab27f267924aa2c9a03fcfdb8'.
UDFSha1
bigintcrc32(string/binary)Computes a cyclic redundancy check value for string or binary argument and returns bigint value. Example: crc32('ABC') = 2743272264.UDFCrc32
stringsha2(string/binary,int)Calculates the SHA-2 family of hash functions (SHA-224, SHA-256, SHA-384, and SHA-512). The first argument is the string or binary to be hashed. The second argument indicates the desired bit length of the result, which must have a value of 224, 256, 384, 512, or 0 (which is equivalent to 256). SHA-224 is supported starting from Java 8. If either argument is NULL or the hash length is not one of the permitted values, the return value is NULL. Example: sha2('ABC', 256) = 'b5d4045c3f466fa91fe2cc6abe79232a1a57cdf104f7a26e716e0a1e2789df78'.GenericUDFSha2
binaryaes_encrypt(inputstring/binary, keystring/binary)Encrypt input using AES. Key lengths of 128, 192 or 256 bits can be used. 192 and 256 bits keys can be used if Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files are installed. If either argument is NULL or the key length is not one of the permitted values, the return value is NULL.
Example: base64(aes_encrypt('ABC', '1234567890123456')) = 'y6Ss+zCYObpCbgfWfyNWTw=='.
GenericUDFAesEncrypt
binaryaes_decrypt(input binary, keystring/binary)Decrypt input using AES. Key lengths of 128, 192 or 256 bits can be used. 192 and 256 bits keys can be used if Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files are installed. If either argument is NULL or the key length is not one of the permitted values, the return value is NULL.
Example: aes_decrypt(unbase64('y6Ss+zCYObpCbgfWfyNWTw=='), '1234567890123456') = 'ABC'.
GenericUDFAesDecrypt
stringversion()Returns the Hive version. The string contains 2 fields, the first being a build number and the second being a build hash. Example: "select version();" might return "2.1.0.2.5.0.0-1245 r027527b9c5ce1a3d7d0b6d2e6de2378fb0c39232". Actual results will depend on your build.UDFVersion
bigintsurrogate_key([write_id_bits, task_id_bits])Automatically generate numerical Ids for rows as you enter data into a table. Can only be used as the default value for acid or insert-only tables.GenericUDFSurrogateKey

Geospatial

Status
colourGreen
title

...

NEW
Hive provides adding ESRI-based standard geospatial data directly into hive tables. These UDFs are autogenerated by Hive. 

...