I am having the below directory in HDFS.
/HDFS/file/date=20200801/id=1
..
/HDFS/file/date=20200831/id=1
/HDFS/file/date=20200901/id=1
/HDFS/file/date=20200902/id=1
/HDFS/file/date=20200903/id=1
...
/HDFS/file/date=20200930/id=1
I am reading these files using
df=spark.read.parquet('/HDFS/file/').option("mergeSchema","true")
The problem is couple of columns in the above file has double format in some files while the same columns have String format in some files.
The merge schema gives me a error that cannot merge schema for double and string type.
Is there a way to handle the schema while reading the parquet files to convert the problem columns to string while reading?