sp1
New Contributor II

Thanks for all your replies.

I have used widget using date and it's working as expected.

Here is the code:

drop view if exists inputdate1;

create view inputdate1 as select date_format(current_date()-1, 'yyyyMMdd') AS date UNION ALL select date_format(current_date(), 'yyyyMMdd') AS date;

%python

dataframe = sqlContext.sql('select * from inputdate1') 

values = [row.date for row in dataframe.select('date').collect()]

default_value = str(min(values))

values_str = [str(value) for value in values]

dbutils.widgets.dropdown("date", default_value, values_str)

CREATE OR REPLACE TEMPORARY VIEW abc_delivery_log

USING CSV

OPTIONS (

 header="true",

 delimiter=",",

 inferSchema="true",

 path="abfss://selfserv-xxxxx@xxxxx/xxxxx/abc_delivery_log_delivery_log_${date}*.csv"

);