Friday, 23 December 2022

Hive: substr: return sub string

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)

  

Previous                                                    Next                                                    Home

No comments:

Post a Comment