convert to int pyspark code example
Example 1: pyspark convert float results to integer replace
data_df = data_df.withColumn("Plays", data_df["Plays"].cast(IntegerType()))
Example 2: pyspark cast column to long
changedTypedf = joindf.withColumn("label", joindf["show"].cast("double"))
// types = ['BinaryType', 'BooleanType', 'ByteType', 'DateType',
// 'DecimalType', 'DoubleType', 'FloatType', 'IntegerType',
// 'LongType', 'ShortType', 'StringType', 'TimestampType']