一 常用字符函数
lower、upper、length、concat、substr、trim、lpad、rpad
二 实战
hive> select lower('Hello World'),upper('Hello World');
OK
hello world HELLO WORLD
hive> select length('Hello World'),length('你好');
OK
11 2
Time taken: 1.166 seconds, Fetched: 1 row(s)
hive> select concat('Hello',' World');
OK
Hello World
hive> select substr('hello World',3);
OK
llo World
Time taken: 0.122 seconds, Fetched: 1 row(s)
hive> select substr('hello World',3,4);
OK
llo
hive> select lpad('abcd',10,'&'),rpad('abcd',10,'*');
OK
&&&&&&abcd abcd******
Time taken: 0.144 seconds, Fetched: 1 row(s)