apache / apache/hop

[Bug]: JSON input - transform cannot retrieve number of elements in an array

Open
#2,362 0 comments 0 reactions 0 assignees View on GitHub
awaiting triage P3 Transforms
Dominant language
Java
Stars
1.5k
Forks
476
Avg merge
18h 33m
Merged PRs (30d)
204

Description

### Apache Hop version?

2.3

### Java version?

11

### Operating system

Windows

### What happened?

Migration: https://issues.apache.org/jira/browse/HOP-4076

In a JSON containing an array, "length()" should retrieve the number of array elements, which works flawlessly using [https://jsonpath.herokuapp.com/] on the attached input file using an "$.someArray.length() " path, returning 2 as the correct number of array elements.

However, using the HOP JSON input parser, is returned.

For reproducing the issue, see the notes in the attached pipeline.

[Archive.zip](https://github.com/apache/hop/files/10741980/Archive.zip)

### Issue Priority

Priority: 3

### Issue Component

Component: Transforms

Contributor guide

Open the contributing guide

Research direction

Start by opening the attached Archive.zip and following the reproduction notes in its pipeline. Then trace the JSON input parser's handling of the $.someArray.length() path and compare it with the expected array length of 2. Done means the parser returns 2 instead of null for this input.

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.