select ascii('ABC');
-- 结果为 65select base64(encode('Uncle Bean', 'utf8'));
-- 结果为 VW5jbGUgQmVhbg==select base64(encode('Melon-and-fruit-fields', 'utf-8'));
-- 结果为 TWVsb24tYW5kLWZydWl0LWZpZWxkcw====select character_length('123456');
-- 结果为 6select char_length('ABCDEFGHIJK');
-- 结果为 11select chr(65);
-- 结果为 Aselect chr(65.6);
-- 结果为 Aselect chr(321);
-- 结果为 Aselect chr(321 % 256);
-- 结果为 Aselect concat('A', 'C', 'B');
-- 结果为 ACBselect concat(encode('A', 'utf8'), encode('C', 'utf8'), encode('B', 'utf8'));
-- 结果为 ACBselect context_ngrams(array(array('from','a'),array('from','a'),array('from','b')), array('from', null), 1);
-- 结果为 [{"ngram":["a"],"estfrequency":2.0}]select context_ngrams(array(array('from','a'),array('from','a'),array('from','b')), array('from', null), 2);
-- 结果为 [{"ngram":["a"],"estfrequency":2.0},{"ngram":["b"],"estfrequency":1.0}]select concat_ws('-', 'Melon', 'and', 'fruit', 'fields');
-- 结果为 Melon-and-fruit-fieldsselect concat_ws('-', array('Melon', 'and', 'fruit', 'fields'));
-- 结果为 Melon-and-fruit-fieldsselect decode(encode('A', 'utf8'), 'UTF-8');
-- 结果为 Aselect elt(2, 'Melon', 'and', 'fruit', 'fields');
-- 结果为 andselect elt(5, 'Melon', 'and', 'fruit', 'fields');
-- 结果为 NULLselect encode('A','UTF-8');
-- 结果为 Aselect encode('A','US-ASCII');
-- 结果为 Aselect field(11, 13, 12, 11);
-- 结果为 3select field('a', 'c', 'b', 'a');
-- 结果为 3select field('d', 'c', 'b', 'a');
-- 结果为 0select find_in_set('and', 'Melon,and,fruit,fields');
-- 结果为 2select find_in_set('And', 'Melon,and,fruit,fields');
-- 结果为 0select find_in_set('and,', 'Melon,and,fruit,fields');
-- 结果为 0select find_in_set(NULL, 'Melon,and,fruit,fields');
-- 结果为 NULLselect format_number(1234.16, 1);
-- 结果为 1,234.2select format_number(1234.14, 1);
-- 结果为 1,234.1select get_json_object('{"key":"value"}', '$.key');
-- 结果为 valueselect get_json_object('[{"key":"value"}, {"key":"value2"}]', '$[1].key');
-- 结果为 value2select get_json_object('["value3"]', '$[0]');
-- 结果为 value3select in_file('123', 'hdfs:/tmp/test/test.csv');
-- 结果为 trueselect in_file('12', 'hdfs:/tmp/test/test.csv');
-- 结果为 falseselect instr('1234', '23');
-- 结果为 2select instr('1234', '2345');
-- 结果为 0select instr('1234', NULL);
-- 结果为 NULLselect instr(NULL, '23');
-- 结果为 NULLselect length('123');
-- 结果为 3select length('');
-- 结果为 0select length(NULL);
-- 结果为 NULLselect locate('12', '1212');
-- 结果为 1select locate('12', '1212', 1);
-- 结果为 1select locate('12', '1212', 2);
-- 结果为 3select lower('Aa');
-- 结果为 aaselect lcase('Aa');
-- 结果为 aaselect lpad('123', 5, '0');
-- 结果为 00123select lpad('123', 2, '0');
-- 结果为 12select lpad('123', 5, '');
-- 结果为 NULLselect ltrim(' 123 3 ');
-- 结果为 '123 3 'select ngrams(array(array('from','a'),array('from','a'),array('from','b')), 2, 1);
-- 结果为 [{"ngram":["from","a"],"estfrequency":2.0}]select ngrams(array(array('from','a'),array('from','a'),array('from','b')), 1, 1);
-- 结果为 [{"ngram":["from"],"estfrequency":3.0}]select octet_length('AAA1');
-- 结果为 15select parse_url('https://github.com/TheUncleWhoGrowsBeans/Melon-and-fruit-fields', 'HOST');
-- 结果为 github.comselect parse_url('https://github.com/TheUncleWhoGrowsBeans/Melon-and-fruit-fields', 'PATH');
-- 结果为 /TheUncleWhoGrowsBeans/Melon-and-fruit-fieldsselect parse_url('http://hostname.com/path?k1=v1&k2=v2#ref1', 'REF');
-- 结果为 ref1select parse_url('http://hostname.com/path?k1=v1&k2=v2#ref1', 'QUERY', 'k2');
-- 结果为 v2select printf('%s%d岁了', 'Uncle Bean', 1);
-- 结果为 Uncle Bean1岁了select quote('Uncle Bean');
-- 结果为 'Uncle Bean'select regexp_extract('http://hostname.com/path?k1=v1&k2=v2#ref1', 'http://([0-9a-zA-z]+.[0-9a-zA-z]+)/', 1);
-- 结果为 hostname.comselect regexp_replace('我1不23要456数7890字', '[0-9]+', '');
-- 结果为 我不要数字select repeat('a', 3);
-- 结果为 aaaselect replace('123123', '123', 'haha');
-- 结果为 hahahahaselect reverse('1234');
-- 结果为 4321select rpad('123', 5, '0');
-- 结果为 12300select rpad('123', 2, '0');
-- 结果为 12select rpad('123', 5, '');
-- 结果为 NULLselect rtrim('1 123 ');
-- 结果为 1 123select sentences('Hello Bean! How are you?');
-- 结果为 [["Hello","Bean"],["How","are","you"]]select concat('->', space(3), '<-');
-- 结果为 -> <-select split('123123', '2');
-- 结果为 ["1","31","3"]select split('123123', '12');
-- 结果为 ["","3","3"]select str_to_map('k1:v1,k2:v2');
-- 结果为 {"k1":"v1","k2":"v2"}select substr('12345', 2);
-- 结果为 2345select substring('12345', 2);
-- 结果为 2345select substr('12345', 2, 3);
-- 结果为 234select substring('12345', 2, 3);
-- 结果为 234select substring_index('1.2.3', '.', 2);
-- 结果为 1.2select substring_index('1.2.3', '.', -2);
-- 结果为 2.3select translate('abc不是ab', 'abc', 'd');
-- 结果为 d不是dselect translate('abc不是a,也不是b,也不是c', 'abc', 'd');
-- 结果为 d不是d,也不是,也不是select concat('->', trim(' 1 1 '), '<-');
-- 结果为 ->1 1<-select unbase64('VW5jbGUgQmVhbg==');
-- 结果为 Uncle Beanselect upper('aa');
-- 结果为 AAselect ucase('aa');
-- 结果为 AAselect initcap('the uncle who grows beans');
-- 结果为 The Uncle Who Grows Beansselect levenshtein('hehe', 'haha');
-- 结果为 2select soundex('Uncle Bean');
-- 结果为 U524