Casting string to integer gives NULL values in spark sql

Viewed 500
%sql 
select int('00000282001368')

gives me 282001368 which is correct, when I do the same thing for below string it gives me NULL

%sql
select int('00012300000079')

gives me NULL

How to get the Integer in the second scenario?

Thanks in advance

1 Answers

You should use bigint. Second one is not in int range.

select bigint('00012300000079')
Related