I have the following SparkSQL:
val resultDf = spark.sql("SELECT name, phone, country FROM users")
I'd like to filter returned records by countries which are present in the following collection:
val countries = Seq("Italy", "France", "United States", "Poland", "Spain")
For example I can create the broadcast variable based on the collection:
val countriesBroadcast = sc.broadcast(countries)
but is it possible(and if so - how?) to use the countriesBroadcast
variable inside of my SQL query?