You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by 彭光裕 <ro...@cht.com.tw> on 2016/01/11 03:45:41 UTC

how to sort json array in dataflow

Hi,
        I have a json array flowfile and would like to sort the json array by some certain value (let’s say price). Is it possible sort json array within nifi dataflow? I have tried EvaluateJsonPath processor, but jsonpath doesn’t support sort syntax. I still can’t figure it out how to do this. Any suggestion would be welcome, thanks in advance.

Roland.

Please be advised that this email message (including any attachments) contains confidential information and may be legally privileged. If you are not the intended recipient, please destroy this message and all attachments from your system and do not further collect, process, or use them. Chunghwa Telecom and all its subsidiaries and associated companies shall not be liable for the improper or incomplete transmission of the information contained in this email nor for any delay in its receipt or damage to your system. If you are the intended recipient, please protect the confidential and/or personal information contained in this email with due care. Any unauthorized use, disclosure or distribution of this message in whole or in part is strictly prohibited.  Also, please self-inspect attachments and hyperlinks contained in this email to ensure the information security and to protect personal information.

Re: how to sort json array in dataflow

Posted by Joe Percivall <jo...@yahoo.com>.
Hello Roland,

Were you able to achieve any success incorporating the JSON sorting into a custom processor?
 
Joe
- - - - - - 
Joseph Percivall
linkedin.com/in/Percivall
e: joepercivall@yahoo.com



On Monday, January 11, 2016 2:03 AM, 彭光裕 <ro...@cht.com.tw> wrote:



Hello Joe,
    Thanks for your response.

    You can refer to http://www.trentrichardson.com/jsonsql/ for more details about what I've mentioned.

    Besides that, http://doc.snaplogic.com/jsonpath , this project also extends jsonpath for more functions something like sort,etc.
    for examples: $.children.sort_asc(value.age) / $.children.sort_desc(value.age)

Roland.
-----Original Message-----
From: Joe Witt [mailto:joe.witt@gmail.com] 
Sent: Monday, January 11, 2016 10:52 AM
To: users@nifi.apache.org
Subject: Re: how to sort json array in dataflow

Hello Roland

I don't believe we have out of the box support for that but it would make for likely a well scoped custom processor.

You mention support for sort syntax.  Can you share what that might look like?

Thanks
Joe

On Sun, Jan 10, 2016 at 9:45 PM, 彭光裕 <ro...@cht.com.tw> wrote:
> Hi,
>
>         I have a json array flowfile and would like to sort the json 
> array by some certain value (let’s say price). Is it possible sort 
> json array within nifi dataflow? I have tried EvaluateJsonPath 
> processor, but jsonpath doesn’t support sort syntax. I still can’t 
> figure it out how to do this. Any suggestion would be welcome, thanks in advance.
>
>
>
> Roland.
>
>
>
> 本信件可能包含中華電信股份有限公司機密資訊,非指定之收件者,請勿蒐集、處理或利用本信件內容,並請銷毀此信件.
> 如為指定收件者,應確實保護郵件中本公司之營業機密及個人資料,不得任意傳佈或揭露,並應自行確認本郵件之附檔與超連結之安全性,以共同善盡資訊安全與個資保護責任.
> Please be advised that this email message (including any attachments) 
> contains confidential information and may be legally privileged. If 
> you are not the intended recipient, please destroy this message and 
> all attachments from your system and do not further collect, process, 
> or use them. Chunghwa Telecom and all its subsidiaries and associated 
> companies shall not be liable for the improper or incomplete 
> transmission of the information contained in this email nor for any 
> delay in its receipt or damage to your system. If you are the intended 
> recipient, please protect the confidential and/or personal information 
> contained in this email with due care. Any unauthorized use, 
> disclosure or distribution of this message in whole or in part is 
> strictly prohibited. Also, please self-inspect attachments and 
> hyperlinks contained in this email to ensure the information security and to protect personal information.


本信件可能包含中華電信股份有限公司機密資訊,非指定之收件者,請勿蒐集、處理或利用本信件內容,並請銷毀此信件.如為指定收件者,應確實保護郵件中本公司之營業機密及個人資料,不得任意傳佈或揭露,並應自行確認本郵件之附檔與超連結之安全性,以共同善盡資訊安全與個資保護責任.
Please be advised that this email message (including any attachments) contains confidential information and may be legally privileged. If you are not the intended recipient, please destroy this message and all attachments from your system and do not further collect, process, or use them. Chunghwa Telecom and all its subsidiaries and associated companies shall not be liable for the improper or incomplete transmission of the information contained in this email nor for any delay in its receipt or damage to your system. If you are the intended recipient, please protect the confidential and/or personal information contained in this email with due care. Any unauthorized use, disclosure or distribution of this message in whole or in part is strictly prohibited.  Also, please self-inspect attachments and hyperlinks contained in this email to ensure the information security and to protect personal information.

RE: how to sort json array in dataflow

