title: How to test if a bag is empty in Pig Latin?
body: <p>I have a bag say C, that may may come back empty from an operation.
  I want to test whether or not C is empty,
  And if so populate a new tuple in a different bag with value 'true'; otherwise 'false'.
  The difficulty I think is, it's testing the C bag as a whole, and if so populate a new tuple in a different bag, not C.
  I tried:
  grunt> E = FILTER C BY not IsEmpty(C);
  And get</p>
  
  <p>2014-05-01 14:12:28,065 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: Pig script failed to parse:
   Invalid scalar projection: C_grouped : A column needs to be projected from a relation for it to be used as a scalar</p>
  
  <p>Seems like Pig expects me to first do a join on C first? I.e. I am not using this right ..</p>
  
  <p>Thanks!</p>