0

How do I get the full value in hive? i.e. cast('0024' as bigint) will give only 24 but I need the complete 0024 as my output.

Any idea how to do this?

Warren Sergent
  • 2,542
  • 4
  • 36
  • 42
  • `24` is the right answer. If you need zeros before the number, then use a string. – Gordon Linoff Jun 24 '16 at 18:30
  • But I need 0024 because at target end I need to perform few computations and from source side that particular record value is coming as 00004546... Hence need full value – user6510278 Jun 24 '16 at 18:34
  • 1
    As a bigint, the full value is "24". If you need zeroes prepended to the value, then use a string. – Gordon Linoff Jun 25 '16 at 07:20
  • You have contradicting statements in your question .. If you are trying to convert it into an integer , it inherently means that you are gonna work with the value of the integer . If you insist that you need to do some thing at the other end , why not use a string and do operations on it – MysticForce Jun 26 '16 at 13:06
  • Please provide more context for any further help – MysticForce Jun 26 '16 at 13:07

0 Answers0