Select

Filters out data based on specified condition.

Usage

select (data, condition : selected-data)

Details

The condition is similar to a SQL WHERE clause expression. Conjunctive, disjunctive, and negated condition expressions can be constructed by using and, or, and not. The following comparators are allowed: To compare against string and date literals, these literals must be explicitly denoted as string and date types: When using like/notlike:

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 answer
      
       BODY
       {
         select (books, "(pages < 100) and (pub_date <= @01-01-1990)" : answer)
       }
      }
    
will generate the following output:
      ----------------------------------------------
      RELATION: test_answer
         attrs: title, author, pub_date, pages
      ----------------------------------------------
      Title4|Author3|01-01-1968|32
      ----------------------------------------------