Open yuokada opened 7 years ago
hive> SELECT translate('012345', '135', 'abc');
OK
0a2b4c
Time taken: 2.867 seconds, Fetched: 1 row(s)
hive> SELECT translate('012345', '135', 'ab');
OK
0a2b4
Time taken: 0.067 seconds, Fetched: 1 row(s)
hive> SELECT translate('012345', '135', 'a');
OK
0a24
Time taken: 0.054 seconds, Fetched: 1 row(s)
hive> SELECT translate('012345', '135', 'aaa');
OK
0a2a4a
Time taken: 0.05 seconds, Fetched: 1 row(s)
hive> SELECT translate('012345', '135', '___');
OK
0_2_4_
Time taken: 0.043 seconds, Fetched: 1 row(s)
hive> SELECT translate(null, '135', '___');
OK
NULL
Time taken: 2.587 seconds, Fetched: 1 row(s)
hive> SELECT translate('12345', NULL, NULL);
OK
NULL
hive> SELECT translate('12345', '1', NULL);
OK
NULL
hive> SELECT translate('12345', '0', NULL);
OK
NULL
hive> SELECT translate('12345', '101', '987');
OK
92345
Duplicate pattern.
Like a this. Python String translate() Method