What exactly does the double colon mean in Pig?
apache-pig, hadoop
Solution
In your question :: is the disambiguate operator and it is use to identify field names after JOIN, COGROUP, CROSS or FLATTEN Operators. You can find an example of using disambiguate operator here.
In your case you have two fields observerID and endpoint and they both are identified by the key alias means both observerID and endpoint are referenced in same alias while there could be other "observerID and endpoint" referenced to other the "key" alias.
I think you have used something as below:
key = some_statement_with_observerID_and_endpoint
otherkey = some_statement_with_observerID_and_endpoint
Based on that you got to see something like as below:
key::observerId:chararray,key::endpoint:chararray,...
The above sentence means the observerID and endpoint you see are part of the key alias not the otherkey alias.
Problem
When I use `DESCRIBE` I see a lot of double colons in the Pig output, and it's not obvious what they mean. For example, after grouping and flattening, I see something like: `key::observerId:chararray,key::endpoint:chararray,...` At some point I had grouped by observerId and endpoint, renamed the group tuple to 'key', and then reflattened. So, what exactly does the double colon mean, and how should I refer to the first relation (key? observerId?)