You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by ckmcd <gi...@git.apache.org> on 2016/04/03 22:24:46 UTC

[GitHub] nifi pull request: NIFI-1661 add random() function to expression l...

GitHub user ckmcd opened a pull request:

    https://github.com/apache/nifi/pull/322

    NIFI-1661 add random() function to expression language.

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ckmcd/nifi NIFI-1661

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nifi/pull/322.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #322
    
----
commit 75f567c2f5aac12f62eda8ed421130071bd2689b
Author: Chris McDermott <ch...@hpe.com>
Date:   2016-04-03T20:19:55Z

    NIFI-1661 add random() function to expression language.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request: NIFI-1661 add random() function to expression l...

Posted by jskora <gi...@git.apache.org>.
Github user jskora commented on the pull request:

    https://github.com/apache/nifi/pull/322#issuecomment-213070365
  
    @ckmcd this has been merged to the 1.0 and 0.x branches.  Looks great and works well.
    
    I forgot to put  "this closes" on the commit, could you please close the PR?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request: NIFI-1661 add random() function to expression l...

Posted by jskora <gi...@git.apache.org>.
Github user jskora commented on the pull request:

    https://github.com/apache/nifi/pull/322#issuecomment-211107429
  
    This looks pretty good, but in testing I came across 2 problems that need to be addressed before it can be merged.
    
    1. The example in the [expression language guide](https://github.com/apache/nifi/pull/322/files#diff-daac74ec3b89e26d99806d7a90254fe3R1313) should be `${random():mod(10):plus(1)}` since EL uses [plus](http://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#plus) for addition.
    
    1. Though Math.Random appears to only return positive floats, `nextLong()` must be returning positive and negative numbers.  Using the example expression I get numbers between -100 and 100 showing in the attributes.  The documentation should reflect that this could be positive or negative and the example needs to be adjusted for that as well.
    
    In spite of the problems, nice job incorporating the EL Guide changes!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request: NIFI-1661 add random() function to expression l...

Posted by ckmcd <gi...@git.apache.org>.
Github user ckmcd commented on the pull request:

    https://github.com/apache/nifi/pull/322#issuecomment-211429563
  
    I've update the PR to address the issues (1 & 2) from above.  
    
    1. Updated the EL Guide to use plus() instead of add()
    2. Use Math.abs() so as only to generate non-negative numbers.  Updated EL guide to reflect this change.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #322: NIFI-1661 add random() function to expression langua...

Posted by ckmcd <gi...@git.apache.org>.
Github user ckmcd closed the pull request at:

    https://github.com/apache/nifi/pull/322


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---