I want to read csv file into dfTRUEcsv
How to get the value (03,05) and 11 as string in the below eg
I want to pass those string as a parameter to get files from that folder
i will pass (03,05) and 11 as parameters
if TRUE , for each Loop start Folder3 ;
Folder5 ;
Folder11
+-------------+--------------+--------------------+-----------------+--------+
|Calendar_year|Calendar_month|EDAP_Data_Load_Statu|lake_refined_date|isreload|
+-------------+--------------+--------------------+-----------------+--------+
| 2019| 2| HIST| 20190829| FALSE|
| 2019| 3| HIST| 20190829| TRUE|
| 2019| 4| HIST| 20190829| FALSE|
| 2019| 5| HIST| 20190829| TRUE|
| 2019| 11| HIST| 20190829| FALSE|
+-------------+--------------+--------------------+-----------------+--------+
if the file has column isreload =='TRUE'
var Foldercolumn Calendar_month
Foldercolumn = 03
Foldercolumn = 05
else
var Foldercolumn max(Calendar_year ),max(Calendar_month )
Foldercolumn = 11
end if
below is my spark code for the above requirement
val destinationContainerPath= "Finance/Data"
val dfCSVLogs = readCSV(s"$destinationContainerPath/sourcecsv.csv")
val dfTRUEcsv = dfCSVLogs.select(dfCSVLogs.col("*")).filter("isreload =='TRUE'")
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…