apache / apache/hop

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

Open
#4,395 1 comment 0 reactions 0 assignees View on GitHub
awaiting triage P3 Transforms
Dominant language
Java
Stars
1.5k
Forks
476
Avg merge
18h 32m
Merged PRs (30d)
216

Description

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

Contributor guide

Open the contributing guide

Research direction

The report names the JSON Input transform and its jsonPath expressions; start by locating that transform and how it resolves attribute indexes. No file or test is named. Done means the example paths return the first key name as "doc.tipo" and its value as "XG".

Written by the indexing model from the issue text.

Assessment

Tech stack
json
Domain
data-engineering
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.