String Functions in Hive 1


This post is about basic String Functions in Hive with syntax and examples.

Creating Table in HIVE:

String Functions and Normal Queries:

ASCII

ASCII Function converts the first character of the string into its numeric ASCII value.

CONCAT

The CONCAT function concatenates all the strings/columns.

CONCAT_WS

Syntax: “CONCAT_WS(string delimiter, string str1,str2……)"

The CONCAT_WS function concatenates all the strings only strings and Column with datatype string.

FIND_IN_SET :

Syntax: “FIND_IN_SET(string search_string,string source_string_list)"

The FIND_IN_SET function searches for the search_string in the source_string_list and returns the position of the first occurrence in the source_string_list. Here the source_string_list should be comma delimited one.