Refactored to use apache pig for timestamp min/max detection