在HQL中,我们有
JOIN weather ON (weather.Year = flight.Year AND weather.Month = flight.Month and weather.Day=flight.DayofMonth)
在Pig Latin中,是否可以将其纳入一个查询?或者我必须单独进行并将它们组合起来?
答案 0 :(得分:1)
可能会看到here:
您还可以加入多个密钥。在所有情况下,你必须拥有 相同数量的密钥,它们必须是相同或兼容的类型
示例:
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);