I have eight Pyspark dataframes with names such as "store", "inventory", and "storage".
I need to create views for each one but in order to streamline, instead of saying
store.createOrReplaceTempView('store_view') etc.
Is it possible to iterate through a list of dataframes and create a view? For example:
df_list = ["store", "inventory", "storage"]
for d in df_list:
x = "convert dataframe d to a string"
d.createOrReplaceTempView(x)
How can I assign the dataframe name as a string to x?
I suppose you could do the opposite - have a list of strings but then how to get the dataframe from that?