Signature
ucase(string str)
hive> SELECT ucase('Hello');
OK
_c0
HELLO
Time taken: 0.04 seconds, Fetched: 1 row(s)
Previous Next Home
This blog is primarily focus on Java fundamentals and the libraries built on top of Java programming language. Most of the post are example oriented, hope you have fun in reading my blog....:)
Signature
ucase(string str)
hive> SELECT ucase('Hello');
OK
_c0
HELLO
Time taken: 0.04 seconds, Fetched: 1 row(s)
Previous Next Home
Signature
trim(string str)
Trim all trailing and leading spaces.
hive> SELECT concat(trim(' Hello '), 'World');
OK
_c0
HelloWorld
Signature
substring(string sourceStr, int startPosition [,int length])
Return substring from start position to length number of characters. If the length is not specified, then it considers size of string as length.
hive> SELECT substring('Hello World', 4, 5);
OK
_c0
lo Wo
Time taken: 0.039 seconds, Fetched: 1 row(s)
hive> ;
hive> SELECT substring('Hello World', 4);
OK
_c0
lo World
Time taken: 0.038 seconds, Fetched: 1 row(s)
Signature
substr(string sourceStr, int startPosition [,int length])
Return
substring from start position to length number of characters. If the length is
not specified, then it considers size of string as length.
hive> SELECT substr('Hello World', 4, 5);
OK
_c0
lo Wo
Time taken: 0.051 seconds, Fetched: 1 row(s)
hive> ;
hive> ;
hive> SELECT substr('Hello World', 4);
OK
_c0
lo World
Time taken: 0.046 seconds, Fetched: 1 row(s)
Signature
split(string str, string separator)
Split the string by a separator and return array of strings as output.
hive> SELECT split('ram,23,india', ',');
OK
_c0
["ram","23","india"]
Time taken: 0.039 seconds, Fetched: 1 row(s)
Signature
space(int n)
Return ‘n’ number of spaces.
hive> SELECT concat('Hello', space(10), 'world');
OK
_c0
Hello world
Time taken: 0.039 seconds, Fetched: 1 row(s)
Signature
rtrim(string str)
Remove all the right side trailing spaces in a string.
hive> SELECT concat(rtrim(' Hello '), 'world');
OK
_c0
Helloworld
Time taken: 0.049 seconds, Fetched: 1 row(s)