I am reading an avro file from Azure data lake using databricks and I am using this path to read current date file for daily run, the code to drive the file date looks like this and it gets the current date fine.
val pfdtm = ZonedDateTime.now(ZoneOffset.UTC)
val fileDate =DateTimeFormatter.ofPattern("yyyy_MM_dd").format(pfdtm)
fileDate=2020-02-02
but when I use the fileDate variable in the path, it does not work, it raises path does not exist error. you can see the below path
val df=spark.read.format("com.databricks.spark.avro").load("adl://power.azuredatalakestore.net/SD_Case/eventhubspace/venthub/0_${fileDate}_*_*_*.avro")
but when I use the actual date instead of the variable, it works fine
val df=spark.read.format("com.databricks.spark.avro").load("adl://powerbiconnect.azuredatalakestore.net/SD_Case/sdeventhubspace/sdeventhub/0_2020_02_02_*_*_*.avro")
the actual folder path looks like this, with a sample daily file form day 2.
adl://power.azuredatalakestore.net/SD_Case/eventhubspace/venthub/0_2020_02_02_10_11_15.avro
I will appreciate any help on correcting my code. thanks in advance