title: How to read data from data bag within a PIG script
body: <p>I have a databag which is the following format
  <code>{([ChannelName#{ (bigXML,[])}   ])}</code></p>
  
  <ul>
  <li>DataBag consists of only one item which is a Tuple. </li>
  <li>Tuple consists of only item that is Map.</li>
  <li>Map is of type  which is a map between channel names and values.</li>
  <li>Here is value is of type DataBag, which consists of only one tuple. </li>
  <li>The tuple consists of two items one is a charrarray (very big string) and other is a map</li>
  </ul>
  
  <p>I have a UDF that emits the above bag.</p>
  
  <p>Now i need to invoke another UDF by passing the only tuple within the DataBag against a given Channel from the Map.</p>
  
  <p>Assuming there was not data bag and a tuple as
  <code>([ChannelName#{ (bigXML,[])}   ])</code>
  I can access the data using <code>$0.$0#'StdOutChannel'</code>
  Now with the tuple inside a bag
  <code>{([ChannelName#{ (bigXML,[])}   ])}</code> 
  If i do <code>$0.$0.$0#'StdOutChannel'</code>  (Prepend $0), i get the following error
   <code>ERROR 1052: Cannot cast bag with schema bag({bytearray}) to map</code></p>
  
  <p>How can I access data within a data bag?</p>