Hi Akshay,
Hope you are running the Pig sample tutorial.
Please make sure the case of keyword AVG is Upper case as shown below.
d = foreach c generate AVG(b.stock_volume);
Once you give proper case, it runs successfully without any issues.
Regards,
N U M