I have a mixed type dataframe. I am reading this dataframe from hive table using spark.sql(\'select a,b,c from table\') command.
spark.sql(\'select a,b,c from table\')
Some columns are int
Just:
from pyspark.sql.functions import col table = spark.sql("table") table.select([col(c).cast("string") for c in table.columns])