You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by YolandaMDavis <gi...@git.apache.org> on 2016/12/21 02:39:48 UTC

[GitHub] nifi pull request #1348: NIFI-3010 - Incorporate Expression Language support...

GitHub user YolandaMDavis opened a pull request:

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

    NIFI-3010 - Incorporate Expression Language support for JoltTransformJSON

    This PR contains several feature enhancements:
    
    - Support of expression language within the specification
    - Support of expression language testing using Advanced UI with new Test Attributes dialog
    - Update of Jolt library to version 0.1
    - Added support for new Modifier library (Jolt Beta functionality)
    
    For Testing:
    
    Expression language can now be referenced within a Jolt Specification. Expressions can be written on either side on the left hand side ( matching input json keys) or the right hand side (output of json data) of the specification. The Advanced UI can test expressions that reference attributes using the Attributes dialog which allows users to provide key/value pairs that will be resolved when testing a transformation.
    
    <img width="1552" alt="joltspecel" src="https://cloud.githubusercontent.com/assets/1371858/21375258/4e9f1878-c6fa-11e6-9a45-2213e6f42107.png">
    
    <img width="1552" alt="joltspecel-variabledialog" src="https://cloud.githubusercontent.com/assets/1371858/21375261/52c60d44-c6fa-11e6-9fff-9e815c6e7ce9.png">
    
    Jolt 0.1 has added support for transformation of data within a given schema through the Modifier library. Modifier introduces more sophisticated data manipulation capabilities including for strings, lists, type conversion, etc.
    
    <img width="1552" alt="joltspec-modfiers" src="https://cloud.githubusercontent.com/assets/1371858/21375249/4080ccb4-c6fa-11e6-8e34-c41c33644aa9.png">
    
    Below is an example chain specification that can be used against Twitter payload for testing.  When testing in the Advanced UI ensure that attributes referenced in expression language  are provided for testing (${rating.var} and ${id.var}) and that left side variable content match actual input (e.g. id.var should equal 'id' for twitter json to match). Custom attributes can also be configured with nifi to use this specification within an actual flow.
    `
     [{
        "operation": "shift",
        "spec": {
          "created_at": "created_date_time",
          "id": "tweet_id",
          "text": "tweet_text",
          "user": {
            "${id.var}": "user_id"
          }
        }
    },
    {
        "operation": "default",
        "spec":{
       		"user-rating" : 4,
            "twitter-rating" : "${rating.var}"
     	}
    },{
    	"operation": "modify-default-beta",
    	"spec": {
    		"~in_reply_to_status_id": 0,
    	"~in_reply_to_status_id_str": 0,
    	"~in_reply_to_user_id": "",
    	"~in_reply_to_user_id_str": 0,
    	"~in_reply_to_screen_name": ""
    	}
    },{
    	"operation": "modify-define-beta",
    	"spec": {
    		"user_nearby_address":"na"
    	}
    },{
    	"operation": "modify-overwrite-beta",
    	"spec": {
    		"truncate" : true
        }
    }
    ]
    `
    
    Thank you for submitting a contribution to Apache NiFi.
    
    In order to streamline the review of the contribution we ask you
    to ensure the following steps have been taken:
    
    ### For all changes:
    - [x] Is there a JIRA ticket associated with this PR? Is it referenced 
         in the commit message?
    
    - [x] Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
    
    - [x] Has your PR been rebased against the latest commit within the target branch (typically master)?
    
    - [x] Is your initial contribution a single, squashed commit?
    
    ### For code changes:
    - [x] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder?
    - [x] Have you written or updated unit tests to verify your changes?
    - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? 
    - [ ] If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly?
    - [ ] If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly?
    - [ ] If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties?
    
    ### For documentation related changes:
    - [x] Have you ensured that format looks appropriate for the output in which it is rendered?
    
    ### Note:
    Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.
    


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

    $ git pull https://github.com/YolandaMDavis/nifi NIFI-3010

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

    https://github.com/apache/nifi/pull/1348.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 #1348
    
----
commit 3f48b3c5bcf757f8eec9f629afa36036e7e70b51
Author: Yolanda M. Davis <yo...@gmail.com>
Date:   2016-12-19T17:40:03Z

    NIFI-3010 - Incorporate expression language support for jolt-spec for processor and Advance UI. Upgraded jolt library to latest version for support of modify functions. Also refactored to interact with JoltTransform interface and updated styling

----


---
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 issue #1348: NIFI-3010 - Incorporate Expression Language support for Jo...

Posted by scottyaslan <gi...@git.apache.org>.
Github user scottyaslan commented on the issue:

    https://github.com/apache/nifi/pull/1348
  
    @YolandaMDavis I have reviewed the UI portion of this PR and LGTM! +1


---
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 issue #1348: NIFI-3010 - Incorporate Expression Language support for Jo...

Posted by YolandaMDavis <gi...@git.apache.org>.
Github user YolandaMDavis commented on the issue:

    https://github.com/apache/nifi/pull/1348
  
    @scottyaslan @mcgilman @moranr would appreciate your input, especially on recent styling 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 #1348: NIFI-3010 - Incorporate Expression Language support...

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

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


---
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 issue #1348: NIFI-3010 - Incorporate Expression Language support for Jo...

Posted by joewitt <gi...@git.apache.org>.
Github user joewitt commented on the issue:

    https://github.com/apache/nifi/pull/1348
  
    +1 merged to master.  Great contrib Yolanda!  Thanks for reviewing the ui scott.  full clean built w/contrib check clear.  Tested on several flows at high rates/with and without el statements.


---
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.
---