There are 2 Data Frames one contain the price information as follows (day 1 to Day 100 as 100 rows),
StoreId,ItemID, Date,Price
HH-101,item1, d_1, €9
HH-101,item1, d_2, €7
……………………………
DH-101,item1, d_90, €4
……………………………
HH-101,item1, d_100, €3
The 2nd data frame is a sales Information as shown (day 1 to Day 100 as 100 columns but 1 row)
Stored_ID, ItemID, d-1, d-2, d-3,……. d-90,d-100
HH-101 , item1 , 2 , 4 , 0,………..,12 ,22
HH-101 , item2 , 1 , 0 , 3 ……………,3 ,3
What is the optimum PySpark script to produce another Data frame
with new column, which has the summation of
number of unit * Sales price , corresponding to each item
example for store HH-101 and item1
2*9+ 4*7+........+.....+...12*4+22*3
Is there any single step instead of wrting sum of product for more than 100 column