下午好 - 我有一个销售数据集,我正在尝试查看哪个商品的销量最多。这是我的代码:
Country:chararray,
Item_Type:chararray,
Sales_Channel:chararray,
Order_Priority_site:chararray,
Order_Date:chararray,
Order_ID:chararray,
Ship_Date:chararray,
Units_Sold:int,
Unit_Price: int,
Unit_Cost: int,
Total_Revenue: int,
Total_Cost: int,
Total_Profit:int);
D2 = FOREACH data GENERATE Item_Type, Units_Sold;
D3 = GROUP D2 BY Item_Type;
D4 = FOREACH D3 GENERATE group, SUM(Units_Sold);
DUMP D4;```
However, I get the error:
```<file D, line 20, column 36> Invalid field projection. Projected field [Units_Sold] does not exist in schema: group:chararray,D2:bag{:tuple(Item_Type:chararray,Units_Sold:int)}.```
Does anybody know how to fix this? Let me know if you need more info, this is the first qurstion I have posted on here