Read file with glob pattern in spark
Glob pattern provides a way to select input files by pattern in file data source. Note that glob pattern is a simplified form of regex expression and is less powerful than regex. Below table list all the special characters in glob pattern.
// match csv files end with 10 or 12
val pattern = "/tmp/csv/*{10,12}.cvs"
val df = spark.read.csv(pattern)
df.show()