RamanGrover29@gmail.com | 58cf330 | 2012-11-09 00:27:45 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Description : Create UDF and invoke with negative inputs. |
| 3 | * Expected Res : Failure |
| 4 | * Date : 5th Sep 2012 |
| 5 | */ |
| 6 | |
| 7 | // This one returns NPE... |
| 8 | |
| 9 | drop dataverse test if exists; |
| 10 | create dataverse test; |
| 11 | |
RamanGrover29@gmail.com | 2471039 | 2012-11-11 18:57:42 +0000 | [diff] [blame] | 12 | write output to nc1:"rttest/user-defined-functions_udf25.adm"; |
RamanGrover29@gmail.com | 58cf330 | 2012-11-09 00:27:45 +0000 | [diff] [blame] | 13 | |
| 14 | create function test.computeBonus($pbcRating,$salary) |
| 15 | { |
| 16 | if ($pbcRating = 1) then |
| 17 | $salary * 0.25 |
| 18 | else |
| 19 | $salary * 0.10 |
| 20 | } |
| 21 | |
| 22 | test.computeBonus(-1,-1) |
| 23 | |