I am trying to convert a string to integer in my PySpark code.
input = 1670900472389, where 1670900472389 is a string
I am doing this but it's returning null.
df = df.withColumn("lastupdatedtime_new",col("lastupdatedtime").cast(IntegerType()))
I have read the posts on Stack Overflow. They have quotes or commas in their input string causing this. However that's not the case with my input string. Any ideas what's happening?