data = load 'hdfs://zbt:9000/user/pig/1987_600.csv' using PigStorage(',') as (Year,Month,DayofMonth,DayOfWeek,DepTime,CRSDepTime,ArrTime,CRSArrTime,UniqueCarrier,FlightNum,TailNum,ActualElapsedTime,CRSElapsedTime,AirTime,ArrDelay,DepDelay,Origin,Dest,Distance,TaxiIn,TaxiOut,Cancelled,CancellationCode,Diverted,CarrierDelay,WeatherDelay,NASDelay,SecurityDelay,LateAircraftDelay);
data = load '1987_600.csv' using PigStorage(',') as (Year,Month,DayofMonth,DayOfWeek,DepTime,CRSDepTime,ArrTime,CRSArrTime,UniqueCarrier,FlightNum,TailNum,ActualElapsedTime,CRSElapsedTime,AirTime,ArrDelay,DepDelay,Origin,Dest,Distance,TaxiIn,TaxiOut,Cancelled,CancellationCode,Diverted,CarrierDelay,WeatherDelay,NASDelay,SecurityDelay,LateAircraftDelay);
filter_data = filter data by DayOfWeek>=1;
group_week1 = group filter_data by DayOfWeek; foreach_group_week1 = foreach group_week1 generate group, COUNT($1); dump foreach_group_week1
week_concat = foreach filter_data generate CONCAT (UniqueCarrier, FlightNum) as hangBanHao, Distance; group_week2 = group week_concat by hangBanHao; foreach_group_week2 = foreach group_week2 generate group, SUM(week_concat.Distance); dump foreach_group_week2
store foreach_group_week1 into 'flight1.dat'; store foreach_group_week2 into 'flight2.dat';