不好笑
不好笑

Reputation: 105

Multiple JOIN in Pig Latin

In HQL, we have

JOIN weather ON (weather.Year = flight.Year AND weather.Month = flight.Month and weather.Day=flight.DayofMonth)

In Pig Latin, is it possible to fit it into one query? Or I have to do it separately and combine them?

Upvotes: 0

Views: 181

Answers (1)

54l3d
54l3d

Reputation: 3973

Its possible see 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

Example :

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);

Upvotes: 1

Related Questions