Pig Latin 中的多重连接
Multiple JOIN in Pig Latin
在 HQL 中,我们有
JOIN weather ON (weather.Year = flight.Year AND weather.Month = flight.Month and weather.Day=flight.DayofMonth)
在 Pig Latin 中,是否可以将其放入一个查询中?或者我必须分开做然后合并它们?
可能见here:
You can also join on multiple keys. In all cases you must have the
same number of keys, and they must be of the same or compatible types
示例:
weather = load '/weather/files/' as (Year,Month,Day,Fieldx);
flight = load '/flight/files/' as (Year,Month,Day,Fieldy);
jnd = join weather by (Year,Month,Day), flight by (Year,Month,Day);
在 HQL 中,我们有
JOIN weather ON (weather.Year = flight.Year AND weather.Month = flight.Month and weather.Day=flight.DayofMonth)
在 Pig Latin 中,是否可以将其放入一个查询中?或者我必须分开做然后合并它们?
可能见here:
You can also join on multiple keys. In all cases you must have the same number of keys, and they must be of the same or compatible types
示例:
weather = load '/weather/files/' as (Year,Month,Day,Fieldx);
flight = load '/flight/files/' as (Year,Month,Day,Fieldy);
jnd = join weather by (Year,Month,Day), flight by (Year,Month,Day);