I'm trying to use PySpark to read in a CSV file with many columns. The inferschema option is great at inferring majority of the columns' data types. If I want to override just one of the columns types that were inferred incorrectly, what is the best way to do this?
I have this code working, but it makes PySpark import only the one column that is specified in the schema, which is not want I want.
schema = StructType() \
.add("column_one_of_many", StringType(), True)
spark.read.format('com.databricks.spark.csv') \
.option('delimited',',') \
.option('header','true') \
.option('inferschema', 'true') \
.schema(self.schema) \
.load('dbfs:/FileStore/some.csv')
Is what I'm asking for even possible?
Thank you for your time and guidance :)