How to do exception handling for file reading.
For example, I have a daily job that will run at 8:00 am. It reads files from Azure data lake storage(Gen 2). The path looks like 2022/01/06/data.csv. So the file will not be populated in ADLS for all the days. So whenever the file is not populated the job is getting failed. So I tried using try-catch to handle the exception. Is there any other way to handle the exception?
df1 = spark.read.format('csv').load(fileLocation)