apache / apache/hop

[Bug]: JSON input transform loses the field to read from when it depends on success of a database query

Open
#5,953 2 comments 0 reactions 0 assignees View on GitHub
awaiting triage Hop Gui P3 Transforms
Dominant language
Java
Stars
1.5k
Forks
476
Avg merge
18h 32m
Merged PRs (30d)
216

Description

### Apache Hop version?

2.15

### Java version?

OpenJDK 17

### Operating system

Windows

### What happened?

When the field a JSON input transform reads is dependent on the success of a database query, the field vanishes in case the SQL query fails (e.g. due to non-existent table)

See the attached zip and the screenshots.

[HOP-5953.zip](https://github.com/user-attachments/files/23357677/HOP-5953.zip)

### How to reproduce:
- create a simple query in a Table input transform that packs a column (e.g. "id") read from a database into a string in JSON format , stream field that contains the JSON is called "id_json"
- read "id" out of the JSON-string via "JSON Input" transform, under "Select field:" use "id_json" in the drop-down
- as long as the query works / table exists, the JSON input parses everything correctly

Image

- now change the SQL query to use a NON-existing table and save the Table input transform
- edit the JSON input transform: accept both error messages
- what you see afterwards in the "File" tab of the "JSON input" transform is that the "Select field" LOST the field "id_json"

Image

- if you now hit OK and save (accidentally) the pipeline is stored with empty field to read from. (Happened a lot and caused quite a lot of troubles.)

### Issue Priority

Priority: 3

### Issue Component

Component: Hop Gui, Component: Transforms

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure using the Table input and JSON Input transforms described in the issue, including a query against a non-existent table. Trace how the failed query affects the JSON Input transform's Select field value; done means the id_json field remains available and is not saved as an empty input after the error messages are accepted.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.