support for pig in query and job result
fixes based on feedback from @repeatedly
minor rearrangement of lines