Friday 23 December 2022

Hive: substring: return sub string

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)


Previous                                                    Next                                                    Home

No comments:

Post a Comment