Posted by 彭光裕 <ro...@cht.com.tw>.
Hello Joe,
	Thanks for your response.

	You can refer to http://www.trentrichardson.com/jsonsql/ for more details about what I've mentioned.

	Besides that, http://doc.snaplogic.com/jsonpath , this project also extends jsonpath for more functions something like sort,etc.
	for examples: $.children.sort_asc(value.age) / $.children.sort_desc(value.age)

Roland.
-----Original Message-----
From: Joe Witt [mailto:joe.witt@gmail.com] 
Sent: Monday, January 11, 2016 10:52 AM
To: users@nifi.apache.org
Subject: Re: how to sort json array in dataflow

Hello Roland

I don't believe we have out of the box support for that but it would make for likely a well scoped custom processor.

You mention support for sort syntax.  Can you share what that might look like?

Thanks
Joe

On Sun, Jan 10, 2016 at 9:45 PM, 彭光裕 <ro...@cht.com.tw> wrote:
> Hi,
>
>         I have a json array flowfile and would like to sort the json 
> array by some certain value (let’s say price). Is it possible sort 
> json array within nifi dataflow? I have tried EvaluateJsonPath 
> processor, but jsonpath doesn’t support sort syntax. I still can’t 
> figure it out how to do this. Any suggestion would be welcome, thanks in advance.
>
>
>
> Roland.
>
>
>
> 本信件可能包含中華電信股份有限公司機密資訊,非指定之收件者,請勿蒐集、處理或利用本信件內容,並請銷毀此信件.
> 如為指定收件者,應確實保護郵件中本公司之營業機密及個人資料,不得任意傳佈或揭露,並應自行確認本郵件之附檔與超連結之安全性,以共同善盡資訊安全與個資保護責任.
> Please be advised that this email message (including any attachments) 
> contains confidential information and may be legally privileged. If 
> you are not the intended recipient, please destroy this message and 
> all attachments from your system and do not further collect, process, 
> or use them. Chunghwa Telecom and all its subsidiaries and associated 
> companies shall not be liable for the improper or incomplete 
> transmission of the information contained in this email nor for any 
> delay in its receipt or damage to your system. If you are the intended 
> recipient, please protect the confidential and/or personal information 
> contained in this email with due care. Any unauthorized use, 
> disclosure or distribution of this message in whole or in part is 
> strictly prohibited. Also, please self-inspect attachments and 
> hyperlinks contained in this email to ensure the information security and to protect personal information.

本信件可能包含中華電信股份有限公司機密資訊,非指定之收件者,請勿蒐集、處理或利用本信件內容,並請銷毀此信件.如為指定收件者,應確實保護郵件中本公司之營業機密及個人資料,不得任意傳佈或揭露,並應自行確認本郵件之附檔與超連結之安全性,以共同善盡資訊安全與個資保護責任.
Please be advised that this email message (including any attachments) contains confidential information and may be legally privileged. If you are not the intended recipient, please destroy this message and all attachments from your system and do not further collect, process, or use them. Chunghwa Telecom and all its subsidiaries and associated companies shall not be liable for the improper or incomplete transmission of the information contained in this email nor for any delay in its receipt or damage to your system. If you are the intended recipient, please protect the confidential and/or personal information contained in this email with due care. Any unauthorized use, disclosure or distribution of this message in whole or in part is strictly prohibited.  Also, please self-inspect attachments and hyperlinks contained in this email to ensure the information security and to protect personal information.

Re: how to sort json array in dataflow

Posted by Joe Witt <jo...@gmail.com>.
Hello Roland

I don't believe we have out of the box support for that but it would
make for likely a well scoped custom processor.

You mention support for sort syntax.  Can you share what that might look like?

Thanks
Joe

On Sun, Jan 10, 2016 at 9:45 PM, 彭光裕 <ro...@cht.com.tw> wrote:
> Hi,
>
>         I have a json array flowfile and would like to sort the json array
> by some certain value (let’s say price). Is it possible sort json array
> within nifi dataflow? I have tried EvaluateJsonPath processor, but jsonpath
> doesn’t support sort syntax. I still can’t figure it out how to do this. Any
> suggestion would be welcome, thanks in advance.
>
>
>
> Roland.
>
>
>
> 本信件可能包含中華電信股份有限公司機密資訊,非指定之收件者,請勿蒐集、處理或利用本信件內容,並請銷毀此信件.
> 如為指定收件者,應確實保護郵件中本公司之營業機密及個人資料,不得任意傳佈或揭露,並應自行確認本郵件之附檔與超連結之安全性,以共同善盡資訊安全與個資保護責任.
> Please be advised that this email message (including any attachments)
> contains confidential information and may be legally privileged. If you are
> not the intended recipient, please destroy this message and all attachments
> from your system and do not further collect, process, or use them. Chunghwa
> Telecom and all its subsidiaries and associated companies shall not be
> liable for the improper or incomplete transmission of the information
> contained in this email nor for any delay in its receipt or damage to your
> system. If you are the intended recipient, please protect the confidential
> and/or personal information contained in this email with due care. Any
> unauthorized use, disclosure or distribution of this message in whole or in
> part is strictly prohibited. Also, please self-inspect attachments and
> hyperlinks contained in this email to ensure the information security and to
> protect personal information.