Search code examples
sqlhadoophive

How to trim leading zero in Hive


How to trim leading zero in Hive, I search too much on google but I didn't get any correct thing which is useful for my problem.

If digit is "00000012300234" want result like "12300234"


Solution

  • nothing to do just cast the string in INT

    SELECT CAST( "00000012300234"  AS INT);
    

    it will return 12300234