apache / hop

Hop Orchestration Platform
https://hop.apache.org/
Apache License 2.0
997 stars 353 forks source link

[Feature Request]: JSON Input get key name and value by attribute index #4395

Open kleysonr opened 1 month ago

kleysonr commented 1 month ago

What would you like to happen?

I would like to set a jsonPath in JSON Input to get the key name and key value for a given attribute index.

For example, considering the json below and the following jsonPaths:

{
    "doc.tipo": "XG",
    "pk_dt_update": "2024-09-13 08:55:16.954",
    "pk_orgao": "ssx",
    "pk_base_dados": "XG",
    "pk_documento": "0000",
    "tipo_registro": "dados",
    "tipo_documento": "pf"
}
key_name: $.[0].name()
key_value: $.[0]

I would like to have:

key_name: "doc.tipo"
key_value: "XG"

Issue Priority

Priority: 3

Issue Component

Component: Transforms

FLYFLU commented 2 weeks ago

What would you like to happen?

I would like to set a jsonPath in JSON Input to get the key name and key value for a given attribute index.

For example, considering the json below and the following jsonPaths:

{
    "doc.tipo": "XG",
    "pk_dt_update": "2024-09-13 08:55:16.954",
    "pk_orgao": "ssx",
    "pk_base_dados": "XG",
    "pk_documento": "0000",
    "tipo_registro": "dados",
    "tipo_documento": "pf"
}
key_name: $.[0].name()
key_value: $.[0]

I would like to have:

key_name: "doc.tipo"
key_value: "XG"

Issue Priority

Priority: 3

Issue Component

Component: Transforms use [] to resolve this,config in hop like $.['doc.tipo']