title: apache pig script with time interval
body: <p>I want to SUM the RW column for each port hourly  </p>
  
  <pre><code>Time     ID  Name               RW        
  -------- --- -------         ----------
  14:57:01 000 Port0            1340
  14:57:01 001 Port1             13
  
  14:58:01 000 Port0             864
  14:58:01 001 Port1             36
  
  14:59:01 000 Port0            1394
  14:59:01 001 Port1             22
  
  15:57:01 000 Port0            1340
  15:57:01 001 Port1             13
  
  15:58:01 000 Port0            864
  15:58:01 001 Port1             36
  
  15:59:01 000 Port0            1394
  15:59:01 001 Port1             22
  .
  .
  .
  
  20:57:01 000 Port0            1340
  20:57:01 001 Port1             13
  
  20:58:01 000 Port0            864
  20:58:01 001 Port1            36
  
  20:59:01 000 Port0            1394
  20:59:01 001 Port1             22
  </code></pre>
  
  <p>My script is</p>
  
  <pre><code>data = LOAD 'hdfs:/data/data.txt' USING PigStorage(',') AS (time:chararray, id:chararray, name:chararray, read:int, write:int, rw:int);
  runs = FOREACH data GENERATE time, name, rw;
  </code></pre>
  
  <p>How to </p>