Pack

Embeds a relation within another relation.

Usage

pack (indata, attribute : outdata)

Details

The indata is embedded in a new relation outdata with one attribute, attribute. Packing data is often useful when one wants to associate a group of data with a single value, but does not want to relationally join the two sets of data.

Notes

Known Bugs

Example

Using the input:
      RELATION books: title char, author char, pub_date date, pages number
      Title1|Author1|09-01-1991|34
      Title2|Author2|12-23-1954|479
      Title3|Author2|05-09-2002|733
      Title4|Author3|01-01-1968|32
      Title5|Author2|07-03-2001|1152
    
when executing the plan:
      PLAN test
      {
       INPUT: stream books
       OUTPUT: stream result
      
       BODY
       {
         pack (books, "packed_books" : result)
       }
      }
    
generates a relation with one tuple, with one attribute ("packed_books") and one value (the embedded relation above).