|
| 1 | +package com.sap.hadoop.windowing.functions2.table.npath; |
| 2 | + |
| 3 | +import com.sap.hadoop.windowing.WindowingException; |
| 4 | +import com.sap.hadoop.windowing.functions2.TableFunctionEvaluator; |
| 5 | +import com.sap.hadoop.windowing.runtime2.Partition; |
| 6 | + |
| 7 | +/** |
| 8 | + * return rows that meet a specified pattern. Use symbols to specify a list of expressions to match. |
| 9 | + * Pattern is used to specify a Path. The results list can contain expressions based on the input columns |
| 10 | + * and also the matched Path. |
| 11 | + * <ol> |
| 12 | + * <li><b>pattern:</b> pattern for the Path. Path is 'dot' separated list of symbols. |
| 13 | + * Each element is treated as a symbol. Elements that end in '*' or '+' are interpreted with the |
| 14 | + * usual meaning of zero or more, one or more respectively. For e.g. "LATE.EARLY*.ONTIMEOREARLY" implies a sequence of flights |
| 15 | + * where the first occurrence was LATE, followed by zero or more EARLY flights, followed by a ONTIME or EARLY flight. |
| 16 | + * <li><b>symbols</b> specify a list of name, expression pairs. For e.g. |
| 17 | + * 'LATE', arrival_delay > 0, 'EARLY', arrival_delay < 0 , 'ONTIME', arrival_delay == 0. |
| 18 | + * These symbols can be used in the Pattern defined above. |
| 19 | + * <li><b>resultSelectList</b> specified as a select list. |
| 20 | + * The expressions in the selectList are evaluated in the context where all the input columns are available, plus the attribute |
| 21 | + * "tpath" is available. Path is a collection of rows that represents the matching Path. |
| 22 | + * </ol> |
| 23 | + */ |
| 24 | +public class NPath extends TableFunctionEvaluator |
| 25 | +{ |
| 26 | + /** |
| 27 | + * <ul> |
| 28 | + * <li> check structure of Arguments: |
| 29 | + * <ol> |
| 30 | + * <li> First arg should be a String |
| 31 | + * <li> then there should be an even number of Arguments: String, expression; expression should be Convertible to Boolean. |
| 32 | + * <li> finally there should be a String. |
| 33 | + * </ol> |
| 34 | + * <li> convert pattern into a NNode chain. |
| 35 | + * <li> convert symbol args into a Symbol Map. |
| 36 | + * <li> parse selectList into SelectList struct. The inputOI used to translate these expressions should be based on the |
| 37 | + * columns in the Input, the 'path.attr' |
| 38 | + * </ul> |
| 39 | + */ |
| 40 | + @Override |
| 41 | + public void setupOI() throws WindowingException |
| 42 | + { |
| 43 | + |
| 44 | + } |
| 45 | + |
| 46 | + @Override |
| 47 | + public void execute(Partition iPart, Partition outP) throws WindowingException |
| 48 | + { |
| 49 | + |
| 50 | + } |
| 51 | +} |
0 commit comments