You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hop.apache.org by ha...@apache.org on 2026/05/22 13:41:23 UTC
(hop) branch main updated: JSON Normalize Input #7129 (#7130)
This is an automated email from the ASF dual-hosted git repository.
hansva pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hop.git
The following commit(s) were added to refs/heads/main by this push:
new 909942aa02 JSON Normalize Input #7129 (#7130)
909942aa02 is described below
commit 909942aa02088dae73ee1177bb3dcbfb3be34a0f
Author: Bart Maertens <ba...@know.bi>
AuthorDate: Fri May 22 13:41:16 2026 +0000
JSON Normalize Input #7129 (#7130)
* JSON Input flattened initial version
* doc updates, added integration tests
* updated tests, documentation
* integration test and doc updates
* added missing ASF header, fixes #7129
---
.../images/transforms/icons/JsonNormalizeInput.svg | 22 +
docs/hop-user-manual/modules/ROOT/nav.adoc | 1 +
.../ROOT/pages/pipeline/transforms/jsoninput.adoc | 15 +-
.../pipeline/transforms/jsonnormalizeinput.adoc | 166 +
.../json/0003-json-test-block-size.hpl | 2 +-
.../json/0003-json-write-block-size.hpl | 2 +-
.../0005-enhanced-json-output-empty-stream.hpl | 2 +-
.../0006-enhanced-json-output-json-fragment.hpl | 2 +-
...ock-size.hpl => 0008-json-normalize-orders.hpl} | 146 +-
...size.hpl => 0009-json-normalize-root-array.hpl} | 210 +-
...ck-size.hpl => 0010-json-normalize-complex.hpl} | 222 +-
.../json/0011-json-normalize-hop-config-layers.hpl | 647 +++
.../datasets/golden-json-normalize-complex.csv | 4 +
...golden-json-normalize-hop-config-lifecycles.csv | 2 +
.../golden-json-normalize-hop-config-projects.csv | 2 +
.../golden-json-normalize-hop-config-variables.csv | 3 +
.../json/datasets/golden-json-normalize-orders.csv | 3 +
.../datasets/golden-json-normalize-root-array.csv | 3 +
.../json/main-0003-json-test-block-size.hwf | 29 +-
...main-0005-enhanced-json-output-empty-stream.hwf | 25 +
...eam.hwf => main-0008-json-normalize-orders.hwf} | 48 +-
...hwf => main-0009-json-normalize-root-array.hwf} | 74 +-
...am.hwf => main-0010-json-normalize-complex.hwf} | 48 +-
...main-0011-json-normalize-hop-config-layers.hwf} | 48 +-
.../dataset/golden-json-normalize-complex.json | 49 +
...olden-json-normalize-hop-config-lifecycles.json | 41 +
.../golden-json-normalize-hop-config-projects.json | 33 +
...golden-json-normalize-hop-config-variables.json | 33 +
.../dataset/golden-json-normalize-orders.json | 41 +
.../dataset/golden-json-normalize-root-array.json | 33 +
.../unit-test/0008-json-normalize-orders UNIT.json | 40 +
.../0009-json-normalize-root-array UNIT.json | 36 +
.../0010-json-normalize-complex UNIT.json | 44 +
...0011-json-normalize-hop-config-layers UNIT.json | 87 +
.../resources/hop-config-layers-it/hop-config.json | 33 +
.../json-normalize-complex-transactions-it.json | 172 +
.../json/resources/json-normalize-events-it.json | 19 +
.../json/resources/json-normalize-orders-it.json | 22 +
.../jsonnormalize/JsonNodeFlattener.java | 194 +
.../jsonnormalize/JsonNormalizeInput.java | 510 ++
.../jsonnormalize/JsonNormalizeInputData.java | 40 +
.../jsonnormalize/JsonNormalizeInputDialog.java | 1790 ++++++
.../jsonnormalize/JsonNormalizeInputMeta.java | 564 ++
.../jsonnormalize/JsonNormalizeRecords.java | 123 +
.../jsonnormalize/NormalizeInputsReader.java | 327 ++
.../src/main/resources/json-normalize-input.svg | 22 +
.../jsoninput/messages/messages_en_US.properties | 2 +-
.../messages/messages_en_US.properties | 38 +
.../data/json-normalize-complex-transactions.json | 6070 ++++++++++++++++++++
.../main/samples/data/json-normalize-events.json | 17 +
.../main/samples/data/json-normalize-orders.json | 22 +
.../transforms/json-input-nested-elements.hpl | 8 +-
...hpl => json-normalize-complex-transactions.hpl} | 318 +-
.../json-normalize-hop-config-layers.hpl | 533 ++
.../samples/transforms/json-normalize-orders.hpl | 179 +-
.../transforms/json-normalize-root-array.hpl | 166 +-
.../jsonnormalize/JsonNormalizeCoreTest.java | 106 +
.../JsonNormalizeSamplePipelinesTest.java | 144 +
58 files changed, 12727 insertions(+), 855 deletions(-)
diff --git a/docs/hop-user-manual/modules/ROOT/assets/images/transforms/icons/JsonNormalizeInput.svg b/docs/hop-user-manual/modules/ROOT/assets/images/transforms/icons/JsonNormalizeInput.svg
new file mode 100644
index 0000000000..2c0eb4df3a
--- /dev/null
+++ b/docs/hop-user-manual/modules/ROOT/assets/images/transforms/icons/JsonNormalizeInput.svg
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="42px" height="42px" viewBox="0 0 42 42">
+<path fill="#EFF9FE" d="M32.295,10.051h-22.3v22.301h14.128l8.172-8.172V10.051z"/>
+<polygon fill="#0F3B5A" points="37.26,32.836 37.26,35.918 32.035,30.693 30.691,32.037 35.918,37.264 32.771,37.264 32.771,39.164
+ 39.161,39.161 39.161,32.836 "/>
+<polygon fill="#0F3B5A" points="9.995,10.051 32.295,10.051 32.295,24.18 33.995,22.48 33.995,8.352 8.295,8.352 8.295,34.051
+ 22.424,34.051 24.123,32.352 9.995,32.352 "/>
+<path fill="#BF03B8" d="M17.64,29.693c-1.184,0-2.053-0.263-2.606-0.79c-0.553-0.526-0.829-1.385-0.829-2.574v-2.868
+ c0-1.27-0.504-1.904-1.514-1.904v-1.561c1.008,0,1.513-0.668,1.514-2.006v-2.684c0-1.177,0.281-2.044,0.843-2.604
+ c0.562-0.56,1.427-0.841,2.592-0.842v1.601c-1.035,0-1.553,0.614-1.553,1.845v2.705c0,1.458-0.482,2.37-1.445,2.734v0.041
+ c0.963,0.325,1.445,1.217,1.445,2.675v2.696c0,0.669,0.118,1.158,0.355,1.467c0.236,0.311,0.637,0.466,1.2,0.467L17.64,29.693
+ L17.64,29.693z"/>
+<path fill="#BF03B8" d="M23.188,17.433c0.001-1.129-0.874-2.043-1.956-2.044c-1.082,0-1.957,0.914-1.958,2.043c0,0,0,0,0,0.001
+ c0,1.128,0.876,2.044,1.957,2.044C22.312,19.477,23.188,18.562,23.188,17.433z"/>
+<path fill="#BF03B8" d="M24.649,29.693c1.185,0,2.053-0.263,2.605-0.79c0.554-0.526,0.83-1.385,0.828-2.574v-2.868
+ c0-1.27,0.506-1.904,1.515-1.904v-1.561c-1.009,0-1.513-0.668-1.515-2.006v-2.684c0-1.177-0.28-2.044-0.842-2.604
+ c-0.563-0.561-1.428-0.841-2.594-0.842v1.601c1.036,0,1.555,0.614,1.555,1.845v2.705c0,1.458,0.48,2.37,1.444,2.734v0.041
+ c-0.964,0.325-1.444,1.217-1.444,2.675v2.696c0,0.669-0.118,1.158-0.355,1.467c-0.236,0.311-0.637,0.467-1.2,0.469L24.649,29.693
+ L24.649,29.693z"/>
+<path fill="#BF03B8" d="M23.204,24.362c0.001-1.129-0.874-2.044-1.957-2.044c-1.081-0.002-1.957,0.911-1.958,2.041
+ c0,0.002,0,0.002,0,0.003c0.001,1.129,0.878,2.043,1.958,2.041C22.326,26.403,23.204,25.49,23.204,24.362z"/>
+</svg>
diff --git a/docs/hop-user-manual/modules/ROOT/nav.adoc b/docs/hop-user-manual/modules/ROOT/nav.adoc
index ccddfa0102..f81935958c 100644
--- a/docs/hop-user-manual/modules/ROOT/nav.adoc
+++ b/docs/hop-user-manual/modules/ROOT/nav.adoc
@@ -176,6 +176,7 @@ under the License.
*** xref:pipeline/transforms/jdbcmetadata.adoc[JDBC Metadata]
*** xref:pipeline/transforms/joinrows.adoc[Join Rows]
*** xref:pipeline/transforms/jsoninput.adoc[JSON Input]
+*** xref:pipeline/transforms/jsonnormalizeinput.adoc[JSON Normalize Input]
*** xref:pipeline/transforms/jsonoutput.adoc[JSON Output]
*** xref:pipeline/transforms/kafkaconsumer.adoc[Kafka Consumer]
*** xref:pipeline/transforms/kafkaproducer.adoc[Kafka Producer]
diff --git a/docs/hop-user-manual/modules/ROOT/pages/pipeline/transforms/jsoninput.adoc b/docs/hop-user-manual/modules/ROOT/pages/pipeline/transforms/jsoninput.adoc
index 6d62e88a99..f0202cb5d8 100644
--- a/docs/hop-user-manual/modules/ROOT/pages/pipeline/transforms/jsoninput.adoc
+++ b/docs/hop-user-manual/modules/ROOT/pages/pipeline/transforms/jsoninput.adoc
@@ -23,9 +23,14 @@ under the License.
[%noheader,cols="3a,1a", role="table-no-borders" ]
|===
|
+
== Description
The JSON input transform reads data from JSON structures, files, or incoming fields using a JSONPath expression to extract data and output rows.
+[NOTE]
+====
+Use JSON Input when each column should come from its *own JsonPath* (or you are not *exploding* a list into many rows). For an *array of records* where each element becomes a row and *nested objects are flattened* into dotted column names, use xref:pipeline/transforms/jsonnormalizeinput.adoc[JSON Normalize Input] instead.
+====
== TIPS
* JSONPath expressions can use either dot notation or square bracket notation.
@@ -59,7 +64,7 @@ Check the `json-input-nested-elements.hpl` sample in the Samples project for an
=== File Tab
-[options="header"]
+[options="header",cols="1a,3a"]
|===
|Option|Description
|Source is from a previous transform a|Select to retrieve the source from a previously defined field.
@@ -104,7 +109,7 @@ a|Specify the source location if the source is not defined in a field.
The Content tab contains the following options for configuring which data to retrieve:
-[options="header"]
+[options="header",cols="1a,3a"]
|===
|Option|Description
|Ignore empty file|Select to skip empty files.
@@ -125,7 +130,7 @@ Results are not limited when set to zero.
The Fields tab displays field definitions to extract values from the JSON structure.
The table in this tab contain the following columns:
-[options="header"]
+[options="header",cols="1a,3a"]
|===
|Option|Description
|Name|Name of field that maps to the corresponding field in the JSON input stream.
@@ -177,7 +182,7 @@ You can use Regex in the Path expression.
The Additional output fields tab contains the following options to specify additional information about the file to process:
-[options="header"]
+[options="header",cols="1a,3a"]
|===
|Option|Description
|Short filename field|Specify the field that contains the filename without path information but with an extension.
@@ -218,7 +223,7 @@ For example if we have a JSON file like this
```
When extracting the fields id and Name using the following field definition:
-[%header]
+[options="header", cols="1a, 3a"]
|===
|Field name|Json Path
|id| `$.persons.*.id`
diff --git a/docs/hop-user-manual/modules/ROOT/pages/pipeline/transforms/jsonnormalizeinput.adoc b/docs/hop-user-manual/modules/ROOT/pages/pipeline/transforms/jsonnormalizeinput.adoc
new file mode 100644
index 0000000000..98a6060468
--- /dev/null
+++ b/docs/hop-user-manual/modules/ROOT/pages/pipeline/transforms/jsonnormalizeinput.adoc
@@ -0,0 +1,166 @@
+////
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+////
+:documentationPath: /pipeline/transforms/
+:language: en_US
+:description: The JSON Normalize Input transform reads JSON (files, URLs, or fields), selects an array of records with JsonPath, flattens nested objects into columns, and outputs one row per array element.
+:openvar: ${
+:closevar: }
+
+
+= image:transforms/icons/JsonNormalizeInput.svg[JSON Normalize Input transform Icon, role="image-doc-icon"] JSON Normalize Input
+
+[%noheader,cols="3a,1a", role="table-no-borders" ]
+|===
+|
+
+== Description
+The JSON Normalize Input transform is similar to xref:pipeline/transforms/jsoninput.adoc[JSON Input] for sourcing data (file, URL, or a field from a previous transform), but it is built for *tabular* extraction from JSON documents:
+
+* A *record JsonPath* selects an *array* of objects (or scalar elements). Hop emits *one output row per array element*.
+* Nested objects under each record are *flattened* into column paths using a configurable separator (default: a dot, like `customer.name` for nested keys).
+* On the Fields tab, each row’s *Path* is the *flattened key* (for example `customer.name`), not a separate JsonPath query into the raw file.
+
+Use this transform when your JSON has a clear list of entities (`orders`, `events`, or a root-level array) and you want a wide, denormalized row set without chaining multiple JSON Input transforms.
+
+[NOTE]
+====
+Choose xref:pipeline/transforms/jsoninput.adoc[JSON Input] when you need *one row per document* (or a fixed shape) and each column is filled by its *own JsonPath* into the file; choose JSON Normalize Input when the document has an *array of similar objects* and you want *one output row per array element* with *nested objects flattened* into dotted column names.
+====
+
+== Why one JSON document can need several JSON Normalize Input transforms
+
+Each transform run picks *one* **Record JsonPath** that must resolve to an *array*. That defines a single output grain: *one row per element of that array*, with fields taken from that element after flattening.
+
+You often still use **several** JSON Normalize Input transforms on the same pipeline (in parallel branches or one after another) because:
+
+* **Sibling arrays** — One file may hold unrelated lists (for example, in `hop-config.json`: `variables`, `lifecycleEnvironments`, and `projectConfigurations`). Each list has its own element shape; a single record path cannot return two arrays at once. Normalize each list with its own transform (and JsonPath such as `$.variables[*]`), or read the file once into string columns and parse those blobs in follow-up steps—see the `json-normalize-hop-config-layers.hpl` sample.
+* **Wide, sparse tables** — It is *possible* in some cases to point the record path at a very high level (for example the document root) and flatten *everything* into one enormous row, but unrelated branches then become hundreds of columns with values only on a few of them. That is hard to query and heavy for memory. Prefer a *narrow* record path per *entity type* so each hop looks like a real table: mostly dense columns, one business meaning per row.
+
+So chaining here is not a limitation of JSON compared to “doing it in one go”; it is the same design choice as picking **one repeating array per logical table**.
+
+[NOTE]
+====
+**If you use Python pandas:** The same pattern exists there—`json_normalize` is usually applied to *one* list of records at a time; several sibling arrays in one JSON file mean several normalize passes (or list-valued columns). Hop’s **Record JsonPath** selects that list; nested arrays while flattening default to **stringified** text in a column instead of extra rows, similar to keeping a list in a cell unless you normalize again.
+====
+
+== Performance, memory, and wide tables
+
+Flattening is **row-oriented** and builds a **wide** field set from **deep** or **branchy** JSON:
+
+* **Wide output** — Many distinct paths (especially long field names or deep nesting) mean many columns and larger in-memory row batches. Very large config files with hundreds of top-level branches can create *very* wide rows if you flatten the whole document in one row.
+* **Large files** — Reading big JSON documents is **not streaming per record** at the JsonPath layer; the engine must **materialize** matching structures. Prefer **narrow `Record JsonPath`** (one list of business records) instead of normalizing an enormous root when possible.
+* **Arrays left as JSON text** — Stringified array columns can be large strings; downstream steps (for example filters, calculators) pay the cost of parsing or copying that text.
+
+There is no single safe “normalize everything” default for arbitrary JSON; **choosing the right record path** is the main lever for both **correctness** and **performance**.
+
+== Samples
+Sample pipelines and data ship with the JSON transforms plugin under `plugins/transforms/json/src/main/samples/`:
+
+* `transforms/json-normalize-orders.hpl` with `data/json-normalize-orders.json` — nested `orders` array.
+* `transforms/json-normalize-root-array.hpl` with `data/json-normalize-events.json` — root-level array.
+* `transforms/json-normalize-complex-transactions.hpl` with `data/json-normalize-complex-transactions.json` — larger file with many columns and rows.
+* `transforms/json-normalize-hop-config-layers.hpl` reads `{openvar}HOP_CONFIG_FOLDER{closevar}/hop-config.json` — wide row from the root object (arrays as JSON text), then parallel branches that normalize `variables`, lifecycle environments, and project configurations from those strings. Point `HOP_CONFIG_FOLDER` at your real Hop config folder, or use the fixture under `integration-tests/json/resources/hop-config-layers-it/` to try the shape offline.
+
+Pipeline unit tests in `integration-tests/json/` (`0008`–`0011`) exercise these scenarios in CI, including `0011-json-normalize-hop-config-layers.hpl` for `{openvar}HOP_CONFIG_FOLDER{closevar}/hop-config.json` with parallel branches.
+
+|
+== Supported Engines
+[%noheader,cols="2,1a",frame=none, role="table-supported-engines"]
+!===
+!Hop Engine! image:check_mark.svg[Supported, 24]
+!Apache Spark, Flink, Dataflow! Not verified for this transform; validate in your environment before relying on distributed execution.
+!===
+|===
+
+== Options
+
+=== File tab
+Same concepts as JSON Input: source from files / folder, URL, or a field from a previous transform (`Source is from a previous transform`). See xref:pipeline/transforms/jsoninput.adoc#_file_tab[JSON Input – File tab] for details.
+
+=== Content tab
+In addition to the usual file and row-limit options (see xref:pipeline/transforms/jsoninput.adoc#_content_tab[JSON Input – Content tab]), the Content tab adds:
+
+[options="header",cols="1a,3a"]
+|===
+|Option|Description
+|Record JsonPath|JsonPath that must evaluate to an *array* of records. Each element becomes one output row. Examples: `$.orders[*]` for `{ "orders": [ {...}, ... ] }`, or `$[*]` when the file root is an array.
+|Field separator|Character(s) placed between path segments when flattening nested objects (default `.`).
+|Max flatten depth|Maximum object nesting depth to flatten. `-1` means unlimited.
+|Array handling|How to handle JSON arrays encountered while flattening: stringify (default), single element only, or error.
+|Beyond max depth|When max depth is reached: stringify, omit, or error.
+|Ignore missing field paths|If enabled, fields listed on the Fields tab that are missing on a given row are set to null instead of failing the row.
+|===
+
+=== Fields tab
+
+The Fields tab lists output fields to extract from each *flattened* record (each element selected by **Record JsonPath**).
+The table has the following columns:
+
+[options="header",cols="1a,3a"]
+|===
+|Option|Description
+|Name|Name of the output field in the Hop stream.
+|Path|Flattened key for the value *within each record*, after nested objects are merged into dotted (or custom-separated) paths. This is *not* a JsonPath into the whole document—that is what **Record JsonPath** on the Content tab is for. Examples: `orderId`, `customer.name`. The value must match a key produced for that row by flattening (unless **Ignore missing field paths** is enabled, in which case a missing key yields null). Wildcards, filters, and regex are not used in this column—on [...]
+|Type|Data type of the input field.
+|Format|An optional mask for converting the format of the original field.
+See Common Formats for information on common valid date and numeric formats you can use in this transform.
+|Length|Length of the field.
+|Precision|Number of floating point digits for number-type fields.
+|Currency|Currency symbol ($ or €, for example).
+|Decimal|A decimal point can be a . (5,000.00 for example) or , (5.000,00 for example).
+|Group|A grouping can be a , (10,000.00 for example) or . (5.000,00 for example).
+|Trim type|The trim method to apply to a string.
+|Repeat|The corresponding value from the last row repeated if a row is empty.
+|===
+
+*Select fields*
+
+Click *Select fields* in the Fields tab to open the Select Fields window.
+Select the checkbox next to each field that you want in the output.
+All fields chosen here are added to the table.
+You can search for a field name by entering it in the Search box.
+
+*Select fields from snippet*
+
+Click *Select fields from snippet* and paste JSON text—typically *one representative object* (one element of the array your **Record JsonPath** selects)—to populate the *Name*, *Path*, and *Type* columns in the Fields tab. This helps discover flattened paths after your Content-tab settings (separator, depth, array handling) are applied.
+
+*Dates and timestamps*
+
+For Hop types of *Date* and *Timestamp*, use the *Format* column to specify the incoming format. For example, for Date: `yyyy-MM-dd`. You can select a format from the dropdown or enter format text directly. Hop uses https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html[SimpleDateFormat,window=_blank] (Java 8).
+
+*Examples of Timestamp formats:*
+
+* Format: yyyy-MM-dd'T'HH:mm:ss.SSSZ and Result: 2021-10-26T20:51:43.795+0000
+
+* Format: 2024-04-22T00:00:00.000Z and Result: 2024-04-22T00:00:00.000Z
+
+=== Additional output fields tab
+
+The Additional output fields tab contains the following options to add file metadata when the transform reads from files:
+
+[options="header",cols="1a,3a"]
+|===
+|Option|Description
+|Short filename field|Specify the field that contains the filename without path information but with an extension.
+|Extension field|Specify the field that contains the extension of the filename.
+|Path field|Specify the field that contains the path in operating system format.
+|Size field|Specify the field that contains the size of the data.
+|Is hidden field|Specify the field indicating if the file is hidden or not (Boolean).
+|Last modification field|Specify the field indicating the date of the last time the file was modified.
+|Uri field|Specify the field that contains the URI.
+|Root uri field|Specify the field that contains only the root part of the URI.
+|===
diff --git a/integration-tests/json/0003-json-test-block-size.hpl b/integration-tests/json/0003-json-test-block-size.hpl
index f0dd5d706e..4706449365 100644
--- a/integration-tests/json/0003-json-test-block-size.hpl
+++ b/integration-tests/json/0003-json-test-block-size.hpl
@@ -73,7 +73,7 @@ limitations under the License.
<defaultPathLeafToNull>Y</defaultPathLeafToNull>
<rownum_field/>
<file>
- <name>${PROJECT_HOME}/output</name>
+ <name>${java.io.tmpdir}/hop-json-integration-output</name>
<filemask>.*.json</filemask>
<exclude_filemask/>
<file_required>N</file_required>
diff --git a/integration-tests/json/0003-json-write-block-size.hpl b/integration-tests/json/0003-json-write-block-size.hpl
index 5e6bd3d3ab..6b450d91d9 100644
--- a/integration-tests/json/0003-json-write-block-size.hpl
+++ b/integration-tests/json/0003-json-write-block-size.hpl
@@ -133,7 +133,7 @@ limitations under the License.
</fields>
<fileAppended>N</fileAppended>
<fileAsCommand>N</fileAsCommand>
- <fileName>${PROJECT_HOME}/output/json-block.js</fileName>
+ <fileName>${java.io.tmpdir}/hop-json-integration-output/json-block.js</fileName>
<jsonBloc>data</jsonBloc>
<nrRowsInBloc>123</nrRowsInBloc>
<operation_type>writetofile</operation_type>
diff --git a/integration-tests/json/0005-enhanced-json-output-empty-stream.hpl b/integration-tests/json/0005-enhanced-json-output-empty-stream.hpl
index bfed7247ac..fc3ffce65c 100644
--- a/integration-tests/json/0005-enhanced-json-output-empty-stream.hpl
+++ b/integration-tests/json/0005-enhanced-json-output-empty-stream.hpl
@@ -64,7 +64,7 @@ limitations under the License.
<encoding>UTF-8</encoding>
<addtoresult>N</addtoresult>
<file>
- <name>${PROJECT_HOME}/output/testfile.js</name>
+ <name>${java.io.tmpdir}/hop-json-integration-output/testfile.js</name>
<split_output_after>0</split_output_after>
<extention>json</extention>
<append>N</append>
diff --git a/integration-tests/json/0006-enhanced-json-output-json-fragment.hpl b/integration-tests/json/0006-enhanced-json-output-json-fragment.hpl
index a2c79e7c38..9c82561d2b 100644
--- a/integration-tests/json/0006-enhanced-json-output-json-fragment.hpl
+++ b/integration-tests/json/0006-enhanced-json-output-json-fragment.hpl
@@ -117,7 +117,7 @@ limitations under the License.
<encoding>UTF-8</encoding>
<addtoresult>N</addtoresult>
<file>
- <name>${PROJECT_HOME}/output/testfile.js</name>
+ <name>${java.io.tmpdir}/hop-json-integration-output/testfile.js</name>
<split_output_after>0</split_output_after>
<extention>json</extention>
<append>N</append>
diff --git a/integration-tests/json/0003-json-test-block-size.hpl b/integration-tests/json/0008-json-normalize-orders.hpl
similarity index 63%
copy from integration-tests/json/0003-json-test-block-size.hpl
copy to integration-tests/json/0008-json-normalize-orders.hpl
index f0dd5d706e..3166cefb9c 100644
--- a/integration-tests/json/0003-json-test-block-size.hpl
+++ b/integration-tests/json/0008-json-normalize-orders.hpl
@@ -19,40 +19,51 @@ limitations under the License.
-->
<pipeline>
<info>
- <name>0003-json-test-block-size</name>
+ <name>0008-json-normalize-orders</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
- <pipeline_status>0</pipeline_status>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
- <transform_performance_capturing_size_limit/>
- <created_user/>
- <created_date>2014/03/03 20:27:52.905</created_date>
+ <transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
+ <created_user>-</created_user>
+ <created_date>2026/05/08 14:00:00.000</created_date>
<modified_user>-</modified_user>
- <modified_date>2008/05/14 08:28:56.657</modified_date>
+ <modified_date>2026/05/08 14:00:00.000</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
- <from>JSON input</from>
- <to>count rows</to>
- <enabled>Y</enabled>
- </hop>
- <hop>
- <from>count rows</from>
- <to>Set JSON_ROWCOUNT</to>
+ <from>JSON normalize orders</from>
+ <to>Validate</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
- <name>JSON input</name>
- <type>JsonInput</type>
+ <name>Validate</name>
+ <type>Dummy</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <attributes/>
+ <GUI>
+ <xloc>352</xloc>
+ <yloc>192</yloc>
+ </GUI>
+ </transform>
+ <transform>
+ <name>JSON normalize orders</name>
+ <type>JsonNormalizeInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
@@ -69,20 +80,37 @@ limitations under the License.
<removeSourceField>N</removeSourceField>
<IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
<doNotFailIfNoFile>Y</doNotFailIfNoFile>
- <ignoreMissingPath>Y</ignoreMissingPath>
- <defaultPathLeafToNull>Y</defaultPathLeafToNull>
+ <ignoreMissingField>Y</ignoreMissingField>
+ <recordPath>$.orders[*]</recordPath>
+ <fieldSeparator>.</fieldSeparator>
+ <maxFlattenDepth>-1</maxFlattenDepth>
+ <arrayHandling>STRINGIFY</arrayHandling>
+ <beyondDepthBehavior>STRINGIFY</beyondDepthBehavior>
<rownum_field/>
<file>
- <name>${PROJECT_HOME}/output</name>
- <filemask>.*.json</filemask>
+ <name>${HOP_UNIT_TESTS_FOLDER}/resources/json-normalize-orders-it.json</name>
+ <filemask/>
<exclude_filemask/>
<file_required>N</file_required>
<include_subfolders>N</include_subfolders>
</file>
<fields>
<field>
- <name>firstname</name>
- <path>$.data.*.firstname</path>
+ <name>orderId</name>
+ <path>orderId</path>
+ <type>String</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <length>-1</length>
+ <precision>-1</precision>
+ <trim_type>none</trim_type>
+ <repeat>N</repeat>
+ </field>
+ <field>
+ <name>customer_name</name>
+ <path>customer.name</path>
<type>String</type>
<format/>
<currency/>
@@ -94,8 +122,8 @@ limitations under the License.
<repeat>N</repeat>
</field>
<field>
- <name>lastname</name>
- <path>$.data.*.lastname</path>
+ <name>customer_country</name>
+ <path>customer.country</path>
<type>String</type>
<format/>
<currency/>
@@ -106,6 +134,19 @@ limitations under the License.
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
+ <field>
+ <name>total</name>
+ <path>total</path>
+ <type>Number</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <length>-1</length>
+ <precision>-1</precision>
+ <trim_type>none</trim_type>
+ <repeat>N</repeat>
+ </field>
</fields>
<limit>0</limit>
<IsInFields>N</IsInFields>
@@ -122,64 +163,7 @@ limitations under the License.
<attributes/>
<GUI>
<xloc>128</xloc>
- <yloc>64</yloc>
- </GUI>
- </transform>
- <transform>
- <name>Set JSON_ROWCOUNT</name>
- <type>SetVariable</type>
- <description/>
- <distribute>Y</distribute>
- <custom_distribution/>
- <copies>1</copies>
- <partitioning>
- <method>none</method>
- <schema_name/>
- </partitioning>
- <fields>
- <field>
- <default_value>0</default_value>
- <field_name>rowcount</field_name>
- <variable_name>JSON_ROWS</variable_name>
- <variable_type>PARENT_WORKFLOW</variable_type>
- </field>
- </fields>
- <use_formatting>Y</use_formatting>
- <attributes/>
- <GUI>
- <xloc>512</xloc>
- <yloc>64</yloc>
- </GUI>
- </transform>
- <transform>
- <name>count rows</name>
- <type>GroupBy</type>
- <description/>
- <distribute>Y</distribute>
- <custom_distribution/>
- <copies>1</copies>
- <partitioning>
- <method>none</method>
- <schema_name/>
- </partitioning>
- <add_linenr>N</add_linenr>
- <all_rows>N</all_rows>
- <directory>${java.io.tmpdir}</directory>
- <fields>
- <field>
- <aggregate>rowcount</aggregate>
- <type>COUNT_ANY</type>
- </field>
- </fields>
- <give_back_row>N</give_back_row>
- <group>
-</group>
- <ignore_aggregate>N</ignore_aggregate>
- <prefix>grp</prefix>
- <attributes/>
- <GUI>
- <xloc>304</xloc>
- <yloc>64</yloc>
+ <yloc>192</yloc>
</GUI>
</transform>
<transform_error_handling>
diff --git a/integration-tests/json/0003-json-test-block-size.hpl b/integration-tests/json/0009-json-normalize-root-array.hpl
similarity index 58%
copy from integration-tests/json/0003-json-test-block-size.hpl
copy to integration-tests/json/0009-json-normalize-root-array.hpl
index f0dd5d706e..ab497e9a57 100644
--- a/integration-tests/json/0003-json-test-block-size.hpl
+++ b/integration-tests/json/0009-json-normalize-root-array.hpl
@@ -19,170 +19,152 @@ limitations under the License.
-->
<pipeline>
<info>
- <name>0003-json-test-block-size</name>
- <name_sync_with_filename>Y</name_sync_with_filename>
- <description/>
- <extended_description/>
<pipeline_version/>
- <pipeline_type>Normal</pipeline_type>
- <pipeline_status>0</pipeline_status>
- <parameters>
- </parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
- <transform_performance_capturing_size_limit/>
- <created_user/>
- <created_date>2014/03/03 20:27:52.905</created_date>
+ <transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
+ <pipeline_type>Normal</pipeline_type>
+ <pipeline_status>0</pipeline_status>
+ <parameters/>
+ <name>0009-json-normalize-root-array</name>
+ <name_sync_with_filename>Y</name_sync_with_filename>
+ <description/>
+ <extended_description/>
+ <created_user>-</created_user>
<modified_user>-</modified_user>
- <modified_date>2008/05/14 08:28:56.657</modified_date>
+ <created_date>2026/05/08 14:00:00.000</created_date>
+ <modified_date>2026/05/08 14:00:00.000</modified_date>
</info>
- <notepads>
- </notepads>
- <order>
- <hop>
- <from>JSON input</from>
- <to>count rows</to>
- <enabled>Y</enabled>
- </hop>
- <hop>
- <from>count rows</from>
- <to>Set JSON_ROWCOUNT</to>
- <enabled>Y</enabled>
- </hop>
- </order>
<transform>
- <name>JSON input</name>
- <type>JsonInput</type>
- <description/>
+ <type>Dummy</type>
+ <name>Validate</name>
<distribute>Y</distribute>
- <custom_distribution/>
<copies>1</copies>
+ <GUI>
+ <xloc>352</xloc>
+ <yloc>192</yloc>
+ </GUI>
+ <description/>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
+ <attributes/>
+ </transform>
+ <transform>
+ <type>JsonNormalizeInput</type>
+ <name>JSON normalize events</name>
<include>N</include>
<include_field/>
<rownum>N</rownum>
+ <rownum_field/>
+ <limit>0</limit>
+ <valueField/>
+ <IsInFields>N</IsInFields>
+ <IsAFile>N</IsAFile>
<addresultfile>N</addresultfile>
- <readurl>N</readurl>
- <removeSourceField>N</removeSourceField>
<IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
<doNotFailIfNoFile>Y</doNotFailIfNoFile>
- <ignoreMissingPath>Y</ignoreMissingPath>
- <defaultPathLeafToNull>Y</defaultPathLeafToNull>
- <rownum_field/>
- <file>
- <name>${PROJECT_HOME}/output</name>
- <filemask>.*.json</filemask>
- <exclude_filemask/>
- <file_required>N</file_required>
- <include_subfolders>N</include_subfolders>
- </file>
+ <readurl>N</readurl>
+ <removeSourceField>N</removeSourceField>
+ <recordPath>$.events[*]</recordPath>
+ <fieldSeparator>.</fieldSeparator>
+ <maxFlattenDepth>-1</maxFlattenDepth>
+ <arrayHandling>STRINGIFY</arrayHandling>
+ <beyondDepthBehavior>STRINGIFY</beyondDepthBehavior>
+ <ignoreMissingField>Y</ignoreMissingField>
+ <shortFileFieldName/>
+ <extensionFieldName/>
+ <pathFieldName/>
+ <sizeFieldName/>
+ <hiddenFieldName/>
+ <lastModificationTimeFieldName/>
+ <uriNameFieldName/>
+ <rootUriNameFieldName/>
+ <files>
+ <file>
+ <name>${HOP_UNIT_TESTS_FOLDER}/resources/json-normalize-events-it.json</name>
+ <filemask/>
+ <exclude_filemask/>
+ <file_required>N</file_required>
+ <include_subfolders>N</include_subfolders>
+ </file>
+ </files>
<fields>
<field>
- <name>firstname</name>
- <path>$.data.*.firstname</path>
+ <name>id</name>
+ <length>-1</length>
<type>String</type>
<format/>
+ <trim_type>none</trim_type>
+ <precision>-1</precision>
<currency/>
<decimal/>
<group/>
+ <repeat>N</repeat>
+ <path>id</path>
+ </field>
+ <field>
+ <name>event</name>
<length>-1</length>
- <precision>-1</precision>
+ <type>String</type>
+ <format/>
<trim_type>none</trim_type>
+ <precision>-1</precision>
+ <currency/>
+ <decimal/>
+ <group/>
<repeat>N</repeat>
+ <path>event</path>
</field>
<field>
- <name>lastname</name>
- <path>$.data.*.lastname</path>
+ <name>meta_ip</name>
+ <length>-1</length>
<type>String</type>
<format/>
+ <trim_type>none</trim_type>
+ <precision>-1</precision>
<currency/>
<decimal/>
<group/>
+ <repeat>N</repeat>
+ <path>meta.ip</path>
+ </field>
+ <field>
+ <name>meta_amount</name>
<length>-1</length>
- <precision>-1</precision>
+ <type>Number</type>
+ <format/>
<trim_type>none</trim_type>
+ <precision>-1</precision>
+ <currency/>
+ <decimal/>
+ <group/>
<repeat>N</repeat>
+ <path>meta.amount</path>
</field>
</fields>
- <limit>0</limit>
- <IsInFields>N</IsInFields>
- <IsAFile>N</IsAFile>
- <valueField/>
- <shortFileFieldName/>
- <pathFieldName/>
- <hiddenFieldName/>
- <lastModificationTimeFieldName/>
- <uriNameFieldName/>
- <rootUriNameFieldName/>
- <extensionFieldName/>
- <sizeFieldName/>
- <attributes/>
- <GUI>
- <xloc>128</xloc>
- <yloc>64</yloc>
- </GUI>
- </transform>
- <transform>
- <name>Set JSON_ROWCOUNT</name>
- <type>SetVariable</type>
- <description/>
<distribute>Y</distribute>
- <custom_distribution/>
<copies>1</copies>
- <partitioning>
- <method>none</method>
- <schema_name/>
- </partitioning>
- <fields>
- <field>
- <default_value>0</default_value>
- <field_name>rowcount</field_name>
- <variable_name>JSON_ROWS</variable_name>
- <variable_type>PARENT_WORKFLOW</variable_type>
- </field>
- </fields>
- <use_formatting>Y</use_formatting>
- <attributes/>
<GUI>
- <xloc>512</xloc>
- <yloc>64</yloc>
+ <xloc>128</xloc>
+ <yloc>192</yloc>
</GUI>
- </transform>
- <transform>
- <name>count rows</name>
- <type>GroupBy</type>
<description/>
- <distribute>Y</distribute>
- <custom_distribution/>
- <copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
- <add_linenr>N</add_linenr>
- <all_rows>N</all_rows>
- <directory>${java.io.tmpdir}</directory>
- <fields>
- <field>
- <aggregate>rowcount</aggregate>
- <type>COUNT_ANY</type>
- </field>
- </fields>
- <give_back_row>N</give_back_row>
- <group>
-</group>
- <ignore_aggregate>N</ignore_aggregate>
- <prefix>grp</prefix>
<attributes/>
- <GUI>
- <xloc>304</xloc>
- <yloc>64</yloc>
- </GUI>
</transform>
- <transform_error_handling>
- </transform_error_handling>
+ <order>
+ <hop>
+ <from>JSON normalize events</from>
+ <to>Validate</to>
+ <enabled>Y</enabled>
+ </hop>
+ </order>
+ <notepads/>
<attributes/>
+ <transform_error_handling/>
</pipeline>
diff --git a/integration-tests/json/0003-json-test-block-size.hpl b/integration-tests/json/0010-json-normalize-complex.hpl
similarity index 53%
copy from integration-tests/json/0003-json-test-block-size.hpl
copy to integration-tests/json/0010-json-normalize-complex.hpl
index f0dd5d706e..35c1188ffc 100644
--- a/integration-tests/json/0003-json-test-block-size.hpl
+++ b/integration-tests/json/0010-json-normalize-complex.hpl
@@ -19,170 +19,168 @@ limitations under the License.
-->
<pipeline>
<info>
- <name>0003-json-test-block-size</name>
- <name_sync_with_filename>Y</name_sync_with_filename>
- <description/>
- <extended_description/>
<pipeline_version/>
- <pipeline_type>Normal</pipeline_type>
- <pipeline_status>0</pipeline_status>
- <parameters>
- </parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
- <transform_performance_capturing_size_limit/>
- <created_user/>
- <created_date>2014/03/03 20:27:52.905</created_date>
+ <transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
+ <pipeline_type>Normal</pipeline_type>
+ <pipeline_status>0</pipeline_status>
+ <parameters/>
+ <name>0010-json-normalize-complex</name>
+ <name_sync_with_filename>Y</name_sync_with_filename>
+ <description/>
+ <extended_description/>
+ <created_user>-</created_user>
<modified_user>-</modified_user>
- <modified_date>2008/05/14 08:28:56.657</modified_date>
+ <created_date>2026/05/08 14:00:00.000</created_date>
+ <modified_date>2026/05/08 14:00:00.000</modified_date>
</info>
- <notepads>
- </notepads>
- <order>
- <hop>
- <from>JSON input</from>
- <to>count rows</to>
- <enabled>Y</enabled>
- </hop>
- <hop>
- <from>count rows</from>
- <to>Set JSON_ROWCOUNT</to>
- <enabled>Y</enabled>
- </hop>
- </order>
<transform>
- <name>JSON input</name>
- <type>JsonInput</type>
- <description/>
+ <type>Dummy</type>
+ <name>Validate</name>
<distribute>Y</distribute>
- <custom_distribution/>
<copies>1</copies>
+ <GUI>
+ <xloc>352</xloc>
+ <yloc>192</yloc>
+ </GUI>
+ <description/>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
+ <attributes/>
+ </transform>
+ <transform>
+ <type>JsonNormalizeInput</type>
+ <name>JSON normalize complex</name>
<include>N</include>
<include_field/>
<rownum>N</rownum>
+ <rownum_field/>
+ <limit>0</limit>
+ <valueField/>
+ <IsInFields>N</IsInFields>
+ <IsAFile>N</IsAFile>
<addresultfile>N</addresultfile>
- <readurl>N</readurl>
- <removeSourceField>N</removeSourceField>
<IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
<doNotFailIfNoFile>Y</doNotFailIfNoFile>
- <ignoreMissingPath>Y</ignoreMissingPath>
- <defaultPathLeafToNull>Y</defaultPathLeafToNull>
- <rownum_field/>
- <file>
- <name>${PROJECT_HOME}/output</name>
- <filemask>.*.json</filemask>
- <exclude_filemask/>
- <file_required>N</file_required>
- <include_subfolders>N</include_subfolders>
- </file>
+ <readurl>N</readurl>
+ <removeSourceField>N</removeSourceField>
+ <recordPath>$.transactions[*]</recordPath>
+ <fieldSeparator>.</fieldSeparator>
+ <maxFlattenDepth>-1</maxFlattenDepth>
+ <arrayHandling>STRINGIFY</arrayHandling>
+ <beyondDepthBehavior>STRINGIFY</beyondDepthBehavior>
+ <ignoreMissingField>Y</ignoreMissingField>
+ <files>
+ <file>
+ <name>${HOP_UNIT_TESTS_FOLDER}/resources/json-normalize-complex-transactions-it.json</name>
+ <file_required>N</file_required>
+ <include_subfolders>N</include_subfolders>
+ </file>
+ </files>
<fields>
<field>
- <name>firstname</name>
- <path>$.data.*.firstname</path>
+ <name>tx_id</name>
+ <length>-1</length>
<type>String</type>
<format/>
+ <trim_type>none</trim_type>
+ <precision>-1</precision>
<currency/>
<decimal/>
<group/>
+ <repeat>N</repeat>
+ <path>txId</path>
+ </field>
+ <field>
+ <name>gross_amount</name>
<length>-1</length>
+ <type>Number</type>
+ <format/>
+ <trim_type>none</trim_type>
<precision>-1</precision>
+ <currency/>
+ <decimal/>
+ <group/>
+ <repeat>N</repeat>
+ <path>grossAmount</path>
+ </field>
+ <field>
+ <name>status</name>
+ <length>-1</length>
+ <type>String</type>
+ <format/>
<trim_type>none</trim_type>
+ <precision>-1</precision>
+ <currency/>
+ <decimal/>
+ <group/>
<repeat>N</repeat>
+ <path>status</path>
</field>
<field>
- <name>lastname</name>
- <path>$.data.*.lastname</path>
+ <name>merchant_id</name>
+ <length>-1</length>
<type>String</type>
<format/>
+ <trim_type>none</trim_type>
+ <precision>-1</precision>
<currency/>
<decimal/>
<group/>
+ <repeat>N</repeat>
+ <path>merchant.id</path>
+ </field>
+ <field>
+ <name>fraud_score</name>
<length>-1</length>
+ <type>Integer</type>
+ <format/>
+ <trim_type>none</trim_type>
<precision>-1</precision>
+ <currency/>
+ <decimal/>
+ <group/>
+ <repeat>N</repeat>
+ <path>risk.fraudScore</path>
+ </field>
+ <field>
+ <name>currency</name>
+ <length>-1</length>
+ <type>String</type>
+ <format/>
<trim_type>none</trim_type>
+ <precision>-1</precision>
+ <currency/>
+ <decimal/>
+ <group/>
<repeat>N</repeat>
+ <path>currency</path>
</field>
</fields>
- <limit>0</limit>
- <IsInFields>N</IsInFields>
- <IsAFile>N</IsAFile>
- <valueField/>
- <shortFileFieldName/>
- <pathFieldName/>
- <hiddenFieldName/>
- <lastModificationTimeFieldName/>
- <uriNameFieldName/>
- <rootUriNameFieldName/>
- <extensionFieldName/>
- <sizeFieldName/>
- <attributes/>
- <GUI>
- <xloc>128</xloc>
- <yloc>64</yloc>
- </GUI>
- </transform>
- <transform>
- <name>Set JSON_ROWCOUNT</name>
- <type>SetVariable</type>
- <description/>
<distribute>Y</distribute>
- <custom_distribution/>
<copies>1</copies>
- <partitioning>
- <method>none</method>
- <schema_name/>
- </partitioning>
- <fields>
- <field>
- <default_value>0</default_value>
- <field_name>rowcount</field_name>
- <variable_name>JSON_ROWS</variable_name>
- <variable_type>PARENT_WORKFLOW</variable_type>
- </field>
- </fields>
- <use_formatting>Y</use_formatting>
- <attributes/>
<GUI>
- <xloc>512</xloc>
- <yloc>64</yloc>
+ <xloc>128</xloc>
+ <yloc>192</yloc>
</GUI>
- </transform>
- <transform>
- <name>count rows</name>
- <type>GroupBy</type>
<description/>
- <distribute>Y</distribute>
- <custom_distribution/>
- <copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
- <add_linenr>N</add_linenr>
- <all_rows>N</all_rows>
- <directory>${java.io.tmpdir}</directory>
- <fields>
- <field>
- <aggregate>rowcount</aggregate>
- <type>COUNT_ANY</type>
- </field>
- </fields>
- <give_back_row>N</give_back_row>
- <group>
-</group>
- <ignore_aggregate>N</ignore_aggregate>
- <prefix>grp</prefix>
<attributes/>
- <GUI>
- <xloc>304</xloc>
- <yloc>64</yloc>
- </GUI>
</transform>
- <transform_error_handling>
- </transform_error_handling>
+ <order>
+ <hop>
+ <from>JSON normalize complex</from>
+ <to>Validate</to>
+ <enabled>Y</enabled>
+ </hop>
+ </order>
+ <notepads/>
<attributes/>
+ <transform_error_handling/>
</pipeline>
diff --git a/integration-tests/json/0011-json-normalize-hop-config-layers.hpl b/integration-tests/json/0011-json-normalize-hop-config-layers.hpl
new file mode 100644
index 0000000000..4ccbea08e7
--- /dev/null
+++ b/integration-tests/json/0011-json-normalize-hop-config-layers.hpl
@@ -0,0 +1,647 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<pipeline>
+ <info>
+ <name>0011-json-normalize-hop-config-layers</name>
+ <name_sync_with_filename>Y</name_sync_with_filename>
+ <description>Integration test: hop-config-shaped JSON (${HOP_CONFIG_FOLDER}/hop-config.json), wide row then parallel branches; Select Values narrows rows for golden datasets.</description>
+ <extended_description/>
+ <pipeline_version/>
+ <pipeline_type>Normal</pipeline_type>
+ <parameters/>
+ <capture_transform_performance>N</capture_transform_performance>
+ <transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
+ <transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
+ <created_user>-</created_user>
+ <created_date>2026/05/09 12:00:00.000</created_date>
+ <modified_user>-</modified_user>
+ <modified_date>2026/05/09 12:00:00.000</modified_date>
+ </info>
+ <notepads/>
+ <order>
+ <hop>
+ <from>wide hop-config root</from>
+ <to>variables as rows</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>wide hop-config root</from>
+ <to>lifecycle environments as rows</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>wide hop-config root</from>
+ <to>project configurations as rows</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>variables as rows</from>
+ <to>fields variables validate</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>fields variables validate</from>
+ <to>preview variables</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>lifecycle environments as rows</from>
+ <to>fields lifecycles validate</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>fields lifecycles validate</from>
+ <to>preview lifecycles</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>project configurations as rows</from>
+ <to>fields project configs validate</to>
+ <enabled>Y</enabled>
+ </hop>
+ <hop>
+ <from>fields project configs validate</from>
+ <to>preview project configs</to>
+ <enabled>Y</enabled>
+ </hop>
+ </order>
+ <transform>
+ <name>wide hop-config root</name>
+ <type>JsonNormalizeInput</type>
+ <description/>
+ <distribute>N</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <include>N</include>
+ <include_field/>
+ <rownum>N</rownum>
+ <addresultfile>N</addresultfile>
+ <readurl>N</readurl>
+ <removeSourceField>N</removeSourceField>
+ <IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
+ <doNotFailIfNoFile>Y</doNotFailIfNoFile>
+ <ignoreMissingField>Y</ignoreMissingField>
+ <recordPath>$</recordPath>
+ <fieldSeparator>.</fieldSeparator>
+ <maxFlattenDepth>-1</maxFlattenDepth>
+ <arrayHandling>STRINGIFY</arrayHandling>
+ <beyondDepthBehavior>STRINGIFY</beyondDepthBehavior>
+ <rownum_field/>
+ <limit>0</limit>
+ <valueField/>
+ <IsInFields>N</IsInFields>
+ <IsAFile>N</IsAFile>
+ <shortFileFieldName/>
+ <pathFieldName/>
+ <hiddenFieldName/>
+ <lastModificationTimeFieldName/>
+ <uriNameFieldName/>
+ <rootUriNameFieldName/>
+ <extensionFieldName/>
+ <sizeFieldName/>
+ <file>
+ <name>${HOP_CONFIG_FOLDER}/hop-config.json</name>
+ <filemask/>
+ <exclude_filemask/>
+ <file_required>N</file_required>
+ <include_subfolders>N</include_subfolders>
+ </file>
+ <fields>
+ <field>
+ <name>LocaleDefault</name>
+ <path>LocaleDefault</path>
+ <type>String</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <length>-1</length>
+ <precision>-1</precision>
+ <trim_type>none</trim_type>
+ <repeat>N</repeat>
+ </field>
+ <field>
+ <name>variables</name>
+ <path>variables</path>
+ <type>String</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <length>-1</length>
+ <precision>-1</precision>
+ <trim_type>none</trim_type>
+ <repeat>N</repeat>
+ </field>
+ <field>
+ <name>projectsConfig_enabled</name>
+ <path>projectsConfig.enabled</path>
+ <type>String</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <length>-1</length>
+ <precision>-1</precision>
+ <trim_type>none</trim_type>
+ <repeat>N</repeat>
+ </field>
+ <field>
+ <name>lifecycleEnvironments</name>
+ <path>projectsConfig.lifecycleEnvironments</path>
+ <type>String</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <length>-1</length>
+ <precision>-1</precision>
+ <trim_type>none</trim_type>
+ <repeat>N</repeat>
+ </field>
+ <field>
+ <name>projectConfigurations</name>
+ <path>projectsConfig.projectConfigurations</path>
+ <type>String</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <length>-1</length>
+ <precision>-1</precision>
+ <trim_type>none</trim_type>
+ <repeat>N</repeat>
+ </field>
+ </fields>
+ <attributes/>
+ <GUI>
+ <xloc>128</xloc>
+ <yloc>192</yloc>
+ </GUI>
+ </transform>
+ <transform>
+ <name>variables as rows</name>
+ <type>JsonNormalizeInput</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <include>N</include>
+ <include_field/>
+ <rownum>N</rownum>
+ <addresultfile>N</addresultfile>
+ <readurl>N</readurl>
+ <removeSourceField>N</removeSourceField>
+ <IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
+ <doNotFailIfNoFile>Y</doNotFailIfNoFile>
+ <ignoreMissingField>Y</ignoreMissingField>
+ <recordPath>$[*]</recordPath>
+ <fieldSeparator>.</fieldSeparator>
+ <maxFlattenDepth>-1</maxFlattenDepth>
+ <arrayHandling>STRINGIFY</arrayHandling>
+ <beyondDepthBehavior>STRINGIFY</beyondDepthBehavior>
+ <rownum_field/>
+ <limit>0</limit>
+ <valueField>variables</valueField>
+ <IsInFields>Y</IsInFields>
+ <IsAFile>N</IsAFile>
+ <shortFileFieldName/>
+ <pathFieldName/>
+ <hiddenFieldName/>
+ <lastModificationTimeFieldName/>
+ <uriNameFieldName/>
+ <rootUriNameFieldName/>
+ <extensionFieldName/>
+ <sizeFieldName/>
+ <files/>
+ <fields>
+ <field>
+ <name>var_name</name>
+ <path>name</path>
+ <type>String</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <length>-1</length>
+ <precision>-1</precision>
+ <trim_type>none</trim_type>
+ <repeat>N</repeat>
+ </field>
+ <field>
+ <name>var_value</name>
+ <path>value</path>
+ <type>String</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <length>-1</length>
+ <precision>-1</precision>
+ <trim_type>none</trim_type>
+ <repeat>N</repeat>
+ </field>
+ <field>
+ <name>var_description</name>
+ <path>description</path>
+ <type>String</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <length>-1</length>
+ <precision>-1</precision>
+ <trim_type>none</trim_type>
+ <repeat>N</repeat>
+ </field>
+ </fields>
+ <attributes/>
+ <GUI>
+ <xloc>448</xloc>
+ <yloc>96</yloc>
+ </GUI>
+ </transform>
+ <transform>
+ <name>lifecycle environments as rows</name>
+ <type>JsonNormalizeInput</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <include>N</include>
+ <include_field/>
+ <rownum>N</rownum>
+ <addresultfile>N</addresultfile>
+ <readurl>N</readurl>
+ <removeSourceField>N</removeSourceField>
+ <IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
+ <doNotFailIfNoFile>Y</doNotFailIfNoFile>
+ <ignoreMissingField>Y</ignoreMissingField>
+ <recordPath>$[*]</recordPath>
+ <fieldSeparator>.</fieldSeparator>
+ <maxFlattenDepth>-1</maxFlattenDepth>
+ <arrayHandling>STRINGIFY</arrayHandling>
+ <beyondDepthBehavior>STRINGIFY</beyondDepthBehavior>
+ <rownum_field/>
+ <limit>0</limit>
+ <valueField>lifecycleEnvironments</valueField>
+ <IsInFields>Y</IsInFields>
+ <IsAFile>N</IsAFile>
+ <shortFileFieldName/>
+ <pathFieldName/>
+ <hiddenFieldName/>
+ <lastModificationTimeFieldName/>
+ <uriNameFieldName/>
+ <rootUriNameFieldName/>
+ <extensionFieldName/>
+ <sizeFieldName/>
+ <files/>
+ <fields>
+ <field>
+ <name>lifecycle_name</name>
+ <path>name</path>
+ <type>String</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <length>-1</length>
+ <precision>-1</precision>
+ <trim_type>none</trim_type>
+ <repeat>N</repeat>
+ </field>
+ <field>
+ <name>lifecycle_purpose</name>
+ <path>purpose</path>
+ <type>String</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <length>-1</length>
+ <precision>-1</precision>
+ <trim_type>none</trim_type>
+ <repeat>N</repeat>
+ </field>
+ <field>
+ <name>lifecycle_projectName</name>
+ <path>projectName</path>
+ <type>String</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <length>-1</length>
+ <precision>-1</precision>
+ <trim_type>none</trim_type>
+ <repeat>N</repeat>
+ </field>
+ <field>
+ <name>lifecycle_configurationFiles_json</name>
+ <path>configurationFiles</path>
+ <type>String</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <length>-1</length>
+ <precision>-1</precision>
+ <trim_type>none</trim_type>
+ <repeat>N</repeat>
+ </field>
+ </fields>
+ <attributes/>
+ <GUI>
+ <xloc>448</xloc>
+ <yloc>192</yloc>
+ </GUI>
+ </transform>
+ <transform>
+ <name>project configurations as rows</name>
+ <type>JsonNormalizeInput</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <include>N</include>
+ <include_field/>
+ <rownum>N</rownum>
+ <addresultfile>N</addresultfile>
+ <readurl>N</readurl>
+ <removeSourceField>N</removeSourceField>
+ <IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
+ <doNotFailIfNoFile>Y</doNotFailIfNoFile>
+ <ignoreMissingField>Y</ignoreMissingField>
+ <recordPath>$[*]</recordPath>
+ <fieldSeparator>.</fieldSeparator>
+ <maxFlattenDepth>-1</maxFlattenDepth>
+ <arrayHandling>STRINGIFY</arrayHandling>
+ <beyondDepthBehavior>STRINGIFY</beyondDepthBehavior>
+ <rownum_field/>
+ <limit>0</limit>
+ <valueField>projectConfigurations</valueField>
+ <IsInFields>Y</IsInFields>
+ <IsAFile>N</IsAFile>
+ <shortFileFieldName/>
+ <pathFieldName/>
+ <hiddenFieldName/>
+ <lastModificationTimeFieldName/>
+ <uriNameFieldName/>
+ <rootUriNameFieldName/>
+ <extensionFieldName/>
+ <sizeFieldName/>
+ <files/>
+ <fields>
+ <field>
+ <name>projectName</name>
+ <path>projectName</path>
+ <type>String</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <length>-1</length>
+ <precision>-1</precision>
+ <trim_type>none</trim_type>
+ <repeat>N</repeat>
+ </field>
+ <field>
+ <name>projectHome</name>
+ <path>projectHome</path>
+ <type>String</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <length>-1</length>
+ <precision>-1</precision>
+ <trim_type>none</trim_type>
+ <repeat>N</repeat>
+ </field>
+ <field>
+ <name>configFilename</name>
+ <path>configFilename</path>
+ <type>String</type>
+ <format/>
+ <currency/>
+ <decimal/>
+ <group/>
+ <length>-1</length>
+ <precision>-1</precision>
+ <trim_type>none</trim_type>
+ <repeat>N</repeat>
+ </field>
+ </fields>
+ <attributes/>
+ <GUI>
+ <xloc>448</xloc>
+ <yloc>288</yloc>
+ </GUI>
+ </transform>
+ <transform>
+ <name>fields variables validate</name>
+ <type>SelectValues</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <fields>
+ <field>
+ <name>var_name</name>
+ <rename/>
+ <length>-2</length>
+ <precision>-2</precision>
+ </field>
+ <field>
+ <name>var_value</name>
+ <rename/>
+ <length>-2</length>
+ <precision>-2</precision>
+ </field>
+ <field>
+ <name>var_description</name>
+ <rename/>
+ <length>-2</length>
+ <precision>-2</precision>
+ </field>
+ <select_unspecified>N</select_unspecified>
+ </fields>
+ <attributes/>
+ <GUI>
+ <xloc>608</xloc>
+ <yloc>96</yloc>
+ </GUI>
+ </transform>
+ <transform>
+ <name>fields lifecycles validate</name>
+ <type>SelectValues</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <fields>
+ <field>
+ <name>lifecycle_name</name>
+ <rename/>
+ <length>-2</length>
+ <precision>-2</precision>
+ </field>
+ <field>
+ <name>lifecycle_purpose</name>
+ <rename/>
+ <length>-2</length>
+ <precision>-2</precision>
+ </field>
+ <field>
+ <name>lifecycle_projectName</name>
+ <rename/>
+ <length>-2</length>
+ <precision>-2</precision>
+ </field>
+ <field>
+ <name>lifecycle_configurationFiles_json</name>
+ <rename/>
+ <length>-2</length>
+ <precision>-2</precision>
+ </field>
+ <select_unspecified>N</select_unspecified>
+ </fields>
+ <attributes/>
+ <GUI>
+ <xloc>608</xloc>
+ <yloc>192</yloc>
+ </GUI>
+ </transform>
+ <transform>
+ <name>fields project configs validate</name>
+ <type>SelectValues</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <fields>
+ <field>
+ <name>projectName</name>
+ <rename/>
+ <length>-2</length>
+ <precision>-2</precision>
+ </field>
+ <field>
+ <name>projectHome</name>
+ <rename/>
+ <length>-2</length>
+ <precision>-2</precision>
+ </field>
+ <field>
+ <name>configFilename</name>
+ <rename/>
+ <length>-2</length>
+ <precision>-2</precision>
+ </field>
+ <select_unspecified>N</select_unspecified>
+ </fields>
+ <attributes/>
+ <GUI>
+ <xloc>608</xloc>
+ <yloc>288</yloc>
+ </GUI>
+ </transform>
+ <transform>
+ <name>preview variables</name>
+ <type>Dummy</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <attributes/>
+ <GUI>
+ <xloc>768</xloc>
+ <yloc>96</yloc>
+ </GUI>
+ </transform>
+ <transform>
+ <name>preview lifecycles</name>
+ <type>Dummy</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <attributes/>
+ <GUI>
+ <xloc>768</xloc>
+ <yloc>192</yloc>
+ </GUI>
+ </transform>
+ <transform>
+ <name>preview project configs</name>
+ <type>Dummy</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <attributes/>
+ <GUI>
+ <xloc>768</xloc>
+ <yloc>288</yloc>
+ </GUI>
+ </transform>
+ <transform_error_handling/>
+ <attributes/>
+</pipeline>
diff --git a/integration-tests/json/datasets/golden-json-normalize-complex.csv b/integration-tests/json/datasets/golden-json-normalize-complex.csv
new file mode 100644
index 0000000000..c7b5a766a0
--- /dev/null
+++ b/integration-tests/json/datasets/golden-json-normalize-complex.csv
@@ -0,0 +1,4 @@
+tx_id,gross_amount,status,merchant_id,fraud_score
+TX-00001,227.08,AUTHORIZED,M-FASH,27
+TX-00002,362.17,CAPTURED,M-FUEL,46
+TX-00003,270.63,DECLINED,M-TECH,91
diff --git a/integration-tests/json/datasets/golden-json-normalize-hop-config-lifecycles.csv b/integration-tests/json/datasets/golden-json-normalize-hop-config-lifecycles.csv
new file mode 100644
index 0000000000..773d4df78d
--- /dev/null
+++ b/integration-tests/json/datasets/golden-json-normalize-hop-config-lifecycles.csv
@@ -0,0 +1,2 @@
+lifecycle_name,lifecycle_purpose,lifecycle_projectName,lifecycle_configurationFiles_json
+dev,Testing,default,"[""dev-env-config.json""]"
diff --git a/integration-tests/json/datasets/golden-json-normalize-hop-config-projects.csv b/integration-tests/json/datasets/golden-json-normalize-hop-config-projects.csv
new file mode 100644
index 0000000000..8283c477a0
--- /dev/null
+++ b/integration-tests/json/datasets/golden-json-normalize-hop-config-projects.csv
@@ -0,0 +1,2 @@
+projectName,projectHome,configFilename
+default,/tmp/project-home,project-config.json
diff --git a/integration-tests/json/datasets/golden-json-normalize-hop-config-variables.csv b/integration-tests/json/datasets/golden-json-normalize-hop-config-variables.csv
new file mode 100644
index 0000000000..b34f562f54
--- /dev/null
+++ b/integration-tests/json/datasets/golden-json-normalize-hop-config-variables.csv
@@ -0,0 +1,3 @@
+var_name,var_value,var_description
+HOP_EXAMPLE_A,Y,Sample described variable A.
+HOP_EXAMPLE_B,N,Sample described variable B.
diff --git a/integration-tests/json/datasets/golden-json-normalize-orders.csv b/integration-tests/json/datasets/golden-json-normalize-orders.csv
new file mode 100644
index 0000000000..063634af02
--- /dev/null
+++ b/integration-tests/json/datasets/golden-json-normalize-orders.csv
@@ -0,0 +1,3 @@
+orderId,customer_name,customer_country,total
+A-100,Alice,NL,199.5
+A-101,Bob,BE,42.0
diff --git a/integration-tests/json/datasets/golden-json-normalize-root-array.csv b/integration-tests/json/datasets/golden-json-normalize-root-array.csv
new file mode 100644
index 0000000000..b8be230271
--- /dev/null
+++ b/integration-tests/json/datasets/golden-json-normalize-root-array.csv
@@ -0,0 +1,3 @@
+id,event,meta_ip
+1,login,10.0.0.1
+2,purchase,10.0.0.2
diff --git a/integration-tests/json/main-0003-json-test-block-size.hwf b/integration-tests/json/main-0003-json-test-block-size.hwf
index 1602eaefe6..c2f0760d5a 100644
--- a/integration-tests/json/main-0003-json-test-block-size.hwf
+++ b/integration-tests/json/main-0003-json-test-block-size.hwf
@@ -48,6 +48,24 @@ limitations under the License.
<yloc>64</yloc>
<attributes_hac/>
</action>
+ <action>
+ <name>Prepare output folder</name>
+ <description/>
+ <type>DELETE_FOLDERS</type>
+ <attributes/>
+ <arg_from_previous>N</arg_from_previous>
+ <success_condition>success_if_no_errors</success_condition>
+ <limit_folders>10</limit_folders>
+ <fields>
+ <field>
+ <name>${java.io.tmpdir}/hop-json-integration-output</name>
+ </field>
+ </fields>
+ <parallel>N</parallel>
+ <xloc>152</xloc>
+ <yloc>64</yloc>
+ <attributes_hac/>
+ </action>
<action>
<name>0003-json-write-block-size.hpl</name>
<description/>
@@ -153,7 +171,7 @@ limitations under the License.
<limit_folders>10</limit_folders>
<fields>
<field>
- <name>${PROJECT_HOME}/output</name>
+ <name>${java.io.tmpdir}/hop-json-integration-output</name>
</field>
</fields>
<parallel>N</parallel>
@@ -171,7 +189,7 @@ limitations under the License.
<limit_folders>10</limit_folders>
<fields>
<field>
- <name>${PROJECT_HOME}/output</name>
+ <name>${java.io.tmpdir}/hop-json-integration-output</name>
</field>
</fields>
<parallel>N</parallel>
@@ -183,6 +201,13 @@ limitations under the License.
<hops>
<hop>
<from>START</from>
+ <to>Prepare output folder</to>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>Y</unconditional>
+ </hop>
+ <hop>
+ <from>Prepare output folder</from>
<to>0003-json-write-block-size.hpl</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
diff --git a/integration-tests/json/main-0005-enhanced-json-output-empty-stream.hwf b/integration-tests/json/main-0005-enhanced-json-output-empty-stream.hwf
index b444506fae..cca87f5bac 100644
--- a/integration-tests/json/main-0005-enhanced-json-output-empty-stream.hwf
+++ b/integration-tests/json/main-0005-enhanced-json-output-empty-stream.hwf
@@ -48,6 +48,24 @@ limitations under the License.
<yloc>64</yloc>
<attributes_hac/>
</action>
+ <action>
+ <name>Prepare output folder</name>
+ <description/>
+ <type>DELETE_FOLDERS</type>
+ <attributes/>
+ <arg_from_previous>N</arg_from_previous>
+ <success_condition>success_if_no_errors</success_condition>
+ <limit_folders>10</limit_folders>
+ <fields>
+ <field>
+ <name>${java.io.tmpdir}/hop-json-integration-output</name>
+ </field>
+ </fields>
+ <parallel>N</parallel>
+ <xloc>184</xloc>
+ <yloc>64</yloc>
+ <attributes_hac/>
+ </action>
<action>
<name>0005-enhanced-json-output-empty-stream.hpl</name>
<description/>
@@ -80,6 +98,13 @@ limitations under the License.
<hops>
<hop>
<from>START</from>
+ <to>Prepare output folder</to>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>Y</unconditional>
+ </hop>
+ <hop>
+ <from>Prepare output folder</from>
<to>0005-enhanced-json-output-empty-stream.hpl</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
diff --git a/integration-tests/json/main-0005-enhanced-json-output-empty-stream.hwf b/integration-tests/json/main-0008-json-normalize-orders.hwf
similarity index 60%
copy from integration-tests/json/main-0005-enhanced-json-output-empty-stream.hwf
copy to integration-tests/json/main-0008-json-normalize-orders.hwf
index b444506fae..567d4aba07 100644
--- a/integration-tests/json/main-0005-enhanced-json-output-empty-stream.hwf
+++ b/integration-tests/json/main-0008-json-normalize-orders.hwf
@@ -18,24 +18,25 @@ limitations under the License.
-->
<workflow>
- <name>main-0005-enhanced-json-output-empty-stream</name>
+ <name>main-0008-json-normalize-orders</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<workflow_version/>
<created_user>-</created_user>
- <created_date>2020/12/09 13:24:02.438</created_date>
+ <created_date>2026/05/08 14:00:00.000</created_date>
<modified_user>-</modified_user>
- <modified_date>2020/12/09 13:24:02.438</modified_date>
+ <modified_date>2026/05/08 14:00:00.000</modified_date>
<parameters>
</parameters>
<actions>
<action>
- <name>START</name>
+ <name>Start</name>
<description/>
<type>SPECIAL</type>
<attributes/>
<DayOfMonth>1</DayOfMonth>
+ <doNotWaitOnFirstExecution>N</doNotWaitOnFirstExecution>
<hour>12</hour>
<intervalMinutes>60</intervalMinutes>
<intervalSeconds>0</intervalSeconds>
@@ -44,43 +45,30 @@ limitations under the License.
<schedulerType>0</schedulerType>
<weekDay>1</weekDay>
<parallel>N</parallel>
- <xloc>64</xloc>
- <yloc>64</yloc>
+ <xloc>50</xloc>
+ <yloc>50</yloc>
<attributes_hac/>
</action>
<action>
- <name>0005-enhanced-json-output-empty-stream.hpl</name>
+ <name>Run Pipeline Unit Tests</name>
<description/>
- <type>PIPELINE</type>
+ <type>RunPipelineTests</type>
<attributes/>
- <add_date>N</add_date>
- <add_time>N</add_time>
- <clear_files>N</clear_files>
- <clear_rows>N</clear_rows>
- <create_parent_folder>N</create_parent_folder>
- <exec_per_row>N</exec_per_row>
- <filename>${PROJECT_HOME}/0005-enhanced-json-output-empty-stream.hpl</filename>
- <logext/>
- <logfile/>
- <loglevel>Basic</loglevel>
- <parameters>
- <pass_all_parameters>Y</pass_all_parameters>
- </parameters>
- <params_from_previous>N</params_from_previous>
- <run_configuration>local</run_configuration>
- <set_append_logfile>N</set_append_logfile>
- <set_logfile>N</set_logfile>
- <wait_until_finished>Y</wait_until_finished>
+ <test_names>
+ <test_name>
+ <name>0008-json-normalize-orders UNIT</name>
+ </test_name>
+ </test_names>
<parallel>N</parallel>
- <xloc>304</xloc>
- <yloc>64</yloc>
+ <xloc>256</xloc>
+ <yloc>48</yloc>
<attributes_hac/>
</action>
</actions>
<hops>
<hop>
- <from>START</from>
- <to>0005-enhanced-json-output-empty-stream.hpl</to>
+ <from>Start</from>
+ <to>Run Pipeline Unit Tests</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
diff --git a/integration-tests/json/main-0005-enhanced-json-output-empty-stream.hwf b/integration-tests/json/main-0009-json-normalize-root-array.hwf
similarity index 58%
copy from integration-tests/json/main-0005-enhanced-json-output-empty-stream.hwf
copy to integration-tests/json/main-0009-json-normalize-root-array.hwf
index b444506fae..d37a6f93c9 100644
--- a/integration-tests/json/main-0005-enhanced-json-output-empty-stream.hwf
+++ b/integration-tests/json/main-0009-json-normalize-root-array.hwf
@@ -18,75 +18,61 @@ limitations under the License.
-->
<workflow>
- <name>main-0005-enhanced-json-output-empty-stream</name>
+ <name>main-0009-json-normalize-root-array</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
- <workflow_version/>
<created_user>-</created_user>
- <created_date>2020/12/09 13:24:02.438</created_date>
<modified_user>-</modified_user>
- <modified_date>2020/12/09 13:24:02.438</modified_date>
- <parameters>
- </parameters>
+ <created_date>2026/05/08 14:00:00.000</created_date>
+ <modified_date>2026/05/08 14:00:00.000</modified_date>
+ <workflow_version/>
+ <parameters/>
<actions>
<action>
- <name>START</name>
- <description/>
- <type>SPECIAL</type>
- <attributes/>
- <DayOfMonth>1</DayOfMonth>
- <hour>12</hour>
- <intervalMinutes>60</intervalMinutes>
- <intervalSeconds>0</intervalSeconds>
- <minutes>0</minutes>
<repeat>N</repeat>
<schedulerType>0</schedulerType>
+ <intervalSeconds>0</intervalSeconds>
+ <intervalMinutes>60</intervalMinutes>
+ <DayOfMonth>1</DayOfMonth>
<weekDay>1</weekDay>
+ <minutes>0</minutes>
+ <hour>12</hour>
+ <doNotWaitOnFirstExecution>N</doNotWaitOnFirstExecution>
+ <name>Start</name>
+ <description/>
+ <type>SPECIAL</type>
+ <attributes/>
+ <xloc>50</xloc>
+ <yloc>50</yloc>
<parallel>N</parallel>
- <xloc>64</xloc>
- <yloc>64</yloc>
<attributes_hac/>
</action>
<action>
- <name>0005-enhanced-json-output-empty-stream.hpl</name>
+ <test_names>
+ <test_name>
+ <name>0009-json-normalize-root-array UNIT</name>
+ </test_name>
+ </test_names>
+ <name>Run Pipeline Unit Tests</name>
<description/>
- <type>PIPELINE</type>
+ <type>RunPipelineTests</type>
<attributes/>
- <add_date>N</add_date>
- <add_time>N</add_time>
- <clear_files>N</clear_files>
- <clear_rows>N</clear_rows>
- <create_parent_folder>N</create_parent_folder>
- <exec_per_row>N</exec_per_row>
- <filename>${PROJECT_HOME}/0005-enhanced-json-output-empty-stream.hpl</filename>
- <logext/>
- <logfile/>
- <loglevel>Basic</loglevel>
- <parameters>
- <pass_all_parameters>Y</pass_all_parameters>
- </parameters>
- <params_from_previous>N</params_from_previous>
- <run_configuration>local</run_configuration>
- <set_append_logfile>N</set_append_logfile>
- <set_logfile>N</set_logfile>
- <wait_until_finished>Y</wait_until_finished>
+ <xloc>256</xloc>
+ <yloc>48</yloc>
<parallel>N</parallel>
- <xloc>304</xloc>
- <yloc>64</yloc>
<attributes_hac/>
</action>
</actions>
<hops>
<hop>
- <from>START</from>
- <to>0005-enhanced-json-output-empty-stream.hpl</to>
- <enabled>Y</enabled>
+ <from>Start</from>
+ <to>Run Pipeline Unit Tests</to>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
+ <enabled>Y</enabled>
</hop>
</hops>
- <notepads>
- </notepads>
+ <notepads/>
<attributes/>
</workflow>
diff --git a/integration-tests/json/main-0005-enhanced-json-output-empty-stream.hwf b/integration-tests/json/main-0010-json-normalize-complex.hwf
similarity index 60%
copy from integration-tests/json/main-0005-enhanced-json-output-empty-stream.hwf
copy to integration-tests/json/main-0010-json-normalize-complex.hwf
index b444506fae..7e60b9b088 100644
--- a/integration-tests/json/main-0005-enhanced-json-output-empty-stream.hwf
+++ b/integration-tests/json/main-0010-json-normalize-complex.hwf
@@ -18,24 +18,25 @@ limitations under the License.
-->
<workflow>
- <name>main-0005-enhanced-json-output-empty-stream</name>
+ <name>main-0010-json-normalize-complex</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<workflow_version/>
<created_user>-</created_user>
- <created_date>2020/12/09 13:24:02.438</created_date>
+ <created_date>2026/05/08 14:00:00.000</created_date>
<modified_user>-</modified_user>
- <modified_date>2020/12/09 13:24:02.438</modified_date>
+ <modified_date>2026/05/08 14:00:00.000</modified_date>
<parameters>
</parameters>
<actions>
<action>
- <name>START</name>
+ <name>Start</name>
<description/>
<type>SPECIAL</type>
<attributes/>
<DayOfMonth>1</DayOfMonth>
+ <doNotWaitOnFirstExecution>N</doNotWaitOnFirstExecution>
<hour>12</hour>
<intervalMinutes>60</intervalMinutes>
<intervalSeconds>0</intervalSeconds>
@@ -44,43 +45,30 @@ limitations under the License.
<schedulerType>0</schedulerType>
<weekDay>1</weekDay>
<parallel>N</parallel>
- <xloc>64</xloc>
- <yloc>64</yloc>
+ <xloc>50</xloc>
+ <yloc>50</yloc>
<attributes_hac/>
</action>
<action>
- <name>0005-enhanced-json-output-empty-stream.hpl</name>
+ <name>Run Pipeline Unit Tests</name>
<description/>
- <type>PIPELINE</type>
+ <type>RunPipelineTests</type>
<attributes/>
- <add_date>N</add_date>
- <add_time>N</add_time>
- <clear_files>N</clear_files>
- <clear_rows>N</clear_rows>
- <create_parent_folder>N</create_parent_folder>
- <exec_per_row>N</exec_per_row>
- <filename>${PROJECT_HOME}/0005-enhanced-json-output-empty-stream.hpl</filename>
- <logext/>
- <logfile/>
- <loglevel>Basic</loglevel>
- <parameters>
- <pass_all_parameters>Y</pass_all_parameters>
- </parameters>
- <params_from_previous>N</params_from_previous>
- <run_configuration>local</run_configuration>
- <set_append_logfile>N</set_append_logfile>
- <set_logfile>N</set_logfile>
- <wait_until_finished>Y</wait_until_finished>
+ <test_names>
+ <test_name>
+ <name>0010-json-normalize-complex UNIT</name>
+ </test_name>
+ </test_names>
<parallel>N</parallel>
- <xloc>304</xloc>
- <yloc>64</yloc>
+ <xloc>256</xloc>
+ <yloc>48</yloc>
<attributes_hac/>
</action>
</actions>
<hops>
<hop>
- <from>START</from>
- <to>0005-enhanced-json-output-empty-stream.hpl</to>
+ <from>Start</from>
+ <to>Run Pipeline Unit Tests</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
diff --git a/integration-tests/json/main-0005-enhanced-json-output-empty-stream.hwf b/integration-tests/json/main-0011-json-normalize-hop-config-layers.hwf
similarity index 60%
copy from integration-tests/json/main-0005-enhanced-json-output-empty-stream.hwf
copy to integration-tests/json/main-0011-json-normalize-hop-config-layers.hwf
index b444506fae..9b2643c18d 100644
--- a/integration-tests/json/main-0005-enhanced-json-output-empty-stream.hwf
+++ b/integration-tests/json/main-0011-json-normalize-hop-config-layers.hwf
@@ -18,24 +18,25 @@ limitations under the License.
-->
<workflow>
- <name>main-0005-enhanced-json-output-empty-stream</name>
+ <name>main-0011-json-normalize-hop-config-layers</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<workflow_version/>
<created_user>-</created_user>
- <created_date>2020/12/09 13:24:02.438</created_date>
+ <created_date>2026/05/14 12:00:00.000</created_date>
<modified_user>-</modified_user>
- <modified_date>2020/12/09 13:24:02.438</modified_date>
+ <modified_date>2026/05/14 12:00:00.000</modified_date>
<parameters>
</parameters>
<actions>
<action>
- <name>START</name>
+ <name>Start</name>
<description/>
<type>SPECIAL</type>
<attributes/>
<DayOfMonth>1</DayOfMonth>
+ <doNotWaitOnFirstExecution>N</doNotWaitOnFirstExecution>
<hour>12</hour>
<intervalMinutes>60</intervalMinutes>
<intervalSeconds>0</intervalSeconds>
@@ -44,43 +45,30 @@ limitations under the License.
<schedulerType>0</schedulerType>
<weekDay>1</weekDay>
<parallel>N</parallel>
- <xloc>64</xloc>
- <yloc>64</yloc>
+ <xloc>50</xloc>
+ <yloc>50</yloc>
<attributes_hac/>
</action>
<action>
- <name>0005-enhanced-json-output-empty-stream.hpl</name>
+ <name>Run Pipeline Unit Tests</name>
<description/>
- <type>PIPELINE</type>
+ <type>RunPipelineTests</type>
<attributes/>
- <add_date>N</add_date>
- <add_time>N</add_time>
- <clear_files>N</clear_files>
- <clear_rows>N</clear_rows>
- <create_parent_folder>N</create_parent_folder>
- <exec_per_row>N</exec_per_row>
- <filename>${PROJECT_HOME}/0005-enhanced-json-output-empty-stream.hpl</filename>
- <logext/>
- <logfile/>
- <loglevel>Basic</loglevel>
- <parameters>
- <pass_all_parameters>Y</pass_all_parameters>
- </parameters>
- <params_from_previous>N</params_from_previous>
- <run_configuration>local</run_configuration>
- <set_append_logfile>N</set_append_logfile>
- <set_logfile>N</set_logfile>
- <wait_until_finished>Y</wait_until_finished>
+ <test_names>
+ <test_name>
+ <name>0011-json-normalize-hop-config-layers UNIT</name>
+ </test_name>
+ </test_names>
<parallel>N</parallel>
- <xloc>304</xloc>
- <yloc>64</yloc>
+ <xloc>256</xloc>
+ <yloc>48</yloc>
<attributes_hac/>
</action>
</actions>
<hops>
<hop>
- <from>START</from>
- <to>0005-enhanced-json-output-empty-stream.hpl</to>
+ <from>Start</from>
+ <to>Run Pipeline Unit Tests</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
diff --git a/integration-tests/json/metadata/dataset/golden-json-normalize-complex.json b/integration-tests/json/metadata/dataset/golden-json-normalize-complex.json
new file mode 100644
index 0000000000..c7d0b37388
--- /dev/null
+++ b/integration-tests/json/metadata/dataset/golden-json-normalize-complex.json
@@ -0,0 +1,49 @@
+{
+ "base_filename": "golden-json-normalize-complex.csv",
+ "virtualPath": "",
+ "name": "golden-json-normalize-complex",
+ "description": "",
+ "dataset_fields": [
+ {
+ "field_comment": "",
+ "field_length": -1,
+ "field_type": 2,
+ "field_precision": -1,
+ "field_name": "tx_id",
+ "field_format": ""
+ },
+ {
+ "field_comment": "",
+ "field_length": -1,
+ "field_type": 1,
+ "field_precision": -1,
+ "field_name": "gross_amount",
+ "field_format": ""
+ },
+ {
+ "field_comment": "",
+ "field_length": -1,
+ "field_type": 2,
+ "field_precision": -1,
+ "field_name": "status",
+ "field_format": ""
+ },
+ {
+ "field_comment": "",
+ "field_length": -1,
+ "field_type": 2,
+ "field_precision": -1,
+ "field_name": "merchant_id",
+ "field_format": ""
+ },
+ {
+ "field_comment": "",
+ "field_length": -1,
+ "field_type": 5,
+ "field_precision": -1,
+ "field_name": "fraud_score",
+ "field_format": ""
+ }
+ ],
+ "folder_name": "${HOP_DATASETS_FOLDER}"
+}
diff --git a/integration-tests/json/metadata/dataset/golden-json-normalize-hop-config-lifecycles.json b/integration-tests/json/metadata/dataset/golden-json-normalize-hop-config-lifecycles.json
new file mode 100644
index 0000000000..9f035487ae
--- /dev/null
+++ b/integration-tests/json/metadata/dataset/golden-json-normalize-hop-config-lifecycles.json
@@ -0,0 +1,41 @@
+{
+ "base_filename": "golden-json-normalize-hop-config-lifecycles.csv",
+ "virtualPath": "",
+ "name": "golden-json-normalize-hop-config-lifecycles",
+ "description": "",
+ "dataset_fields": [
+ {
+ "field_comment": "",
+ "field_length": -1,
+ "field_type": 2,
+ "field_precision": -1,
+ "field_name": "lifecycle_name",
+ "field_format": ""
+ },
+ {
+ "field_comment": "",
+ "field_length": -1,
+ "field_type": 2,
+ "field_precision": -1,
+ "field_name": "lifecycle_purpose",
+ "field_format": ""
+ },
+ {
+ "field_comment": "",
+ "field_length": -1,
+ "field_type": 2,
+ "field_precision": -1,
+ "field_name": "lifecycle_projectName",
+ "field_format": ""
+ },
+ {
+ "field_comment": "",
+ "field_length": -1,
+ "field_type": 2,
+ "field_precision": -1,
+ "field_name": "lifecycle_configurationFiles_json",
+ "field_format": ""
+ }
+ ],
+ "folder_name": "${HOP_DATASETS_FOLDER}"
+}
diff --git a/integration-tests/json/metadata/dataset/golden-json-normalize-hop-config-projects.json b/integration-tests/json/metadata/dataset/golden-json-normalize-hop-config-projects.json
new file mode 100644
index 0000000000..3966dd55c9
--- /dev/null
+++ b/integration-tests/json/metadata/dataset/golden-json-normalize-hop-config-projects.json
@@ -0,0 +1,33 @@
+{
+ "base_filename": "golden-json-normalize-hop-config-projects.csv",
+ "virtualPath": "",
+ "name": "golden-json-normalize-hop-config-projects",
+ "description": "",
+ "dataset_fields": [
+ {
+ "field_comment": "",
+ "field_length": -1,
+ "field_type": 2,
+ "field_precision": -1,
+ "field_name": "projectName",
+ "field_format": ""
+ },
+ {
+ "field_comment": "",
+ "field_length": -1,
+ "field_type": 2,
+ "field_precision": -1,
+ "field_name": "projectHome",
+ "field_format": ""
+ },
+ {
+ "field_comment": "",
+ "field_length": -1,
+ "field_type": 2,
+ "field_precision": -1,
+ "field_name": "configFilename",
+ "field_format": ""
+ }
+ ],
+ "folder_name": "${HOP_DATASETS_FOLDER}"
+}
diff --git a/integration-tests/json/metadata/dataset/golden-json-normalize-hop-config-variables.json b/integration-tests/json/metadata/dataset/golden-json-normalize-hop-config-variables.json
new file mode 100644
index 0000000000..8153dad723
--- /dev/null
+++ b/integration-tests/json/metadata/dataset/golden-json-normalize-hop-config-variables.json
@@ -0,0 +1,33 @@
+{
+ "base_filename": "golden-json-normalize-hop-config-variables.csv",
+ "virtualPath": "",
+ "name": "golden-json-normalize-hop-config-variables",
+ "description": "",
+ "dataset_fields": [
+ {
+ "field_comment": "",
+ "field_length": -1,
+ "field_type": 2,
+ "field_precision": -1,
+ "field_name": "var_name",
+ "field_format": ""
+ },
+ {
+ "field_comment": "",
+ "field_length": -1,
+ "field_type": 2,
+ "field_precision": -1,
+ "field_name": "var_value",
+ "field_format": ""
+ },
+ {
+ "field_comment": "",
+ "field_length": -1,
+ "field_type": 2,
+ "field_precision": -1,
+ "field_name": "var_description",
+ "field_format": ""
+ }
+ ],
+ "folder_name": "${HOP_DATASETS_FOLDER}"
+}
diff --git a/integration-tests/json/metadata/dataset/golden-json-normalize-orders.json b/integration-tests/json/metadata/dataset/golden-json-normalize-orders.json
new file mode 100644
index 0000000000..728029ac84
--- /dev/null
+++ b/integration-tests/json/metadata/dataset/golden-json-normalize-orders.json
@@ -0,0 +1,41 @@
+{
+ "base_filename": "golden-json-normalize-orders.csv",
+ "virtualPath": "",
+ "name": "golden-json-normalize-orders",
+ "description": "",
+ "dataset_fields": [
+ {
+ "field_comment": "",
+ "field_length": -1,
+ "field_type": 2,
+ "field_precision": -1,
+ "field_name": "orderId",
+ "field_format": ""
+ },
+ {
+ "field_comment": "",
+ "field_length": -1,
+ "field_type": 2,
+ "field_precision": -1,
+ "field_name": "customer_name",
+ "field_format": ""
+ },
+ {
+ "field_comment": "",
+ "field_length": -1,
+ "field_type": 2,
+ "field_precision": -1,
+ "field_name": "customer_country",
+ "field_format": ""
+ },
+ {
+ "field_comment": "",
+ "field_length": -1,
+ "field_type": 1,
+ "field_precision": -1,
+ "field_name": "total",
+ "field_format": ""
+ }
+ ],
+ "folder_name": "${HOP_DATASETS_FOLDER}"
+}
diff --git a/integration-tests/json/metadata/dataset/golden-json-normalize-root-array.json b/integration-tests/json/metadata/dataset/golden-json-normalize-root-array.json
new file mode 100644
index 0000000000..07ae0acb5a
--- /dev/null
+++ b/integration-tests/json/metadata/dataset/golden-json-normalize-root-array.json
@@ -0,0 +1,33 @@
+{
+ "base_filename": "golden-json-normalize-root-array.csv",
+ "virtualPath": "",
+ "name": "golden-json-normalize-root-array",
+ "description": "",
+ "dataset_fields": [
+ {
+ "field_comment": "",
+ "field_length": -1,
+ "field_type": 2,
+ "field_precision": -1,
+ "field_name": "id",
+ "field_format": ""
+ },
+ {
+ "field_comment": "",
+ "field_length": -1,
+ "field_type": 2,
+ "field_precision": -1,
+ "field_name": "event",
+ "field_format": ""
+ },
+ {
+ "field_comment": "",
+ "field_length": -1,
+ "field_type": 2,
+ "field_precision": -1,
+ "field_name": "meta_ip",
+ "field_format": ""
+ }
+ ],
+ "folder_name": "${HOP_DATASETS_FOLDER}"
+}
diff --git a/integration-tests/json/metadata/unit-test/0008-json-normalize-orders UNIT.json b/integration-tests/json/metadata/unit-test/0008-json-normalize-orders UNIT.json
new file mode 100644
index 0000000000..01e6914a8c
--- /dev/null
+++ b/integration-tests/json/metadata/unit-test/0008-json-normalize-orders UNIT.json
@@ -0,0 +1,40 @@
+{
+ "database_replacements": [],
+ "autoOpening": true,
+ "description": "",
+ "persist_filename": "",
+ "test_type": "UNIT_TEST",
+ "variableValues": [],
+ "basePath": "${HOP_UNIT_TESTS_FOLDER}",
+ "golden_data_sets": [
+ {
+ "field_mappings": [
+ {
+ "transform_field": "orderId",
+ "data_set_field": "orderId"
+ },
+ {
+ "transform_field": "customer_name",
+ "data_set_field": "customer_name"
+ },
+ {
+ "transform_field": "customer_country",
+ "data_set_field": "customer_country"
+ },
+ {
+ "transform_field": "total",
+ "data_set_field": "total"
+ }
+ ],
+ "field_order": [
+ "orderId"
+ ],
+ "data_set_name": "golden-json-normalize-orders",
+ "transform_name": "Validate"
+ }
+ ],
+ "input_data_sets": [],
+ "name": "0008-json-normalize-orders UNIT",
+ "trans_test_tweaks": [],
+ "pipeline_filename": "./0008-json-normalize-orders.hpl"
+}
diff --git a/integration-tests/json/metadata/unit-test/0009-json-normalize-root-array UNIT.json b/integration-tests/json/metadata/unit-test/0009-json-normalize-root-array UNIT.json
new file mode 100644
index 0000000000..25e419bc46
--- /dev/null
+++ b/integration-tests/json/metadata/unit-test/0009-json-normalize-root-array UNIT.json
@@ -0,0 +1,36 @@
+{
+ "database_replacements": [],
+ "autoOpening": true,
+ "description": "",
+ "persist_filename": "",
+ "test_type": "UNIT_TEST",
+ "variableValues": [],
+ "basePath": "${HOP_UNIT_TESTS_FOLDER}",
+ "golden_data_sets": [
+ {
+ "field_mappings": [
+ {
+ "transform_field": "id",
+ "data_set_field": "id"
+ },
+ {
+ "transform_field": "event",
+ "data_set_field": "event"
+ },
+ {
+ "transform_field": "meta_ip",
+ "data_set_field": "meta_ip"
+ }
+ ],
+ "field_order": [
+ "id"
+ ],
+ "data_set_name": "golden-json-normalize-root-array",
+ "transform_name": "Validate"
+ }
+ ],
+ "input_data_sets": [],
+ "name": "0009-json-normalize-root-array UNIT",
+ "trans_test_tweaks": [],
+ "pipeline_filename": "./0009-json-normalize-root-array.hpl"
+}
diff --git a/integration-tests/json/metadata/unit-test/0010-json-normalize-complex UNIT.json b/integration-tests/json/metadata/unit-test/0010-json-normalize-complex UNIT.json
new file mode 100644
index 0000000000..989b7ac7b6
--- /dev/null
+++ b/integration-tests/json/metadata/unit-test/0010-json-normalize-complex UNIT.json
@@ -0,0 +1,44 @@
+{
+ "database_replacements": [],
+ "autoOpening": true,
+ "description": "",
+ "persist_filename": "",
+ "test_type": "UNIT_TEST",
+ "variableValues": [],
+ "basePath": "${HOP_UNIT_TESTS_FOLDER}",
+ "golden_data_sets": [
+ {
+ "field_mappings": [
+ {
+ "transform_field": "tx_id",
+ "data_set_field": "tx_id"
+ },
+ {
+ "transform_field": "gross_amount",
+ "data_set_field": "gross_amount"
+ },
+ {
+ "transform_field": "status",
+ "data_set_field": "status"
+ },
+ {
+ "transform_field": "merchant_id",
+ "data_set_field": "merchant_id"
+ },
+ {
+ "transform_field": "fraud_score",
+ "data_set_field": "fraud_score"
+ }
+ ],
+ "field_order": [
+ "tx_id"
+ ],
+ "data_set_name": "golden-json-normalize-complex",
+ "transform_name": "Validate"
+ }
+ ],
+ "input_data_sets": [],
+ "name": "0010-json-normalize-complex UNIT",
+ "trans_test_tweaks": [],
+ "pipeline_filename": "./0010-json-normalize-complex.hpl"
+}
diff --git a/integration-tests/json/metadata/unit-test/0011-json-normalize-hop-config-layers UNIT.json b/integration-tests/json/metadata/unit-test/0011-json-normalize-hop-config-layers UNIT.json
new file mode 100644
index 0000000000..3715cd79df
--- /dev/null
+++ b/integration-tests/json/metadata/unit-test/0011-json-normalize-hop-config-layers UNIT.json
@@ -0,0 +1,87 @@
+{
+ "database_replacements": [],
+ "autoOpening": true,
+ "description": "",
+ "persist_filename": "",
+ "test_type": "UNIT_TEST",
+ "variableValues": [
+ {
+ "key": "HOP_CONFIG_FOLDER",
+ "value": "${HOP_UNIT_TESTS_FOLDER}/resources/hop-config-layers-it"
+ }
+ ],
+ "basePath": "${HOP_UNIT_TESTS_FOLDER}",
+ "golden_data_sets": [
+ {
+ "field_mappings": [
+ {
+ "transform_field": "var_name",
+ "data_set_field": "var_name"
+ },
+ {
+ "transform_field": "var_value",
+ "data_set_field": "var_value"
+ },
+ {
+ "transform_field": "var_description",
+ "data_set_field": "var_description"
+ }
+ ],
+ "field_order": [
+ "var_name"
+ ],
+ "data_set_name": "golden-json-normalize-hop-config-variables",
+ "transform_name": "preview variables"
+ },
+ {
+ "field_mappings": [
+ {
+ "transform_field": "lifecycle_name",
+ "data_set_field": "lifecycle_name"
+ },
+ {
+ "transform_field": "lifecycle_purpose",
+ "data_set_field": "lifecycle_purpose"
+ },
+ {
+ "transform_field": "lifecycle_projectName",
+ "data_set_field": "lifecycle_projectName"
+ },
+ {
+ "transform_field": "lifecycle_configurationFiles_json",
+ "data_set_field": "lifecycle_configurationFiles_json"
+ }
+ ],
+ "field_order": [
+ "lifecycle_name"
+ ],
+ "data_set_name": "golden-json-normalize-hop-config-lifecycles",
+ "transform_name": "preview lifecycles"
+ },
+ {
+ "field_mappings": [
+ {
+ "transform_field": "projectName",
+ "data_set_field": "projectName"
+ },
+ {
+ "transform_field": "projectHome",
+ "data_set_field": "projectHome"
+ },
+ {
+ "transform_field": "configFilename",
+ "data_set_field": "configFilename"
+ }
+ ],
+ "field_order": [
+ "projectName"
+ ],
+ "data_set_name": "golden-json-normalize-hop-config-projects",
+ "transform_name": "preview project configs"
+ }
+ ],
+ "input_data_sets": [],
+ "name": "0011-json-normalize-hop-config-layers UNIT",
+ "trans_test_tweaks": [],
+ "pipeline_filename": "./0011-json-normalize-hop-config-layers.hpl"
+}
diff --git a/integration-tests/json/resources/hop-config-layers-it/hop-config.json b/integration-tests/json/resources/hop-config-layers-it/hop-config.json
new file mode 100644
index 0000000000..bee8e529cc
--- /dev/null
+++ b/integration-tests/json/resources/hop-config-layers-it/hop-config.json
@@ -0,0 +1,33 @@
+{
+ "variables": [
+ {
+ "name": "HOP_EXAMPLE_A",
+ "value": "Y",
+ "description": "Sample described variable A."
+ },
+ {
+ "name": "HOP_EXAMPLE_B",
+ "value": "N",
+ "description": "Sample described variable B."
+ }
+ ],
+ "LocaleDefault": "en_US",
+ "projectsConfig": {
+ "enabled": true,
+ "lifecycleEnvironments": [
+ {
+ "name": "dev",
+ "purpose": "Testing",
+ "projectName": "default",
+ "configurationFiles": ["dev-env-config.json"]
+ }
+ ],
+ "projectConfigurations": [
+ {
+ "projectName": "default",
+ "projectHome": "/tmp/project-home",
+ "configFilename": "project-config.json"
+ }
+ ]
+ }
+}
diff --git a/integration-tests/json/resources/json-normalize-complex-transactions-it.json b/integration-tests/json/resources/json-normalize-complex-transactions-it.json
new file mode 100644
index 0000000000..4bb95c9fe7
--- /dev/null
+++ b/integration-tests/json/resources/json-normalize-complex-transactions-it.json
@@ -0,0 +1,172 @@
+{
+ "transactions": [
+ {
+ "txId": "TX-00001",
+ "occurredAt": "2026-01-01T00:03:00Z",
+ "grossAmount": 227.08,
+ "currency": "GBP",
+ "status": "AUTHORIZED",
+ "channel": "web",
+ "deviceType": "terminal",
+ "payer": {
+ "firstName": "Bjorn",
+ "lastName": "Nielsen",
+ "email": "bjorn.nielsen0@example.test",
+ "address": {
+ "line1": "9 Oak St",
+ "city": "Porto",
+ "region": "N",
+ "postalCode": "4000",
+ "countryCode": "PT"
+ }
+ },
+ "merchant": {
+ "id": "M-FASH",
+ "displayName": "River Fashion Co",
+ "mcc": "5691"
+ },
+ "settlement": {
+ "accountLast4": "2535",
+ "bankCode": "BK-EU-01"
+ },
+ "analytics": {
+ "campaign": "loyalty_boost",
+ "utmSource": null,
+ "segment": "new"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-4257",
+ "qty": 5,
+ "unitPrice": 56.77
+ },
+ {
+ "sku": "SKU-4611",
+ "qty": 4,
+ "unitPrice": 75.69
+ },
+ {
+ "sku": "SKU-1106",
+ "qty": 2,
+ "unitPrice": 56.77
+ }
+ ],
+ "risk": {
+ "tier": "low",
+ "fraudScore": 27
+ }
+ },
+ {
+ "txId": "TX-00002",
+ "occurredAt": "2026-01-01T00:18:00Z",
+ "grossAmount": 362.17,
+ "currency": "USD",
+ "status": "CAPTURED",
+ "channel": "web",
+ "deviceType": "terminal",
+ "payer": {
+ "firstName": "Fatima",
+ "lastName": "Patel",
+ "email": "fatima.patel1@example.test",
+ "address": {
+ "line1": "138 Oak St",
+ "city": "Amsterdam",
+ "region": "NH",
+ "postalCode": "1011",
+ "countryCode": "NL"
+ }
+ },
+ "merchant": {
+ "id": "M-FUEL",
+ "displayName": "Northwind Fuel",
+ "mcc": "5541"
+ },
+ "settlement": {
+ "accountLast4": "7201",
+ "bankCode": "BK-EU-01"
+ },
+ "analytics": {
+ "campaign": null,
+ "utmSource": null,
+ "segment": "vip"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-4150",
+ "qty": 1,
+ "unitPrice": 362.17
+ },
+ {
+ "sku": "SKU-4733",
+ "qty": 3,
+ "unitPrice": 362.17
+ },
+ {
+ "sku": "SKU-4814",
+ "qty": 1,
+ "unitPrice": 90.54
+ }
+ ],
+ "risk": {
+ "tier": "high",
+ "fraudScore": 46
+ }
+ },
+ {
+ "txId": "TX-00003",
+ "occurredAt": "2026-01-01T00:44:00Z",
+ "grossAmount": 270.63,
+ "currency": "GBP",
+ "status": "DECLINED",
+ "channel": "web",
+ "deviceType": "phone",
+ "payer": {
+ "firstName": "Chen",
+ "lastName": "Yamamoto",
+ "email": "chen.yamamoto2@example.test",
+ "address": {
+ "line1": "137 Cedar St",
+ "city": "Lyon",
+ "region": "ARA",
+ "postalCode": "69001",
+ "countryCode": "FR"
+ }
+ },
+ "merchant": {
+ "id": "M-TECH",
+ "displayName": "TechVault Electronics",
+ "mcc": "5732"
+ },
+ "settlement": {
+ "accountLast4": "5010",
+ "bankCode": "BK-EU-01"
+ },
+ "analytics": {
+ "campaign": "black_friday",
+ "utmSource": "social",
+ "segment": "vip"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-4598",
+ "qty": 3,
+ "unitPrice": 270.63
+ },
+ {
+ "sku": "SKU-4752",
+ "qty": 1,
+ "unitPrice": 90.21
+ },
+ {
+ "sku": "SKU-7572",
+ "qty": 3,
+ "unitPrice": 270.63
+ }
+ ],
+ "risk": {
+ "tier": "high",
+ "fraudScore": 91
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/integration-tests/json/resources/json-normalize-events-it.json b/integration-tests/json/resources/json-normalize-events-it.json
new file mode 100644
index 0000000000..7b7051f5ea
--- /dev/null
+++ b/integration-tests/json/resources/json-normalize-events-it.json
@@ -0,0 +1,19 @@
+{
+ "events": [
+ {
+ "id": 1,
+ "event": "login",
+ "meta": {
+ "ip": "10.0.0.1"
+ }
+ },
+ {
+ "id": 2,
+ "event": "purchase",
+ "meta": {
+ "ip": "10.0.0.2",
+ "amount": 9.99
+ }
+ }
+ ]
+}
diff --git a/integration-tests/json/resources/json-normalize-orders-it.json b/integration-tests/json/resources/json-normalize-orders-it.json
new file mode 100644
index 0000000000..8a7cdc4518
--- /dev/null
+++ b/integration-tests/json/resources/json-normalize-orders-it.json
@@ -0,0 +1,22 @@
+{
+ "orders": [
+ {
+ "orderId": "A-100",
+ "customer": {
+ "name": "Alice",
+ "country": "NL"
+ },
+ "total": 199.5,
+ "tags": ["priority", "wholesale"]
+ },
+ {
+ "orderId": "A-101",
+ "customer": {
+ "name": "Bob",
+ "country": "BE"
+ },
+ "total": 42.0,
+ "tags": ["retail"]
+ }
+ ]
+}
diff --git a/plugins/transforms/json/src/main/java/org/apache/hop/pipeline/transforms/jsonnormalize/JsonNodeFlattener.java b/plugins/transforms/json/src/main/java/org/apache/hop/pipeline/transforms/jsonnormalize/JsonNodeFlattener.java
new file mode 100644
index 0000000000..3262cb3d8f
--- /dev/null
+++ b/plugins/transforms/json/src/main/java/org/apache/hop/pipeline/transforms/jsonnormalize/JsonNodeFlattener.java
@@ -0,0 +1,194 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hop.pipeline.transforms.jsonnormalize;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.node.JsonNodeFactory;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import org.apache.hop.core.exception.HopException;
+
+/**
+ * Flattens a JSON object into a map of dot-separated paths (pandas json_normalize style). Arrays
+ * and depth limits are handled per transform options.
+ */
+public final class JsonNodeFlattener {
+
+ public static final String CODE_ARRAY_STRINGIFY = "STRINGIFY";
+ public static final String CODE_ARRAY_SINGLE_ELEMENT = "SINGLE_ELEMENT";
+ public static final String CODE_ARRAY_ERROR = "ERROR";
+
+ public static final String CODE_BEYOND_STRINGIFY = "STRINGIFY";
+ public static final String CODE_BEYOND_OMIT = "OMIT";
+ public static final String CODE_BEYOND_ERROR = "ERROR";
+
+ private static final JsonNodeFactory NODE_FACTORY = JsonNodeFactory.instance;
+
+ private JsonNodeFlattener() {}
+
+ public static Map<String, JsonNode> flatten(
+ JsonNode record,
+ String separator,
+ int maxFlattenDepth,
+ String arrayHandlingCode,
+ String beyondDepthCode)
+ throws HopException {
+ Map<String, JsonNode> out = new LinkedHashMap<>();
+ if (record == null || record.isNull()) {
+ return out;
+ }
+ if (!record.isObject()) {
+ out.put("_", record);
+ return out;
+ }
+ flattenObject(
+ record, "", 0, separator, maxFlattenDepth, arrayHandlingCode, beyondDepthCode, out);
+ return out;
+ }
+
+ private static void flattenObject(
+ JsonNode objectNode,
+ String prefix,
+ int depth,
+ String separator,
+ int maxFlattenDepth,
+ String arrayHandlingCode,
+ String beyondDepthCode,
+ Map<String, JsonNode> out)
+ throws HopException {
+ var it = objectNode.fields();
+ while (it.hasNext()) {
+ var e = it.next();
+ String path = concatPath(prefix, e.getKey(), separator);
+ flattenValue(
+ e.getValue(),
+ path,
+ depth,
+ separator,
+ maxFlattenDepth,
+ arrayHandlingCode,
+ beyondDepthCode,
+ out);
+ }
+ }
+
+ static String concatPath(String prefix, String key, String separator) {
+ if (prefix == null || prefix.isEmpty()) {
+ return key;
+ }
+ return prefix + separator + key;
+ }
+
+ private static void flattenValue(
+ JsonNode node,
+ String path,
+ int depth,
+ String separator,
+ int maxFlattenDepth,
+ String arrayHandlingCode,
+ String beyondDepthCode,
+ Map<String, JsonNode> out)
+ throws HopException {
+ if (node == null || node.isNull()) {
+ out.put(path, node);
+ return;
+ }
+ if (node.isArray()) {
+ handleArray(
+ node, path, depth, separator, maxFlattenDepth, arrayHandlingCode, beyondDepthCode, out);
+ return;
+ }
+ if (node.isObject()) {
+ if (maxFlattenDepth >= 0 && depth >= maxFlattenDepth) {
+ putBeyondDepth(node, path, beyondDepthCode, out);
+ } else {
+ flattenObject(
+ node,
+ path,
+ depth + 1,
+ separator,
+ maxFlattenDepth,
+ arrayHandlingCode,
+ beyondDepthCode,
+ out);
+ }
+ return;
+ }
+ out.put(path, node);
+ }
+
+ private static void handleArray(
+ JsonNode arrayNode,
+ String path,
+ int depth,
+ String separator,
+ int maxFlattenDepth,
+ String arrayHandlingCode,
+ String beyondDepthCode,
+ Map<String, JsonNode> out)
+ throws HopException {
+ int n = arrayNode.size();
+ if (CODE_ARRAY_ERROR.equals(arrayHandlingCode)) {
+ if (n > 0) {
+ throw new HopException(
+ "Array not allowed at path '" + path + "' when array handling is ERROR.");
+ }
+ out.put(path, NODE_FACTORY.nullNode());
+ return;
+ }
+ if (CODE_ARRAY_SINGLE_ELEMENT.equals(arrayHandlingCode)) {
+ if (n == 0) {
+ out.put(path, NODE_FACTORY.nullNode());
+ return;
+ }
+ if (n > 1) {
+ throw new HopException(
+ "Array at path '"
+ + path
+ + "' has "
+ + n
+ + " elements; SINGLE_ELEMENT handling allows at most one.");
+ }
+ flattenValue(
+ arrayNode.get(0),
+ path,
+ depth,
+ separator,
+ maxFlattenDepth,
+ arrayHandlingCode,
+ beyondDepthCode,
+ out);
+ return;
+ }
+ // STRINGIFY (default)
+ out.put(path, arrayNode);
+ }
+
+ private static void putBeyondDepth(
+ JsonNode node, String path, String beyondDepthCode, Map<String, JsonNode> out)
+ throws HopException {
+ if (CODE_BEYOND_OMIT.equals(beyondDepthCode)) {
+ return;
+ }
+ if (CODE_BEYOND_ERROR.equals(beyondDepthCode)) {
+ throw new HopException(
+ "Nested object at path '" + path + "' exceeds max flatten depth (strict mode).");
+ }
+ out.put(path, node);
+ }
+}
diff --git a/plugins/transforms/json/src/main/java/org/apache/hop/pipeline/transforms/jsonnormalize/JsonNormalizeInput.java b/plugins/transforms/json/src/main/java/org/apache/hop/pipeline/transforms/jsonnormalize/JsonNormalizeInput.java
new file mode 100644
index 0000000000..101717dccd
--- /dev/null
+++ b/plugins/transforms/json/src/main/java/org/apache/hop/pipeline/transforms/jsonnormalize/JsonNormalizeInput.java
@@ -0,0 +1,510 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hop.pipeline.transforms.jsonnormalize;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.node.JsonNodeFactory;
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.BitSet;
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.commons.lang3.NotImplementedException;
+import org.apache.commons.vfs2.FileObject;
+import org.apache.commons.vfs2.FileSystemException;
+import org.apache.hop.core.ResultFile;
+import org.apache.hop.core.exception.HopException;
+import org.apache.hop.core.exception.HopTransformException;
+import org.apache.hop.core.exception.HopValueException;
+import org.apache.hop.core.io.CountingInputStream;
+import org.apache.hop.core.row.IValueMeta;
+import org.apache.hop.core.row.RowDataUtil;
+import org.apache.hop.core.row.RowMeta;
+import org.apache.hop.core.util.StringUtil;
+import org.apache.hop.core.util.Utils;
+import org.apache.hop.core.vfs.HopVfs;
+import org.apache.hop.i18n.BaseMessages;
+import org.apache.hop.pipeline.Pipeline;
+import org.apache.hop.pipeline.PipelineMeta;
+import org.apache.hop.pipeline.transform.BaseTransform;
+import org.apache.hop.pipeline.transform.TransformMeta;
+import org.apache.hop.pipeline.transforms.file.BaseFileInputTransform;
+import org.apache.hop.pipeline.transforms.file.IBaseFileInputReader;
+import org.apache.hop.pipeline.transforms.jsoninput.JsonInputField;
+import org.apache.hop.pipeline.transforms.jsoninput.JsonInputMeta;
+import org.apache.hop.pipeline.transforms.jsoninput.reader.RowOutputConverter;
+
+/**
+ * Reads JSON (files, URLs, or fields) and emits one row per array element after pandas-style
+ * flattening of each record.
+ */
+public class JsonNormalizeInput
+ extends BaseFileInputTransform<JsonNormalizeInputMeta, JsonNormalizeInputData> {
+ private static final Class<?> PKG = JsonNormalizeInputMeta.class;
+
+ private static final byte[] EMPTY_JSON = "{}".getBytes();
+ private static final JsonNode EMPTY_OBJECT_NODE = JsonNodeFactory.instance.objectNode();
+
+ private RowOutputConverter rowOutputConverter;
+
+ public JsonNormalizeInput(
+ TransformMeta transformMeta,
+ JsonNormalizeInputMeta meta,
+ JsonNormalizeInputData data,
+ int copyNr,
+ PipelineMeta pipelineMeta,
+ Pipeline pipeline) {
+ super(transformMeta, meta, data, copyNr, pipelineMeta, pipeline);
+ }
+
+ @Override
+ public boolean init() {
+ if (!super.init()) {
+ return false;
+ }
+ data.rownr = 1L;
+ data.nrInputFields = meta.getInputFields().size();
+ data.repeatedFields = new BitSet(data.nrInputFields);
+ for (int i = 0; i < data.nrInputFields; i++) {
+ JsonInputField field = meta.getInputFields().get(i);
+ if (field.isRepeated()) {
+ data.repeatedFields.set(i);
+ }
+ }
+ data.resolvedFields = new JsonInputField[data.nrInputFields];
+ for (int i = 0; i < data.nrInputFields; i++) {
+ JsonInputField field = new JsonInputField(meta.getInputFields().get(i));
+ field.setPath(resolveJsonPath(field.getPath()));
+ data.resolvedFields[i] = field;
+ }
+ return true;
+ }
+
+ @Override
+ public boolean processRow() throws HopException {
+ if (first) {
+ first = false;
+ prepareToRowProcessing(false);
+ } else if (data.indexSourceField == -1 && data.inputRowMeta != null) {
+ data.readrow = getRow();
+ if (data.readrow != null) {
+ throw new HopValueException(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInput.Log.ReceivingMultiRows"));
+ }
+ }
+
+ Object[] outRow;
+ try {
+ outRow = getOneOutputRow();
+ if (outRow == null) {
+ setOutputDone();
+ return false;
+ }
+
+ if (isRowLevel()) {
+ logRowlevel(
+ BaseMessages.getString(
+ PKG, "JsonInput.Log.ReadRow", data.outputRowMeta.getString(outRow)));
+ }
+ incrementLinesInput();
+ data.rownr++;
+
+ putRow(data.outputRowMeta, outRow);
+
+ if (meta.getRowLimit() > 0 && data.rownr > meta.getRowLimit()) {
+ setOutputDone();
+ return false;
+ }
+
+ } catch (Exception e) {
+ logError(
+ BaseMessages.getString(
+ PKG, "JsonNormalizeInput.ErrorInTransformRunning", e.getMessage()));
+ if (getTransformMeta().isDoingErrorHandling()) {
+ sendErrorRow(e.toString());
+ } else {
+ setErrors(getErrors() + 1);
+ stopAll();
+ setOutputDone();
+ return false;
+ }
+ }
+ return true;
+ }
+
+ @Override
+ protected void prepareToRowProcessing(boolean errorIgnored)
+ throws HopException, HopTransformException, HopValueException {
+ data.readrow = getRow();
+ data.inputRowMeta = getInputRowMeta();
+ if (!meta.isInFields() && data.inputRowMeta == null) {
+ data.outputRowMeta = new RowMeta();
+ if (!meta.isDoNotFailIfNoFile() && (data.files == null || data.files.nrOfFiles() == 0)) {
+ String errMsg = BaseMessages.getString(JsonInputMeta.class, "JsonInput.Log.NoFiles");
+ logError(errMsg);
+ inputError(errMsg);
+ }
+ } else {
+ if (data.inputRowMeta == null) {
+ data.hasFirstRow = false;
+ return;
+ }
+ data.hasFirstRow = true;
+ data.outputRowMeta = data.inputRowMeta.clone();
+
+ if (meta.isInFields() && !StringUtil.isEmpty(meta.getFieldValue())) {
+ data.indexSourceField = getInputRowMeta().indexOfValue(meta.getFieldValue());
+ if (data.indexSourceField < 0) {
+ logError(
+ BaseMessages.getString(
+ JsonInputMeta.class, "JsonInput.Log.ErrorFindingField", meta.getFieldValue()));
+ throw new HopException(
+ BaseMessages.getString(
+ PKG, "JsonInput.Exception.CouldnotFindField", meta.getFieldValue()));
+ }
+ }
+
+ if (meta.isRemoveSourceField() && data.indexSourceField >= 0) {
+ data.outputRowMeta.removeValueMeta(data.indexSourceField);
+ data.totalpreviousfields = data.inputRowMeta.size() - 1;
+ } else {
+ data.totalpreviousfields = data.inputRowMeta.size();
+ }
+ }
+ meta.getFields(data.outputRowMeta, getTransformName(), null, null, this, metadataProvider);
+
+ data.convertRowMeta = data.outputRowMeta.cloneToType(IValueMeta.TYPE_STRING);
+
+ NormalizeInputsReader readerFactory =
+ new NormalizeInputsReader(this, meta, data, new InputErrorHandler());
+ if (data.inputRowMeta != null
+ && data.inputRowMeta.getValueMeta(data.indexSourceField) != null
+ && data.inputRowMeta.getValueMeta(data.indexSourceField).isJson()) {
+ data.jsonInputs = readerFactory.jsonFieldIterator();
+ data.inputs = null;
+ data.processingJson = true;
+ } else {
+ data.inputs = readerFactory.iterator();
+ data.jsonInputs = null;
+ data.processingJson = false;
+ }
+
+ data.currentRecords = null;
+ data.recordPointer = 0;
+ rowOutputConverter = new RowOutputConverter(getLogChannel());
+ }
+
+ private void addFileToResultFilesname(FileObject file) {
+ if (meta.addResultFile()) {
+ ResultFile resultFile =
+ new ResultFile(
+ ResultFile.FILE_TYPE_GENERAL, file, getPipelineMeta().getName(), getTransformName());
+ resultFile.setComment(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInput.Log.FileAddedResult"));
+ addResultFile(resultFile);
+ }
+ }
+
+ public boolean onNewFile(FileObject file) throws FileSystemException {
+ if (file == null) {
+ String errMsg =
+ BaseMessages.getString(JsonInputMeta.class, "JsonInput.Log.IsNotAFile", "null");
+ logError(errMsg);
+ inputError(errMsg);
+ return false;
+ } else if (!file.exists()) {
+ String errMsg =
+ BaseMessages.getString(
+ JsonInputMeta.class, "JsonInput.Log.IsNotAFile", file.getName().getFriendlyURI());
+ logError(errMsg);
+ inputError(errMsg);
+ return false;
+ }
+ if (hasAdditionalFileFields()) {
+ fillFileAdditionalFields(data, file);
+ }
+ if (file.getContent().getSize() == 0) {
+ if (meta.isIgnoringEmptyFile()) {
+ logBasic(
+ BaseMessages.getString(
+ JsonInputMeta.class, "JsonInput.Error.FileSizeZero", "" + file.getName()));
+ } else {
+ logError(
+ BaseMessages.getString(
+ JsonInputMeta.class, "JsonInput.Error.FileSizeZero", "" + file.getName()));
+ setErrors(getErrors() + 1);
+ return false;
+ }
+ }
+ return true;
+ }
+
+ @Override
+ protected void fillFileAdditionalFields(JsonNormalizeInputData data, FileObject file)
+ throws FileSystemException {
+ super.fillFileAdditionalFields(data, file);
+ data.filename = HopVfs.getFilename(file);
+ data.filenr++;
+ if (isDetailed()) {
+ logDetailed(
+ BaseMessages.getString(
+ JsonInputMeta.class, "JsonInput.Log.OpeningFile", file.toString()));
+ }
+ addFileToResultFilesname(file);
+ }
+
+ /**
+ * Resolves {@code %%var%%} / {@code ${var}} like {@link #resolve(String)} but skips hex decoding
+ * ({@code $[xx]}). JsonPath wildcards such as {@code $[*]} are otherwise mangled by {@link
+ * org.apache.hop.core.util.StringUtil#environmentSubstitute}.
+ */
+ private String resolveJsonPath(String path) {
+ if (StringUtil.isEmpty(path)) {
+ return path;
+ }
+ Map<String, String> variables = new HashMap<>();
+ for (String name : getVariableNames()) {
+ variables.put(name, getVariable(name));
+ }
+ String afterWindows = StringUtil.substituteWindows(path, variables);
+ return StringUtil.substituteUnix(afterWindows, variables);
+ }
+
+ private void incrementErrors() {
+ setErrors(getErrors() + 1);
+ }
+
+ private void inputError(String errorMsg) {
+ if (getTransformMeta().isDoingErrorHandling()) {
+ sendErrorRow(errorMsg);
+ } else {
+ incrementErrors();
+ }
+ }
+
+ @Override
+ public boolean failAfterBadFile(String errorMsg, boolean errorIgnored, boolean skipBadFiles) {
+ return true;
+ }
+
+ private class InputErrorHandler implements NormalizeInputsReader.ErrorHandler {
+ @Override
+ public void error(Exception e) {
+ logError(
+ BaseMessages.getString(
+ JsonInputMeta.class, "JsonInput.Log.UnexpectedError", e.toString()));
+ setErrors(getErrors() + 1);
+ }
+
+ @Override
+ public void fileOpenError(FileObject file, FileSystemException e) {
+ String msg =
+ BaseMessages.getString(
+ PKG,
+ "JsonInput.Log.UnableToOpenFile",
+ "" + data.filenr,
+ file.toString(),
+ e.toString());
+ logError(msg);
+ inputError(msg);
+ }
+
+ @Override
+ public void fileCloseError(FileObject file, FileSystemException e) {
+ error(e);
+ }
+ }
+
+ private Object[] getOneOutputRow() throws HopException {
+ if (meta.isInFields() && !data.hasFirstRow) {
+ return null;
+ }
+ while (true) {
+ if (data.currentRecords != null && data.recordPointer < data.currentRecords.size()) {
+ JsonNode record = data.currentRecords.get(data.recordPointer++);
+ Object[] rawPart = buildFlattenedRow(record);
+ Object[] outputRow = rowOutputConverter.getRow(buildBaseOutputRow(), rawPart, data);
+ addExtraFields(outputRow, data);
+ return outputRow;
+ }
+ if (!loadNextDocument()) {
+ if (isDetailed()) {
+ logDetailed(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInput.Log.FinishedProcessing"));
+ }
+ return null;
+ }
+ }
+ }
+
+ private boolean loadNextDocument() throws HopException {
+ String recordPath = resolveJsonPath(meta.getRecordPath());
+ while (true) {
+ if (data.processingJson) {
+ if (data.jsonInputs == null || !data.jsonInputs.hasNext()) {
+ return false;
+ }
+ JsonNode root = data.jsonInputs.next();
+ if (root == null) {
+ root = EMPTY_OBJECT_NODE;
+ }
+ data.currentRecords = JsonNormalizeRecords.extractRecordsFromNode(root, recordPath);
+ } else {
+ if (data.inputs == null || !data.inputs.hasNext()) {
+ return false;
+ }
+ InputStream in = data.inputs.next();
+ if (in != null) {
+ CountingInputStream countingIn = new CountingInputStream(in);
+ try {
+ data.currentRecords =
+ JsonNormalizeRecords.extractRecordsFromStream(countingIn, recordPath);
+ } finally {
+ dataVolumeIn = (dataVolumeIn != null ? dataVolumeIn : 0L) + countingIn.getCount();
+ BaseTransform.closeQuietly(countingIn);
+ }
+ } else {
+ data.currentRecords =
+ JsonNormalizeRecords.extractRecordsFromStream(
+ new ByteArrayInputStream(EMPTY_JSON), recordPath);
+ }
+ }
+ data.recordPointer = 0;
+ if (data.currentRecords != null && !data.currentRecords.isEmpty()) {
+ return true;
+ }
+ }
+ }
+
+ private Object[] buildFlattenedRow(JsonNode record) throws HopException {
+ Map<String, JsonNode> flat =
+ JsonNodeFlattener.flatten(
+ record,
+ meta.getFieldSeparator(),
+ meta.getMaxFlattenDepth(),
+ meta.getArrayHandling(),
+ meta.getBeyondDepthBehavior());
+ Object[] out = new Object[data.nrInputFields];
+ for (int i = 0; i < data.nrInputFields; i++) {
+ String path = data.resolvedFields[i].getPath();
+ if (!flat.containsKey(path)) {
+ if (!meta.isIgnoreMissingField()) {
+ throw new HopException(
+ BaseMessages.getString(PKG, "JsonNormalizeInput.Error.MissingPath", path));
+ }
+ out[i] = null;
+ continue;
+ }
+ JsonNode v = flat.get(path);
+ out[i] = (v == null || v.isNull()) ? null : v;
+ }
+ return out;
+ }
+
+ private void sendErrorRow(String errorMsg) {
+ try {
+ String defaultErrCode = "JsonNormalizeInput001";
+ if (data.readrow != null) {
+ putError(
+ getInputRowMeta(), data.readrow, 1, errorMsg, meta.getFieldValue(), defaultErrCode);
+ } else {
+ putError(new RowMeta(), new Object[0], 1, errorMsg, null, defaultErrCode);
+ }
+ } catch (HopTransformException e) {
+ logError(e.getLocalizedMessage(), e);
+ }
+ }
+
+ private boolean hasAdditionalFileFields() {
+ return data.file != null;
+ }
+
+ private Object[] buildBaseOutputRow() {
+ Object[] outputRowData;
+ if (data.readrow != null) {
+ if (meta.isRemoveSourceField() && data.indexSourceField > -1) {
+ int sz = data.readrow.length;
+ outputRowData = RowDataUtil.allocateRowData(data.outputRowMeta.size());
+ int ii = 0;
+ for (int i = 0; i < sz; i++) {
+ if (i != data.indexSourceField) {
+ outputRowData[ii++] = data.readrow[i];
+ }
+ }
+ } else {
+ outputRowData = RowDataUtil.createResizedCopy(data.readrow, data.outputRowMeta.size());
+ }
+ } else {
+ outputRowData = RowDataUtil.allocateRowData(data.outputRowMeta.size());
+ }
+ return outputRowData;
+ }
+
+ private void addExtraFields(Object[] outputRowData, JsonNormalizeInputData d) {
+ int rowIndex = d.totalpreviousfields + d.nrInputFields;
+
+ if (meta.includeFilename() && !Utils.isEmpty(meta.getFilenameField())) {
+ outputRowData[rowIndex++] = d.filename;
+ }
+ if (meta.includeRowNumber() && !Utils.isEmpty(meta.getRowNumberField())) {
+ outputRowData[rowIndex++] = d.rownr;
+ }
+ if (!Utils.isEmpty(meta.getShortFileNameField())) {
+ outputRowData[rowIndex++] = d.shortFilename;
+ }
+ if (!Utils.isEmpty(meta.getExtensionField())) {
+ outputRowData[rowIndex++] = d.extension;
+ }
+ if (!Utils.isEmpty(meta.getPathField())) {
+ outputRowData[rowIndex++] = d.path;
+ }
+ if (!Utils.isEmpty(meta.getSizeField())) {
+ outputRowData[rowIndex++] = d.size;
+ }
+ if (!Utils.isEmpty(meta.isHiddenField())) {
+ outputRowData[rowIndex++] = Boolean.valueOf(d.path);
+ }
+ if (meta.getLastModificationDateField() != null
+ && !meta.getLastModificationDateField().isEmpty()) {
+ outputRowData[rowIndex++] = d.lastModificationDateTime;
+ }
+ if (!Utils.isEmpty(meta.getUriField())) {
+ outputRowData[rowIndex++] = d.uriName;
+ }
+ if (!Utils.isEmpty(meta.getRootUriField())) {
+ outputRowData[rowIndex++] = d.rootUriName;
+ }
+ }
+
+ @Override
+ protected IBaseFileInputReader createReader(
+ JsonNormalizeInputMeta meta, JsonNormalizeInputData data, FileObject file) throws Exception {
+ throw new NotImplementedException();
+ }
+
+ @Override
+ public void dispose() {
+ if (data.file != null) {
+ closeQuietly(data.file);
+ }
+ data.inputs = null;
+ data.jsonInputs = null;
+ data.currentRecords = null;
+ super.dispose();
+ }
+}
diff --git a/plugins/transforms/json/src/main/java/org/apache/hop/pipeline/transforms/jsonnormalize/JsonNormalizeInputData.java b/plugins/transforms/json/src/main/java/org/apache/hop/pipeline/transforms/jsonnormalize/JsonNormalizeInputData.java
new file mode 100644
index 0000000000..20ea6bcb69
--- /dev/null
+++ b/plugins/transforms/json/src/main/java/org/apache/hop/pipeline/transforms/jsonnormalize/JsonNormalizeInputData.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hop.pipeline.transforms.jsonnormalize;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import java.util.List;
+import org.apache.hop.pipeline.transforms.jsoninput.JsonInputData;
+import org.apache.hop.pipeline.transforms.jsoninput.JsonInputField;
+
+@SuppressWarnings("java:S1104")
+public class JsonNormalizeInputData extends JsonInputData {
+
+ /** Resolved field paths after variable substitution */
+ public JsonInputField[] resolvedFields;
+
+ public List<JsonNode> currentRecords;
+ public int recordPointer;
+ public boolean processingJson;
+
+ public JsonNormalizeInputData() {
+ super();
+ recordPointer = 0;
+ processingJson = false;
+ }
+}
diff --git a/plugins/transforms/json/src/main/java/org/apache/hop/pipeline/transforms/jsonnormalize/JsonNormalizeInputDialog.java b/plugins/transforms/json/src/main/java/org/apache/hop/pipeline/transforms/jsonnormalize/JsonNormalizeInputDialog.java
new file mode 100644
index 0000000000..d36a2a8c5f
--- /dev/null
+++ b/plugins/transforms/json/src/main/java/org/apache/hop/pipeline/transforms/jsonnormalize/JsonNormalizeInputDialog.java
@@ -0,0 +1,1790 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hop.pipeline.transforms.jsonnormalize;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import org.apache.commons.vfs2.FileObject;
+import org.apache.hop.core.Const;
+import org.apache.hop.core.Props;
+import org.apache.hop.core.exception.HopException;
+import org.apache.hop.core.fileinput.FileInputList;
+import org.apache.hop.core.fileinput.InputFile;
+import org.apache.hop.core.row.IRowMeta;
+import org.apache.hop.core.row.value.ValueMetaBase;
+import org.apache.hop.core.row.value.ValueMetaFactory;
+import org.apache.hop.core.variables.IVariables;
+import org.apache.hop.core.vfs.HopVfs;
+import org.apache.hop.i18n.BaseMessages;
+import org.apache.hop.pipeline.Pipeline;
+import org.apache.hop.pipeline.PipelineMeta;
+import org.apache.hop.pipeline.PipelinePreviewFactory;
+import org.apache.hop.pipeline.transforms.file.BaseFileInputMeta;
+import org.apache.hop.pipeline.transforms.jsoninput.JsonInputField;
+import org.apache.hop.pipeline.transforms.jsoninput.JsonInputMeta;
+import org.apache.hop.ui.core.PropsUi;
+import org.apache.hop.ui.core.dialog.BaseDialog;
+import org.apache.hop.ui.core.dialog.EnterNumberDialog;
+import org.apache.hop.ui.core.dialog.EnterSelectionDialog;
+import org.apache.hop.ui.core.dialog.EnterTextDialog;
+import org.apache.hop.ui.core.dialog.ErrorDialog;
+import org.apache.hop.ui.core.dialog.MessageBox;
+import org.apache.hop.ui.core.dialog.PreviewRowsDialog;
+import org.apache.hop.ui.core.gui.GuiResource;
+import org.apache.hop.ui.core.widget.ColumnInfo;
+import org.apache.hop.ui.core.widget.TableView;
+import org.apache.hop.ui.core.widget.TextVar;
+import org.apache.hop.ui.pipeline.dialog.PipelinePreviewProgressDialog;
+import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.CTabItem;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Text;
+
+public class JsonNormalizeInputDialog extends BaseTransformDialog {
+ private static final Class<?> PKG = JsonNormalizeInputMeta.class;
+ public static final String CONST_SYSTEM_COMBO_YES = "System.Combo.Yes";
+
+ private CTabFolder wTabFolder;
+
+ private Label wlFilename;
+ private Label wlSourceIsAFile;
+ private Button wbbFilename; // Browse: add file or directory
+ private Button wbdFilename; // Delete
+ private Button wbeFilename; // Edit
+ private Button wbaFilename; // Add or change
+ private TextVar wFilename;
+
+ private Label wlFilenameList;
+ private TableView wFilenameList;
+
+ private Label wlFilemask;
+ private TextVar wFilemask;
+
+ private Button wbShowFiles;
+
+ private Label wlSourceField;
+ private CCombo wFieldValue;
+ private Button wSourceStreamField;
+ private Button wSourceIsAFile;
+
+ private Label wlInclFilename;
+ private Button wInclFilename;
+ private Button wAddResult;
+
+ private Label wlReadUrl;
+ private Button wReadUrl;
+
+ private Label wlRemoveSourceField;
+ private Button wRemoveSourceField;
+ private Label wlInclFilenameField;
+ private TextVar wInclFilenameField;
+
+ private Label wlAddResult;
+ private Button wInclRownum;
+
+ private Label wlInclRownumField;
+ private TextVar wInclRownumField;
+
+ private Label wlLimit;
+ private Text wLimit;
+
+ private TableView wFields;
+
+ private Label wlExcludeFilemask;
+ private TextVar wExcludeFilemask;
+
+ private Button wIgnoreEmptyFile;
+
+ private Button wIgnoreMissingField;
+
+ private TextVar wRecordPath;
+
+ private TextVar wFieldSeparator;
+
+ private TextVar wMaxFlattenDepth;
+
+ private CCombo wArrayHandling;
+
+ private CCombo wBeyondDepth;
+
+ private Button wDoNotFailIfNoFile;
+
+ private TextVar wShortFileFieldName;
+ private TextVar wPathFieldName;
+
+ private TextVar wIsHiddenName;
+ private TextVar wLastModificationTimeName;
+ private TextVar wUriName;
+ private TextVar wRootUriName;
+ private TextVar wExtensionFieldName;
+ private TextVar wSizeFieldName;
+
+ private final JsonNormalizeInputMeta input;
+
+ private ModifyListener lsMod;
+
+ public JsonNormalizeInputDialog(
+ Shell parent,
+ IVariables variables,
+ JsonNormalizeInputMeta transformMeta,
+ PipelineMeta pipelineMeta) {
+ super(parent, variables, transformMeta, pipelineMeta);
+ input = transformMeta;
+ }
+
+ @Override
+ public String open() {
+ createShell(BaseMessages.getString(PKG, "JsonNormalizeInputDialog.DialogTitle"));
+
+ buildButtonBar().ok(e -> ok()).preview(e -> preview()).cancel(e -> cancel()).build();
+
+ lsMod = e -> input.setChanged();
+ changed = input.hasChanged();
+
+ wTabFolder = new CTabFolder(shell, SWT.BORDER);
+ PropsUi.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);
+
+ addFileTab();
+
+ addContentTab();
+
+ addFieldsTab();
+
+ addAdditionalFieldsTab();
+
+ FormData fdTabFolder = new FormData();
+ fdTabFolder.left = new FormAttachment(0, 0);
+ fdTabFolder.top = new FormAttachment(wSpacer, margin);
+ fdTabFolder.right = new FormAttachment(100, 0);
+ fdTabFolder.bottom = new FormAttachment(wOk, -margin);
+ wTabFolder.setLayoutData(fdTabFolder);
+
+ // Add the file to the list of files...
+ SelectionAdapter selA =
+ new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ wFilenameList.add(
+ wFilename.getText(),
+ wFilemask.getText(),
+ wExcludeFilemask.getText(),
+ BaseFileInputMeta.REQUIRED_FILES_CODE[0],
+ BaseFileInputMeta.REQUIRED_FILES_CODE[0]);
+ wFilename.setText("");
+ wFilemask.setText("");
+ wExcludeFilemask.setText("");
+ wFilenameList.removeEmptyRows();
+ wFilenameList.setRowNums();
+ wFilenameList.optWidth(true);
+ }
+ };
+ wbaFilename.addSelectionListener(selA);
+ wFilename.addSelectionListener(selA);
+
+ // Delete files from the list of files...
+ wbdFilename.addSelectionListener(
+ new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ int[] idx = wFilenameList.getSelectionIndices();
+ wFilenameList.remove(idx);
+ wFilenameList.removeEmptyRows();
+ wFilenameList.setRowNums();
+ }
+ });
+
+ // Edit the selected file & remove from the list...
+ wbeFilename.addSelectionListener(
+ new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ int idx = wFilenameList.getSelectionIndex();
+ if (idx >= 0) {
+ String[] string = wFilenameList.getItem(idx);
+ wFilename.setText(string[0]);
+ wFilemask.setText(string[1]);
+ wExcludeFilemask.setText(string[2]);
+ wFilenameList.remove(idx);
+ }
+ wFilenameList.removeEmptyRows();
+ wFilenameList.setRowNums();
+ }
+ });
+
+ // Show the files that are selected at this time...
+ wbShowFiles.addSelectionListener(
+ new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ JsonNormalizeInputMeta tfii = new JsonNormalizeInputMeta();
+ getInfo(tfii);
+ FileInputList fileInputList = tfii.getFiles(variables);
+ String[] files = fileInputList.getFileStrings();
+ if (files != null && files.length > 0) {
+ EnterSelectionDialog esd =
+ new EnterSelectionDialog(
+ shell,
+ files,
+ BaseMessages.getString(
+ JsonInputMeta.class, "JsonInputDialog.FilesReadSelection.DialogTitle"),
+ BaseMessages.getString(
+ PKG, "JsonInputDialog.FilesReadSelection.DialogMessage"));
+ esd.setViewOnly();
+ esd.open();
+ } else {
+ MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
+ mb.setMessage(
+ BaseMessages.getString(
+ JsonInputMeta.class, "JsonInputDialog.NoFileFound.DialogMessage"));
+ mb.setText(BaseMessages.getString(PKG, "System.Dialog.Error.Title"));
+ mb.open();
+ }
+ }
+ });
+ // Enable/disable the right fields to allow a filename to be added to each row...
+ wInclFilename.addSelectionListener(
+ new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ setIncludeFilename();
+ }
+ });
+
+ wInclRownum.addSelectionListener(
+ new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ setIncludeRownum();
+ }
+ });
+
+ wFilename.addModifyListener(e -> wFilename.setToolTipText(wFilename.getText()));
+
+ wbbFilename.addListener(
+ SWT.Selection,
+ e ->
+ BaseDialog.presentFileDialog(
+ shell,
+ wFilename,
+ variables,
+ new String[] {"*.js;*.json", "*.*"},
+ new String[] {
+ BaseMessages.getString(PKG, "System.FileType.JsonFiles"),
+ BaseMessages.getString(PKG, "System.FileType.AllFiles")
+ },
+ true));
+
+ wTabFolder.setSelection(0);
+
+ getData(input);
+ activeStreamField();
+ setIncludeFilename();
+ setIncludeRownum();
+ input.setChanged(changed);
+ wFields.optWidth(true);
+ focusTransformName();
+ BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
+
+ return transformName;
+ }
+
+ private void addFieldsTab() {
+ // Fields tab...
+ //
+ CTabItem wFieldsTab = new CTabItem(wTabFolder, SWT.NONE);
+ wFieldsTab.setFont(GuiResource.getInstance().getFontDefault());
+ wFieldsTab.setText(BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.Fields.Tab"));
+
+ FormLayout fieldsLayout = new FormLayout();
+ fieldsLayout.marginWidth = PropsUi.getFormMargin();
+ fieldsLayout.marginHeight = PropsUi.getFormMargin();
+
+ Composite wFieldsComp = new Composite(wTabFolder, SWT.NONE);
+ wFieldsComp.setLayout(fieldsLayout);
+ PropsUi.setLook(wFieldsComp);
+
+ wGet = new Button(wFieldsComp, SWT.PUSH);
+ wGet.setText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.Button.SelectFields"));
+ wGet.addListener(SWT.Selection, e -> get());
+
+ Button wGetSnippet = new Button(wFieldsComp, SWT.PUSH);
+ wGetSnippet.setText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.Button.SelectFieldsSnippet"));
+ wGetSnippet.addListener(SWT.Selection, e -> getFromSnippet());
+
+ setButtonPositions(new Button[] {wGet, wGetSnippet}, margin, null);
+
+ final int FieldsRows = input.getInputFields().size();
+
+ ColumnInfo[] colInfos =
+ new ColumnInfo[] {
+ new ColumnInfo(
+ BaseMessages.getString(
+ JsonInputMeta.class, "JsonInputDialog.FieldsTable.Name.Column"),
+ ColumnInfo.COLUMN_TYPE_TEXT,
+ false),
+ new ColumnInfo(
+ BaseMessages.getString(
+ JsonInputMeta.class, "JsonInputDialog.FieldsTable.Path.Column"),
+ ColumnInfo.COLUMN_TYPE_TEXT,
+ false),
+ new ColumnInfo(
+ BaseMessages.getString(
+ JsonInputMeta.class, "JsonInputDialog.FieldsTable.Type.Column"),
+ ColumnInfo.COLUMN_TYPE_CCOMBO,
+ ValueMetaFactory.getValueMetaNames(),
+ true),
+ new ColumnInfo(
+ BaseMessages.getString(
+ JsonInputMeta.class, "JsonInputDialog.FieldsTable.Format.Column"),
+ ColumnInfo.COLUMN_TYPE_FORMAT,
+ 3),
+ new ColumnInfo(
+ BaseMessages.getString(
+ JsonInputMeta.class, "JsonInputDialog.FieldsTable.Length.Column"),
+ ColumnInfo.COLUMN_TYPE_TEXT,
+ false),
+ new ColumnInfo(
+ BaseMessages.getString(
+ JsonInputMeta.class, "JsonInputDialog.FieldsTable.Precision.Column"),
+ ColumnInfo.COLUMN_TYPE_TEXT,
+ false),
+ new ColumnInfo(
+ BaseMessages.getString(
+ JsonInputMeta.class, "JsonInputDialog.FieldsTable.Currency.Column"),
+ ColumnInfo.COLUMN_TYPE_TEXT,
+ false),
+ new ColumnInfo(
+ BaseMessages.getString(
+ JsonInputMeta.class, "JsonInputDialog.FieldsTable.Decimal.Column"),
+ ColumnInfo.COLUMN_TYPE_TEXT,
+ false),
+ new ColumnInfo(
+ BaseMessages.getString(
+ JsonInputMeta.class, "JsonInputDialog.FieldsTable.Group.Column"),
+ ColumnInfo.COLUMN_TYPE_TEXT,
+ false),
+ new ColumnInfo(
+ BaseMessages.getString(
+ JsonInputMeta.class, "JsonInputDialog.FieldsTable.TrimType.Column"),
+ ColumnInfo.COLUMN_TYPE_CCOMBO,
+ ValueMetaBase.trimTypeDesc,
+ true),
+ new ColumnInfo(
+ BaseMessages.getString(
+ JsonInputMeta.class, "JsonInputDialog.FieldsTable.Repeat.Column"),
+ ColumnInfo.COLUMN_TYPE_CCOMBO,
+ new String[] {
+ BaseMessages.getString(PKG, CONST_SYSTEM_COMBO_YES),
+ BaseMessages.getString(PKG, "System.Combo.No")
+ },
+ true),
+ };
+
+ colInfos[0].setUsingVariables(true);
+ colInfos[0].setToolTip(
+ BaseMessages.getString(
+ JsonInputMeta.class, "JsonInputDialog.FieldsTable.Name.Column.Tooltip"));
+ colInfos[1].setUsingVariables(true);
+ colInfos[1].setToolTip(
+ BaseMessages.getString(
+ JsonInputMeta.class, "JsonInputDialog.FieldsTable.Path.Column.Tooltip"));
+
+ wFields =
+ new TableView(
+ variables,
+ wFieldsComp,
+ SWT.FULL_SELECTION | SWT.MULTI,
+ colInfos,
+ FieldsRows,
+ lsMod,
+ props);
+ PropsUi.setLook(wFields);
+ FormData fdFields = new FormData();
+ fdFields.left = new FormAttachment(0, 0);
+ fdFields.top = new FormAttachment(0, 0);
+ fdFields.right = new FormAttachment(100, 0);
+ fdFields.bottom = new FormAttachment(wGet, -margin);
+ wFields.setLayoutData(fdFields);
+
+ FormData fdFieldsComp = new FormData();
+ fdFieldsComp.left = new FormAttachment(0, 0);
+ fdFieldsComp.top = new FormAttachment(0, 0);
+ fdFieldsComp.right = new FormAttachment(100, 0);
+ fdFieldsComp.bottom = new FormAttachment(100, 0);
+ wFieldsComp.setLayoutData(fdFieldsComp);
+
+ wFieldsComp.layout();
+ wFieldsTab.setControl(wFieldsComp);
+ }
+
+ private void getFromSnippet() {
+
+ EnterTextDialog getFromSnippetDialog =
+ new EnterTextDialog(
+ shell,
+ BaseMessages.getString(
+ JsonInputMeta.class, "JsonInputDialog.Button.SelectFieldsSnippet"),
+ BaseMessages.getString(
+ JsonInputMeta.class, "JsonInputDialog.GetFieldsFromSnippet.Message"),
+ "",
+ true);
+ String text = getFromSnippetDialog.open();
+
+ // if getFromSnippetDialog dialog is cancelled, the text will be null
+ if (text != null) {
+ refreshFields(new ByteArrayInputStream(text.getBytes()));
+ wFields.optimizeTableView();
+ }
+ }
+
+ private void addContentTab() {
+ // ////////////////////////
+ // START OF CONTENT TAB///
+ // /
+ CTabItem wContentTab = new CTabItem(wTabFolder, SWT.NONE);
+ wContentTab.setFont(GuiResource.getInstance().getFontDefault());
+ wContentTab.setText(BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.Content.Tab"));
+
+ FormLayout contentLayout = new FormLayout();
+ contentLayout.marginWidth = 3;
+ contentLayout.marginHeight = 3;
+
+ Composite wContentComp = new Composite(wTabFolder, SWT.NONE);
+ PropsUi.setLook(wContentComp);
+ wContentComp.setLayout(contentLayout);
+
+ // ///////////////////////////////
+ // START OF Conf Field GROUP //
+ // ///////////////////////////////
+
+ Group wConf = new Group(wContentComp, SWT.SHADOW_NONE);
+ PropsUi.setLook(wConf);
+ wConf.setText(BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.wConf.Label"));
+
+ FormLayout confgroupLayout = new FormLayout();
+ confgroupLayout.marginWidth = 10;
+ confgroupLayout.marginHeight = 10;
+ wConf.setLayout(confgroupLayout);
+
+ // Record path (JsonPath to array of records)
+ Label wlRecordPath = new Label(wConf, SWT.RIGHT);
+ wlRecordPath.setText(BaseMessages.getString(PKG, "JsonNormalizeInputDialog.RecordPath.Label"));
+ PropsUi.setLook(wlRecordPath);
+ FormData fdlRecordPath = new FormData();
+ fdlRecordPath.left = new FormAttachment(0, 0);
+ fdlRecordPath.top = new FormAttachment(0, margin);
+ fdlRecordPath.right = new FormAttachment(middle, -margin);
+ wlRecordPath.setLayoutData(fdlRecordPath);
+ wRecordPath = new TextVar(variables, wConf, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ PropsUi.setLook(wRecordPath);
+ wRecordPath.setToolTipText(
+ BaseMessages.getString(PKG, "JsonNormalizeInputDialog.RecordPath.Tooltip"));
+ FormData fdRecordPath = new FormData();
+ fdRecordPath.left = new FormAttachment(middle, 0);
+ fdRecordPath.top = new FormAttachment(wlRecordPath, 0, SWT.CENTER);
+ fdRecordPath.right = new FormAttachment(100, 0);
+ wRecordPath.setLayoutData(fdRecordPath);
+
+ Label wlFieldSeparator = new Label(wConf, SWT.RIGHT);
+ wlFieldSeparator.setText(
+ BaseMessages.getString(PKG, "JsonNormalizeInputDialog.FieldSeparator.Label"));
+ PropsUi.setLook(wlFieldSeparator);
+ FormData fdlFieldSeparator = new FormData();
+ fdlFieldSeparator.left = new FormAttachment(0, 0);
+ fdlFieldSeparator.top = new FormAttachment(wlRecordPath, margin);
+ fdlFieldSeparator.right = new FormAttachment(middle, -margin);
+ wlFieldSeparator.setLayoutData(fdlFieldSeparator);
+ wFieldSeparator = new TextVar(variables, wConf, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ PropsUi.setLook(wFieldSeparator);
+ wFieldSeparator.addModifyListener(lsMod);
+ FormData fdFieldSeparator = new FormData();
+ fdFieldSeparator.left = new FormAttachment(middle, 0);
+ fdFieldSeparator.top = new FormAttachment(wlFieldSeparator, 0, SWT.CENTER);
+ fdFieldSeparator.right = new FormAttachment(100, 0);
+ wFieldSeparator.setLayoutData(fdFieldSeparator);
+
+ Label wlMaxFlattenDepth = new Label(wConf, SWT.RIGHT);
+ wlMaxFlattenDepth.setText(
+ BaseMessages.getString(PKG, "JsonNormalizeInputDialog.MaxFlattenDepth.Label"));
+ PropsUi.setLook(wlMaxFlattenDepth);
+ FormData fdlMaxFlattenDepth = new FormData();
+ fdlMaxFlattenDepth.left = new FormAttachment(0, 0);
+ fdlMaxFlattenDepth.top = new FormAttachment(wlFieldSeparator, margin);
+ fdlMaxFlattenDepth.right = new FormAttachment(middle, -margin);
+ wlMaxFlattenDepth.setLayoutData(fdlMaxFlattenDepth);
+ wMaxFlattenDepth = new TextVar(variables, wConf, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ PropsUi.setLook(wMaxFlattenDepth);
+ wMaxFlattenDepth.addModifyListener(lsMod);
+ FormData fdMaxFlattenDepth = new FormData();
+ fdMaxFlattenDepth.left = new FormAttachment(middle, 0);
+ fdMaxFlattenDepth.top = new FormAttachment(wlMaxFlattenDepth, 0, SWT.CENTER);
+ fdMaxFlattenDepth.right = new FormAttachment(100, 0);
+ wMaxFlattenDepth.setLayoutData(fdMaxFlattenDepth);
+
+ Label wlArrayHandling = new Label(wConf, SWT.RIGHT);
+ wlArrayHandling.setText(
+ BaseMessages.getString(PKG, "JsonNormalizeInputDialog.ArrayHandling.Label"));
+ PropsUi.setLook(wlArrayHandling);
+ FormData fdlArrayHandling = new FormData();
+ fdlArrayHandling.left = new FormAttachment(0, 0);
+ fdlArrayHandling.top = new FormAttachment(wlMaxFlattenDepth, margin);
+ fdlArrayHandling.right = new FormAttachment(middle, -margin);
+ wlArrayHandling.setLayoutData(fdlArrayHandling);
+ wArrayHandling = new CCombo(wConf, SWT.BORDER | SWT.READ_ONLY);
+ PropsUi.setLook(wArrayHandling);
+ wArrayHandling.add(JsonNodeFlattener.CODE_ARRAY_STRINGIFY);
+ wArrayHandling.add(JsonNodeFlattener.CODE_ARRAY_SINGLE_ELEMENT);
+ wArrayHandling.add(JsonNodeFlattener.CODE_ARRAY_ERROR);
+ wArrayHandling.addModifyListener(lsMod);
+ FormData fdArrayHandling = new FormData();
+ fdArrayHandling.left = new FormAttachment(middle, 0);
+ fdArrayHandling.top = new FormAttachment(wlArrayHandling, 0, SWT.CENTER);
+ fdArrayHandling.right = new FormAttachment(100, 0);
+ wArrayHandling.setLayoutData(fdArrayHandling);
+
+ Label wlBeyondDepth = new Label(wConf, SWT.RIGHT);
+ wlBeyondDepth.setText(
+ BaseMessages.getString(PKG, "JsonNormalizeInputDialog.BeyondDepth.Label"));
+ PropsUi.setLook(wlBeyondDepth);
+ FormData fdlBeyondDepth = new FormData();
+ fdlBeyondDepth.left = new FormAttachment(0, 0);
+ fdlBeyondDepth.top = new FormAttachment(wlArrayHandling, margin);
+ fdlBeyondDepth.right = new FormAttachment(middle, -margin);
+ wlBeyondDepth.setLayoutData(fdlBeyondDepth);
+ wBeyondDepth = new CCombo(wConf, SWT.BORDER | SWT.READ_ONLY);
+ PropsUi.setLook(wBeyondDepth);
+ wBeyondDepth.add(JsonNodeFlattener.CODE_BEYOND_STRINGIFY);
+ wBeyondDepth.add(JsonNodeFlattener.CODE_BEYOND_OMIT);
+ wBeyondDepth.add(JsonNodeFlattener.CODE_BEYOND_ERROR);
+ wBeyondDepth.addModifyListener(lsMod);
+ FormData fdBeyondDepth = new FormData();
+ fdBeyondDepth.left = new FormAttachment(middle, 0);
+ fdBeyondDepth.top = new FormAttachment(wlBeyondDepth, 0, SWT.CENTER);
+ fdBeyondDepth.right = new FormAttachment(100, 0);
+ wBeyondDepth.setLayoutData(fdBeyondDepth);
+
+ // Ignore Empty File
+ // ignore empty files flag
+ Label wlIgnoreEmptyFile = new Label(wConf, SWT.RIGHT);
+ wlIgnoreEmptyFile.setText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.IgnoreEmptyFile.Label"));
+ PropsUi.setLook(wlIgnoreEmptyFile);
+ FormData fdlIgnoreEmptyFile = new FormData();
+ fdlIgnoreEmptyFile.left = new FormAttachment(0, 0);
+ fdlIgnoreEmptyFile.top = new FormAttachment(wlBeyondDepth, margin);
+ fdlIgnoreEmptyFile.right = new FormAttachment(middle, -margin);
+ wlIgnoreEmptyFile.setLayoutData(fdlIgnoreEmptyFile);
+ wIgnoreEmptyFile = new Button(wConf, SWT.CHECK);
+ PropsUi.setLook(wIgnoreEmptyFile);
+ wIgnoreEmptyFile.setToolTipText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.IgnoreEmptyFile.Tooltip"));
+ FormData fdIgnoreEmptyFile = new FormData();
+ fdIgnoreEmptyFile.left = new FormAttachment(middle, 0);
+ fdIgnoreEmptyFile.top = new FormAttachment(wlIgnoreEmptyFile, 0, SWT.CENTER);
+ wIgnoreEmptyFile.setLayoutData(fdIgnoreEmptyFile);
+
+ // do not fail if no files?
+ //
+ Label wlDoNotFailIfNoFile = new Label(wConf, SWT.RIGHT);
+ wlDoNotFailIfNoFile.setText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.doNotFailIfNoFile.Label"));
+ PropsUi.setLook(wlDoNotFailIfNoFile);
+ FormData fdldoNotFailIfNoFile = new FormData();
+ fdldoNotFailIfNoFile.left = new FormAttachment(0, 0);
+ fdldoNotFailIfNoFile.top = new FormAttachment(wlIgnoreEmptyFile, margin);
+ fdldoNotFailIfNoFile.right = new FormAttachment(middle, -margin);
+ wlDoNotFailIfNoFile.setLayoutData(fdldoNotFailIfNoFile);
+ wDoNotFailIfNoFile = new Button(wConf, SWT.CHECK);
+ PropsUi.setLook(wDoNotFailIfNoFile);
+ wDoNotFailIfNoFile.setToolTipText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.doNotFailIfNoFile.Tooltip"));
+ FormData fdDoNotFailIfNoFile = new FormData();
+ fdDoNotFailIfNoFile.left = new FormAttachment(middle, 0);
+ fdDoNotFailIfNoFile.top = new FormAttachment(wlDoNotFailIfNoFile, 0, SWT.CENTER);
+ wDoNotFailIfNoFile.setLayoutData(fdDoNotFailIfNoFile);
+
+ Label wlIgnoreMissingField = new Label(wConf, SWT.RIGHT);
+ wlIgnoreMissingField.setText(
+ BaseMessages.getString(PKG, "JsonNormalizeInputDialog.IgnoreMissingField.Label"));
+ PropsUi.setLook(wlIgnoreMissingField);
+ FormData fdlIgnoreMissingField = new FormData();
+ fdlIgnoreMissingField.left = new FormAttachment(0, 0);
+ fdlIgnoreMissingField.top = new FormAttachment(wlDoNotFailIfNoFile, margin);
+ fdlIgnoreMissingField.right = new FormAttachment(middle, -margin);
+ wlIgnoreMissingField.setLayoutData(fdlIgnoreMissingField);
+ wIgnoreMissingField = new Button(wConf, SWT.CHECK);
+ PropsUi.setLook(wIgnoreMissingField);
+ wIgnoreMissingField.addSelectionListener(
+ new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ input.setChanged();
+ }
+ });
+ wIgnoreMissingField.setToolTipText(
+ BaseMessages.getString(PKG, "JsonNormalizeInputDialog.IgnoreMissingField.Tooltip"));
+ FormData fdIgnoreMissingField = new FormData();
+ fdIgnoreMissingField.left = new FormAttachment(middle, 0);
+ fdIgnoreMissingField.top = new FormAttachment(wlIgnoreMissingField, 0, SWT.CENTER);
+ wIgnoreMissingField.setLayoutData(fdIgnoreMissingField);
+
+ wlLimit = new Label(wConf, SWT.RIGHT);
+ wlLimit.setText(BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.Limit.Label"));
+ PropsUi.setLook(wlLimit);
+ FormData fdlLimit = new FormData();
+ fdlLimit.left = new FormAttachment(0, 0);
+ fdlLimit.top = new FormAttachment(wlIgnoreMissingField, margin);
+ fdlLimit.right = new FormAttachment(middle, -margin);
+ wlLimit.setLayoutData(fdlLimit);
+ wLimit = new Text(wConf, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ PropsUi.setLook(wLimit);
+ wLimit.addModifyListener(lsMod);
+ FormData fdLimit = new FormData();
+ fdLimit.left = new FormAttachment(middle, 0);
+ fdLimit.top = new FormAttachment(wlIgnoreMissingField, margin);
+ fdLimit.right = new FormAttachment(100, 0);
+ wLimit.setLayoutData(fdLimit);
+
+ FormData fdConf = new FormData();
+ fdConf.left = new FormAttachment(0, margin);
+ fdConf.top = new FormAttachment(0, margin);
+ fdConf.right = new FormAttachment(100, -margin);
+ wConf.setLayoutData(fdConf);
+
+ // ///////////////////////////////////////////////////////////
+ // / END OF Conf Field GROUP
+ // ///////////////////////////////////////////////////////////
+
+ // ///////////////////////////////
+ // START OF Additional Fields GROUP //
+ // ///////////////////////////////
+
+ Group wAdditionalFields = new Group(wContentComp, SWT.SHADOW_NONE);
+ PropsUi.setLook(wAdditionalFields);
+ wAdditionalFields.setText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.wAdditionalFields.Label"));
+
+ FormLayout additionalFieldsgroupLayout = new FormLayout();
+ additionalFieldsgroupLayout.marginWidth = 10;
+ additionalFieldsgroupLayout.marginHeight = 10;
+ wAdditionalFields.setLayout(additionalFieldsgroupLayout);
+
+ wlInclFilename = new Label(wAdditionalFields, SWT.RIGHT);
+ wlInclFilename.setText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.InclFilename.Label"));
+ PropsUi.setLook(wlInclFilename);
+ FormData fdlInclFilename = new FormData();
+ fdlInclFilename.left = new FormAttachment(0, 0);
+ fdlInclFilename.top = new FormAttachment(wConf, 4 * margin);
+ fdlInclFilename.right = new FormAttachment(middle, -margin);
+ wlInclFilename.setLayoutData(fdlInclFilename);
+ wInclFilename = new Button(wAdditionalFields, SWT.CHECK);
+ PropsUi.setLook(wInclFilename);
+ wInclFilename.setToolTipText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.InclFilename.Tooltip"));
+ FormData fdInclFilename = new FormData();
+ fdInclFilename.left = new FormAttachment(middle, 0);
+ fdInclFilename.top = new FormAttachment(wlInclFilename, 0, SWT.CENTER);
+ wInclFilename.setLayoutData(fdInclFilename);
+
+ wlInclFilenameField = new Label(wAdditionalFields, SWT.LEFT);
+ wlInclFilenameField.setText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.InclFilenameField.Label"));
+ PropsUi.setLook(wlInclFilenameField);
+ FormData fdlInclFilenameField = new FormData();
+ fdlInclFilenameField.left = new FormAttachment(wInclFilename, margin);
+ fdlInclFilenameField.top = new FormAttachment(wLimit, 4 * margin);
+ wlInclFilenameField.setLayoutData(fdlInclFilenameField);
+ wInclFilenameField =
+ new TextVar(variables, wAdditionalFields, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ PropsUi.setLook(wInclFilenameField);
+ wInclFilenameField.addModifyListener(lsMod);
+ FormData fdInclFilenameField = new FormData();
+ fdInclFilenameField.left = new FormAttachment(wlInclFilenameField, margin);
+ fdInclFilenameField.top = new FormAttachment(wLimit, 4 * margin);
+ fdInclFilenameField.right = new FormAttachment(100, 0);
+ wInclFilenameField.setLayoutData(fdInclFilenameField);
+
+ Label wlInclRownum = new Label(wAdditionalFields, SWT.RIGHT);
+ wlInclRownum.setText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.InclRownum.Label"));
+ PropsUi.setLook(wlInclRownum);
+ FormData fdlInclRownum = new FormData();
+ fdlInclRownum.left = new FormAttachment(0, 0);
+ fdlInclRownum.top = new FormAttachment(wInclFilenameField, margin);
+ fdlInclRownum.right = new FormAttachment(middle, -margin);
+ wlInclRownum.setLayoutData(fdlInclRownum);
+ wInclRownum = new Button(wAdditionalFields, SWT.CHECK);
+ PropsUi.setLook(wInclRownum);
+ wInclRownum.setToolTipText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.InclRownum.Tooltip"));
+ FormData fdRownum = new FormData();
+ fdRownum.left = new FormAttachment(middle, 0);
+ fdRownum.top = new FormAttachment(wlInclRownum, 0, SWT.CENTER);
+ wInclRownum.setLayoutData(fdRownum);
+
+ wlInclRownumField = new Label(wAdditionalFields, SWT.RIGHT);
+ wlInclRownumField.setText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.InclRownumField.Label"));
+ PropsUi.setLook(wlInclRownumField);
+ FormData fdlInclRownumField = new FormData();
+ fdlInclRownumField.left = new FormAttachment(wInclRownum, margin);
+ fdlInclRownumField.top = new FormAttachment(wInclFilenameField, margin);
+ wlInclRownumField.setLayoutData(fdlInclRownumField);
+ wInclRownumField =
+ new TextVar(variables, wAdditionalFields, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ PropsUi.setLook(wInclRownumField);
+ wInclRownumField.addModifyListener(lsMod);
+ FormData fdInclRownumField = new FormData();
+ fdInclRownumField.left = new FormAttachment(wlInclRownumField, margin);
+ fdInclRownumField.top = new FormAttachment(wInclFilenameField, margin);
+ fdInclRownumField.right = new FormAttachment(100, 0);
+ wInclRownumField.setLayoutData(fdInclRownumField);
+
+ FormData fdAdditionalFields = new FormData();
+ fdAdditionalFields.left = new FormAttachment(0, margin);
+ fdAdditionalFields.top = new FormAttachment(wConf, margin);
+ fdAdditionalFields.right = new FormAttachment(100, -margin);
+ wAdditionalFields.setLayoutData(fdAdditionalFields);
+
+ // ///////////////////////////////////////////////////////////
+ // / END OF Additional Fields GROUP
+ // ///////////////////////////////////////////////////////////
+
+ // ///////////////////////////////
+ // START OF AddFileResult GROUP //
+ // ///////////////////////////////
+
+ Group wAddFileResult = new Group(wContentComp, SWT.SHADOW_NONE);
+ PropsUi.setLook(wAddFileResult);
+ wAddFileResult.setText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.wAddFileResult.Label"));
+
+ FormLayout addFileResultgroupLayout = new FormLayout();
+ addFileResultgroupLayout.marginWidth = 10;
+ addFileResultgroupLayout.marginHeight = 10;
+ wAddFileResult.setLayout(addFileResultgroupLayout);
+
+ wlAddResult = new Label(wAddFileResult, SWT.RIGHT);
+ wlAddResult.setText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.AddResult.Label"));
+ PropsUi.setLook(wlAddResult);
+ FormData fdlAddResult = new FormData();
+ fdlAddResult.left = new FormAttachment(0, 0);
+ fdlAddResult.top = new FormAttachment(wAdditionalFields, margin);
+ fdlAddResult.right = new FormAttachment(middle, -margin);
+ wlAddResult.setLayoutData(fdlAddResult);
+ wAddResult = new Button(wAddFileResult, SWT.CHECK);
+ PropsUi.setLook(wAddResult);
+ wAddResult.setToolTipText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.AddResult.Tooltip"));
+ FormData fdAddResult = new FormData();
+ fdAddResult.left = new FormAttachment(middle, 0);
+ fdAddResult.top = new FormAttachment(wAdditionalFields, margin);
+ wAddResult.setLayoutData(fdAddResult);
+
+ FormData fdAddFileResult = new FormData();
+ fdAddFileResult.left = new FormAttachment(0, margin);
+ fdAddFileResult.top = new FormAttachment(wAdditionalFields, margin);
+ fdAddFileResult.right = new FormAttachment(100, -margin);
+ wAddFileResult.setLayoutData(fdAddFileResult);
+
+ // ///////////////////////////////////////////////////////////
+ // / END OF AddFileResult GROUP
+ // ///////////////////////////////////////////////////////////
+
+ FormData fdContentComp = new FormData();
+ fdContentComp.left = new FormAttachment(0, 0);
+ fdContentComp.top = new FormAttachment(0, 0);
+ fdContentComp.right = new FormAttachment(100, 0);
+ fdContentComp.bottom = new FormAttachment(100, 0);
+ wContentComp.setLayoutData(fdContentComp);
+
+ wContentComp.layout();
+ wContentTab.setControl(wContentComp);
+
+ // ///////////////////////////////////////////////////////////
+ // / END OF CONTENT TAB
+ // ///////////////////////////////////////////////////////////
+ }
+
+ private void addFileTab() {
+ // ////////////////////////
+ // START OF FILE TAB ///
+ // ////////////////////////
+ CTabItem wFileTab = new CTabItem(wTabFolder, SWT.NONE);
+ wFileTab.setFont(GuiResource.getInstance().getFontDefault());
+ wFileTab.setText(BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.File.Tab"));
+
+ Composite wFileComp = new Composite(wTabFolder, SWT.NONE);
+ PropsUi.setLook(wFileComp);
+
+ FormLayout fileLayout = new FormLayout();
+ fileLayout.marginWidth = PropsUi.getFormMargin();
+ fileLayout.marginHeight = PropsUi.getFormMargin();
+ wFileComp.setLayout(fileLayout);
+
+ // ///////////////////////////////
+ // START OF Output Field GROUP //
+ // ///////////////////////////////
+
+ Group wOutputField = new Group(wFileComp, SWT.SHADOW_NONE);
+ PropsUi.setLook(wOutputField);
+ wOutputField.setText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.wOutputField.Label"));
+
+ FormLayout outputFieldGroupLayout = new FormLayout();
+ outputFieldGroupLayout.marginWidth = 10;
+ outputFieldGroupLayout.marginHeight = 10;
+ wOutputField.setLayout(outputFieldGroupLayout);
+
+ // Is source string defined in a Field
+ Label wlSourceStreamField = new Label(wOutputField, SWT.RIGHT);
+ wlSourceStreamField.setText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.wlSourceStreamField.Label"));
+ PropsUi.setLook(wlSourceStreamField);
+ FormData fdlSourceStreamField = new FormData();
+ fdlSourceStreamField.left = new FormAttachment(0, 0);
+ fdlSourceStreamField.top = new FormAttachment(0, margin);
+ fdlSourceStreamField.right = new FormAttachment(middle, -margin);
+ wlSourceStreamField.setLayoutData(fdlSourceStreamField);
+ wSourceStreamField = new Button(wOutputField, SWT.CHECK);
+ PropsUi.setLook(wSourceStreamField);
+ wSourceStreamField.setToolTipText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.wSourceStreamField.Tooltip"));
+ FormData fdSourceStreamField = new FormData();
+ fdSourceStreamField.left = new FormAttachment(wlSourceStreamField, margin);
+ fdSourceStreamField.top = new FormAttachment(wlSourceStreamField, 0, SWT.CENTER);
+ wSourceStreamField.setLayoutData(fdSourceStreamField);
+ SelectionAdapter sourceSelectAdapter =
+ new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ activeStreamField();
+ input.setChanged();
+ }
+ };
+ wSourceStreamField.addSelectionListener(sourceSelectAdapter);
+
+ // If source string defined in a Field
+ wlSourceField = new Label(wOutputField, SWT.RIGHT);
+ wlSourceField.setText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.wlSourceField.Label"));
+ PropsUi.setLook(wlSourceField);
+ FormData fdlFieldValue = new FormData();
+ fdlFieldValue.left = new FormAttachment(0, 0);
+ fdlFieldValue.top = new FormAttachment(wlSourceStreamField, margin);
+ fdlFieldValue.right = new FormAttachment(middle, -margin);
+ wlSourceField.setLayoutData(fdlFieldValue);
+
+ wFieldValue = new CCombo(wOutputField, SWT.BORDER | SWT.READ_ONLY);
+ wFieldValue.setEditable(true);
+ PropsUi.setLook(wFieldValue);
+ wFieldValue.addModifyListener(lsMod);
+ FormData fdFieldValue = new FormData();
+ fdFieldValue.left = new FormAttachment(wlSourceField, margin);
+ fdFieldValue.top = new FormAttachment(wlSourceField, 0, SWT.CENTER);
+ fdFieldValue.right = new FormAttachment(100, -margin);
+ wFieldValue.setLayoutData(fdFieldValue);
+
+ // Trigger event when 'Source is from a previous transform' is checked.
+ setSourceStreamField(false);
+
+ FormData fdOutputField = new FormData();
+ fdOutputField.left = new FormAttachment(0, margin);
+ fdOutputField.top = new FormAttachment(wFilenameList, margin);
+ fdOutputField.right = new FormAttachment(100, -margin);
+ wOutputField.setLayoutData(fdOutputField);
+
+ // Is source is a file?
+ wlSourceIsAFile = new Label(wOutputField, SWT.RIGHT);
+ wlSourceIsAFile.setText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.SourceIsAFile.Label"));
+ PropsUi.setLook(wlSourceIsAFile);
+ FormData fdlSourceIsAFile = new FormData();
+ fdlSourceIsAFile.left = new FormAttachment(0, 0);
+ fdlSourceIsAFile.top = new FormAttachment(wFieldValue, margin);
+ fdlSourceIsAFile.right = new FormAttachment(middle, -margin);
+ wlSourceIsAFile.setLayoutData(fdlSourceIsAFile);
+ wSourceIsAFile = new Button(wOutputField, SWT.CHECK);
+ PropsUi.setLook(wSourceIsAFile);
+ wSourceIsAFile.setToolTipText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.SourceIsAFile.Tooltip"));
+ FormData fdSourceIsAFile = new FormData();
+ fdSourceIsAFile.left = new FormAttachment(wlSourceIsAFile, margin);
+ fdSourceIsAFile.top = new FormAttachment(wlSourceIsAFile, 0, SWT.CENTER);
+ wSourceIsAFile.setLayoutData(fdSourceIsAFile);
+ SelectionAdapter lssourceisafile =
+ new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ if (wSourceIsAFile.getSelection()) {
+ wReadUrl.setSelection(false);
+ }
+ input.setChanged();
+ }
+ };
+ wSourceIsAFile.addSelectionListener(lssourceisafile);
+
+ // read url as source ?
+ wlReadUrl = new Label(wOutputField, SWT.RIGHT);
+ wlReadUrl.setText(BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.readUrl.Label"));
+ PropsUi.setLook(wlReadUrl);
+ FormData fdlreadUrl = new FormData();
+ fdlreadUrl.left = new FormAttachment(0, 0);
+ fdlreadUrl.top = new FormAttachment(wlSourceIsAFile, margin);
+ fdlreadUrl.right = new FormAttachment(middle, -margin);
+ wlReadUrl.setLayoutData(fdlreadUrl);
+ wReadUrl = new Button(wOutputField, SWT.CHECK);
+ PropsUi.setLook(wReadUrl);
+ wReadUrl.setToolTipText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.readUrl.Tooltip"));
+ FormData fdreadUrl = new FormData();
+ fdreadUrl.left = new FormAttachment(wlReadUrl, margin);
+ fdreadUrl.top = new FormAttachment(wlReadUrl, 0, SWT.CENTER);
+ wReadUrl.setLayoutData(fdreadUrl);
+ SelectionAdapter lsreadurl =
+ new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ if (wReadUrl.getSelection()) {
+ wSourceIsAFile.setSelection(false);
+ }
+ input.setChanged();
+ }
+ };
+ wReadUrl.addSelectionListener(lsreadurl);
+
+ // Remove source field from output stream?
+ wlRemoveSourceField = new Label(wOutputField, SWT.RIGHT);
+ wlRemoveSourceField.setText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.removeSourceField.Label"));
+ PropsUi.setLook(wlRemoveSourceField);
+ FormData fdlremoveSourceField = new FormData();
+ fdlremoveSourceField.left = new FormAttachment(0, 0);
+ fdlremoveSourceField.top = new FormAttachment(wlReadUrl, margin);
+ fdlremoveSourceField.right = new FormAttachment(middle, -margin);
+ wlRemoveSourceField.setLayoutData(fdlremoveSourceField);
+ wRemoveSourceField = new Button(wOutputField, SWT.CHECK);
+ PropsUi.setLook(wRemoveSourceField);
+ FormData fdremoveSourceField = new FormData();
+ fdremoveSourceField.left = new FormAttachment(wlRemoveSourceField, margin);
+ fdremoveSourceField.top = new FormAttachment(wlRemoveSourceField, 0, SWT.CENTER);
+ wRemoveSourceField.setLayoutData(fdremoveSourceField);
+ SelectionAdapter removeSourceFieldAdapter =
+ new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent selectionEvent) {
+ input.setChanged();
+ }
+ };
+ wRemoveSourceField.addSelectionListener(removeSourceFieldAdapter);
+
+ // ///////////////////////////////////////////////////////////
+ // / END OF Output Field GROUP
+ // ///////////////////////////////////////////////////////////
+
+ // Filename line
+ wlFilename = new Label(wFileComp, SWT.RIGHT);
+ wlFilename.setText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.Filename.Label"));
+ PropsUi.setLook(wlFilename);
+ FormData fdlFilename = new FormData();
+ fdlFilename.left = new FormAttachment(0, 0);
+ fdlFilename.top = new FormAttachment(wOutputField, margin);
+ fdlFilename.right = new FormAttachment(middle, -margin);
+ wlFilename.setLayoutData(fdlFilename);
+
+ wbbFilename = new Button(wFileComp, SWT.PUSH | SWT.CENTER);
+ PropsUi.setLook(wbbFilename);
+ wbbFilename.setText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.FilenameBrowse.Button"));
+ wbbFilename.setToolTipText(
+ BaseMessages.getString(PKG, "System.Tooltip.BrowseForFileOrDirAndAdd"));
+ FormData fdbFilename = new FormData();
+ fdbFilename.right = new FormAttachment(100, 0);
+ fdbFilename.top = new FormAttachment(wlFilename, 0, SWT.CENTER);
+ wbbFilename.setLayoutData(fdbFilename);
+
+ wbaFilename = new Button(wFileComp, SWT.PUSH | SWT.CENTER);
+ PropsUi.setLook(wbaFilename);
+ wbaFilename.setText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.FilenameAdd.Button"));
+ wbaFilename.setToolTipText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.FilenameAdd.Tooltip"));
+ FormData fdbaFilename = new FormData();
+ fdbaFilename.right = new FormAttachment(wbbFilename, -margin);
+ fdbaFilename.top = new FormAttachment(wlFilename, 0, SWT.CENTER);
+ wbaFilename.setLayoutData(fdbaFilename);
+
+ wFilename = new TextVar(variables, wFileComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ PropsUi.setLook(wFilename);
+ wFilename.addModifyListener(lsMod);
+ FormData fdFilename = new FormData();
+ fdFilename.left = new FormAttachment(middle, 0);
+ fdFilename.right = new FormAttachment(wbaFilename, -margin);
+ fdFilename.top = new FormAttachment(wlFilename, 0, SWT.CENTER);
+ wFilename.setLayoutData(fdFilename);
+
+ wlFilemask = new Label(wFileComp, SWT.RIGHT);
+ wlFilemask.setText(BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.RegExp.Label"));
+ PropsUi.setLook(wlFilemask);
+ FormData fdlFilemask = new FormData();
+ fdlFilemask.left = new FormAttachment(0, 0);
+ fdlFilemask.top = new FormAttachment(wFilename, margin);
+ fdlFilemask.right = new FormAttachment(middle, -margin);
+ wlFilemask.setLayoutData(fdlFilemask);
+ wFilemask = new TextVar(variables, wFileComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ PropsUi.setLook(wFilemask);
+ wFilemask.addModifyListener(lsMod);
+ FormData fdFilemask = new FormData();
+ fdFilemask.left = new FormAttachment(middle, 0);
+ fdFilemask.top = new FormAttachment(wlFilemask, 0, SWT.CENTER);
+ fdFilemask.right = new FormAttachment(wFilename, 0, SWT.RIGHT);
+ wFilemask.setLayoutData(fdFilemask);
+
+ wlExcludeFilemask = new Label(wFileComp, SWT.RIGHT);
+ wlExcludeFilemask.setText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.ExcludeFilemask.Label"));
+ PropsUi.setLook(wlExcludeFilemask);
+ FormData fdlExcludeFilemask = new FormData();
+ fdlExcludeFilemask.left = new FormAttachment(0, 0);
+ fdlExcludeFilemask.top = new FormAttachment(wFilemask, margin);
+ fdlExcludeFilemask.right = new FormAttachment(middle, -margin);
+ wlExcludeFilemask.setLayoutData(fdlExcludeFilemask);
+ wExcludeFilemask = new TextVar(variables, wFileComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ PropsUi.setLook(wExcludeFilemask);
+ wExcludeFilemask.addModifyListener(lsMod);
+ FormData fdExcludeFilemask = new FormData();
+ fdExcludeFilemask.left = new FormAttachment(middle, 0);
+ fdExcludeFilemask.top = new FormAttachment(wFilemask, margin);
+ fdExcludeFilemask.right = new FormAttachment(wFilename, 0, SWT.RIGHT);
+ wExcludeFilemask.setLayoutData(fdExcludeFilemask);
+
+ // Filename list line
+ wlFilenameList = new Label(wFileComp, SWT.RIGHT);
+ wlFilenameList.setText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.FilenameList.Label"));
+ PropsUi.setLook(wlFilenameList);
+ FormData fdlFilenameList = new FormData();
+ fdlFilenameList.left = new FormAttachment(0, 0);
+ fdlFilenameList.top = new FormAttachment(wExcludeFilemask, margin);
+ fdlFilenameList.right = new FormAttachment(middle, -margin);
+ wlFilenameList.setLayoutData(fdlFilenameList);
+
+ // Buttons to the right of the screen...
+ wbdFilename = new Button(wFileComp, SWT.PUSH | SWT.CENTER);
+ PropsUi.setLook(wbdFilename);
+ wbdFilename.setText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.FilenameRemove.Button"));
+ wbdFilename.setToolTipText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.FilenameRemove.Tooltip"));
+ FormData fdbdFilename = new FormData();
+ fdbdFilename.right = new FormAttachment(100, 0);
+ fdbdFilename.top = new FormAttachment(wlFilenameList, 0, SWT.TOP);
+ wbdFilename.setLayoutData(fdbdFilename);
+
+ wbeFilename = new Button(wFileComp, SWT.PUSH | SWT.CENTER);
+ PropsUi.setLook(wbeFilename);
+ wbeFilename.setText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.FilenameEdit.Button"));
+ wbeFilename.setToolTipText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.FilenameEdit.Tooltip"));
+ FormData fdbeFilename = new FormData();
+ fdbeFilename.right = new FormAttachment(100, 0);
+ fdbeFilename.left = new FormAttachment(wbdFilename, 0, SWT.LEFT);
+ fdbeFilename.top = new FormAttachment(wbdFilename, margin);
+ wbeFilename.setLayoutData(fdbeFilename);
+
+ wbShowFiles = new Button(wFileComp, SWT.PUSH | SWT.CENTER);
+ PropsUi.setLook(wbShowFiles);
+ wbShowFiles.setText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.ShowFiles.Button"));
+ FormData fdbShowFiles = new FormData();
+ fdbShowFiles.left = new FormAttachment(middle, 0);
+ fdbShowFiles.bottom = new FormAttachment(100, 0);
+ wbShowFiles.setLayoutData(fdbShowFiles);
+
+ ColumnInfo[] colinfo = new ColumnInfo[5];
+ colinfo[0] =
+ new ColumnInfo(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.Files.Filename.Column"),
+ ColumnInfo.COLUMN_TYPE_TEXT,
+ false);
+ colinfo[1] =
+ new ColumnInfo(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.Files.Wildcard.Column"),
+ ColumnInfo.COLUMN_TYPE_TEXT,
+ false);
+ colinfo[2] =
+ new ColumnInfo(
+ BaseMessages.getString(
+ JsonInputMeta.class, "JsonInputDialog.Files.ExcludeWildcard.Column"),
+ ColumnInfo.COLUMN_TYPE_TEXT,
+ false);
+
+ colinfo[0].setUsingVariables(true);
+ colinfo[1].setUsingVariables(true);
+ colinfo[1].setToolTip(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.Files.Wildcard.Tooltip"));
+ colinfo[2].setUsingVariables(true);
+ colinfo[2].setToolTip(
+ BaseMessages.getString(
+ JsonInputMeta.class, "JsonInputDialog.Files.ExcludeWildcard.Tooltip"));
+ colinfo[3] =
+ new ColumnInfo(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.Required.Column"),
+ ColumnInfo.COLUMN_TYPE_CCOMBO,
+ JsonNormalizeInputMeta.RequiredFilesDesc);
+ colinfo[3].setToolTip(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.Required.Tooltip"));
+ colinfo[4] =
+ new ColumnInfo(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.IncludeSubDirs.Column"),
+ ColumnInfo.COLUMN_TYPE_CCOMBO,
+ JsonNormalizeInputMeta.RequiredFilesDesc);
+ colinfo[4].setToolTip(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.IncludeSubDirs.Tooltip"));
+
+ wFilenameList =
+ new TableView(
+ variables,
+ wFileComp,
+ SWT.FULL_SELECTION | SWT.SINGLE | SWT.BORDER,
+ colinfo,
+ 2,
+ lsMod,
+ props);
+ PropsUi.setLook(wFilenameList);
+ FormData fdFilenameList = new FormData();
+ fdFilenameList.left = new FormAttachment(middle, 0);
+ fdFilenameList.right = new FormAttachment(wbdFilename, -margin);
+ fdFilenameList.top = new FormAttachment(wExcludeFilemask, margin);
+ fdFilenameList.bottom = new FormAttachment(wbShowFiles, -margin);
+ wFilenameList.setLayoutData(fdFilenameList);
+
+ FormData fdFileComp = new FormData();
+ fdFileComp.left = new FormAttachment(0, 0);
+ fdFileComp.top = new FormAttachment(0, 0);
+ fdFileComp.right = new FormAttachment(100, 0);
+ fdFileComp.bottom = new FormAttachment(100, 0);
+ wFileComp.setLayoutData(fdFileComp);
+
+ wFileComp.layout();
+ wFileTab.setControl(wFileComp);
+
+ // ///////////////////////////////////////////////////////////
+ // / END OF FILE TAB
+ // ///////////////////////////////////////////////////////////
+ }
+
+ private void setSourceStreamField(boolean isShowErrorDialog) {
+ try {
+ String value = wFieldValue.getText();
+ wFieldValue.removeAll();
+
+ IRowMeta r = pipelineMeta.getPrevTransformFields(variables, transformName);
+ if (r != null) {
+ wFieldValue.setItems(r.getFieldNames());
+ }
+ if (value != null) {
+ wFieldValue.setText(value);
+ }
+ } catch (HopException ke) {
+ if (!isShowErrorDialog) {
+ return;
+ }
+
+ new ErrorDialog(
+ shell,
+ BaseMessages.getString(
+ JsonInputMeta.class, "JsonInputDialog.FailedToGetFields.DialogTitle"),
+ BaseMessages.getString(
+ JsonInputMeta.class, "JsonInputDialog.FailedToGetFields.DialogMessage"),
+ ke);
+ }
+ }
+
+ private void activeStreamField() {
+ wlSourceField.setEnabled(wSourceStreamField.getSelection());
+ wFieldValue.setEnabled(wSourceStreamField.getSelection());
+ wlSourceIsAFile.setEnabled(wSourceStreamField.getSelection());
+ wSourceIsAFile.setEnabled(wSourceStreamField.getSelection());
+ wlReadUrl.setEnabled(wSourceStreamField.getSelection());
+ wReadUrl.setEnabled(wSourceStreamField.getSelection());
+ wlRemoveSourceField.setEnabled(wSourceStreamField.getSelection());
+ wRemoveSourceField.setEnabled(wSourceStreamField.getSelection());
+
+ wlFilename.setEnabled(!wSourceStreamField.getSelection());
+ wbbFilename.setEnabled(!wSourceStreamField.getSelection());
+ wbaFilename.setEnabled(!wSourceStreamField.getSelection());
+ wFilename.setEnabled(!wSourceStreamField.getSelection());
+ wlExcludeFilemask.setEnabled(!wSourceStreamField.getSelection());
+ wExcludeFilemask.setEnabled(!wSourceStreamField.getSelection());
+ wlFilemask.setEnabled(!wSourceStreamField.getSelection());
+ wFilemask.setEnabled(!wSourceStreamField.getSelection());
+ wlFilenameList.setEnabled(!wSourceStreamField.getSelection());
+ wbdFilename.setEnabled(!wSourceStreamField.getSelection());
+ wbeFilename.setEnabled(!wSourceStreamField.getSelection());
+ wbShowFiles.setEnabled(!wSourceStreamField.getSelection());
+ wlFilenameList.setEnabled(!wSourceStreamField.getSelection());
+
+ wFilenameList.setEnabled(!wSourceStreamField.getSelection());
+ setCompositeEnabled(wFilenameList, !wSourceStreamField.getSelection());
+
+ wInclFilename.setEnabled(!wSourceStreamField.getSelection());
+ wlInclFilename.setEnabled(!wSourceStreamField.getSelection());
+
+ if (wSourceStreamField.getSelection()) {
+ wInclFilename.setSelection(false);
+ wlInclFilenameField.setEnabled(false);
+ wInclFilenameField.setEnabled(false);
+ } else {
+ wlInclFilenameField.setEnabled(wInclFilename.getSelection());
+ wInclFilenameField.setEnabled(wInclFilename.getSelection());
+ }
+
+ wAddResult.setEnabled(!wSourceStreamField.getSelection());
+ wlAddResult.setEnabled(!wSourceStreamField.getSelection());
+ wLimit.setEnabled(!wSourceStreamField.getSelection());
+ wlLimit.setEnabled(!wSourceStreamField.getSelection());
+ wPreview.setEnabled(!wSourceStreamField.getSelection());
+ }
+
+ private void setCompositeEnabled(Composite comp, boolean enabled) {
+ comp.setEnabled(enabled);
+ for (Control child : comp.getChildren()) {
+ child.setEnabled(enabled);
+ }
+ }
+
+ public void setIncludeFilename() {
+ wlInclFilenameField.setEnabled(wInclFilename.getSelection());
+ wInclFilenameField.setEnabled(wInclFilename.getSelection());
+ }
+
+ public void setIncludeRownum() {
+ wlInclRownumField.setEnabled(wInclRownum.getSelection());
+ wInclRownumField.setEnabled(wInclRownum.getSelection());
+ }
+
+ /**
+ * Read the data from the TextFileInputMeta object and show it in this dialog.
+ *
+ * @param in The TextFileInputMeta object to obtain the data from.
+ */
+ public void getData(JsonNormalizeInputMeta in) {
+ wFilenameList.removeAll();
+ for (int i = 0; i < in.getFileInput().getInputFiles().size(); i++) {
+ InputFile inputFile = in.getFileInput().getInputFiles().get(i);
+ wFilenameList.add(
+ inputFile.getFileName(),
+ inputFile.getFileMask(),
+ inputFile.getExcludeFileMask(),
+ inputFile.getFileRequiredDesc(),
+ inputFile.getIncludeSubFoldersDesc());
+ }
+ wFilenameList.optimizeTableView();
+
+ wInclFilename.setSelection(in.includeFilename());
+ wInclRownum.setSelection(in.includeRowNumber());
+ wAddResult.setSelection(in.addResultFile());
+ wReadUrl.setSelection(in.isReadUrl());
+ wIgnoreEmptyFile.setSelection(in.isIgnoringEmptyFile());
+ wDoNotFailIfNoFile.setSelection(in.isDoNotFailIfNoFile());
+ wRecordPath.setText(Const.NVL(in.getRecordPath(), "$"));
+ wFieldSeparator.setText(Const.NVL(in.getFieldSeparator(), "."));
+ wMaxFlattenDepth.setText("" + in.getMaxFlattenDepth());
+ wArrayHandling.setText(
+ Const.NVL(in.getArrayHandling(), JsonNodeFlattener.CODE_ARRAY_STRINGIFY));
+ wBeyondDepth.setText(
+ Const.NVL(in.getBeyondDepthBehavior(), JsonNodeFlattener.CODE_BEYOND_STRINGIFY));
+ wIgnoreMissingField.setSelection(in.isIgnoreMissingField());
+ wRemoveSourceField.setSelection(in.isRemoveSourceField());
+ wSourceStreamField.setSelection(in.isInFields());
+ wSourceIsAFile.setSelection(in.getIsAFile());
+
+ if (in.getFieldValue() != null) {
+ wFieldValue.setText(in.getFieldValue());
+ }
+
+ wInclFilenameField.setText(Const.NVL(in.getFilenameField(), ""));
+ wInclRownumField.setText(Const.NVL(in.getRowNumberField(), ""));
+ wLimit.setText("" + in.getRowLimit());
+
+ for (int i = 0; i < in.getInputFields().size(); i++) {
+ JsonInputField field = in.getInputFields().get(i);
+ TableItem item = wFields.table.getItem(i);
+ String name = field.getName();
+ String xpath = field.getPath();
+ String type = field.getTypeDesc();
+ String format = field.getFormat();
+ String length = "" + field.getLength();
+ String prec = "" + field.getPrecision();
+ String curr = field.getCurrencySymbol();
+ String group = field.getGroupSymbol();
+ String decim = field.getDecimalSymbol();
+ String trim = field.getTrimTypeDesc();
+ String rep =
+ field.isRepeated()
+ ? BaseMessages.getString(PKG, CONST_SYSTEM_COMBO_YES)
+ : BaseMessages.getString(PKG, "System.Combo.No");
+
+ item.setText(1, Const.NVL(name, ""));
+ item.setText(2, Const.NVL(xpath, ""));
+ item.setText(3, Const.NVL(type, ""));
+ item.setText(4, Const.NVL(format, ""));
+ if (!"-1".equals(length)) {
+ item.setText(5, length);
+ }
+ if (!"-1".equals(prec)) {
+ item.setText(6, Const.NVL(prec, ""));
+ }
+ item.setText(7, Const.NVL(curr, ""));
+ item.setText(8, Const.NVL(decim, ""));
+ item.setText(9, Const.NVL(group, ""));
+ item.setText(10, Const.NVL(trim, ""));
+ item.setText(11, Const.NVL(rep, ""));
+ }
+
+ // Open the JSON input dialog and try to fetch the fields from the previous component.
+ setSourceStreamField(true);
+
+ wFields.optimizeTableView();
+
+ wShortFileFieldName.setText(Const.NVL(in.getShortFileNameField(), ""));
+ wPathFieldName.setText(Const.NVL(in.getPathField(), ""));
+ wIsHiddenName.setText(Const.NVL(in.isHiddenField(), ""));
+ wLastModificationTimeName.setText(Const.NVL(in.getLastModificationDateField(), ""));
+ wUriName.setText(Const.NVL(in.getUriField(), ""));
+ wRootUriName.setText(Const.NVL(in.getRootUriField(), ""));
+ wExtensionFieldName.setText(Const.NVL(in.getExtensionField(), ""));
+ wSizeFieldName.setText(Const.NVL(in.getSizeField(), ""));
+ }
+
+ private void cancel() {
+ transformName = null;
+ input.setChanged(changed);
+ dispose();
+ }
+
+ private void ok() {
+ getInfo(input);
+ dispose();
+ }
+
+ /** dialog -> meta */
+ private void getInfo(JsonNormalizeInputMeta in) {
+ transformName = wTransformName.getText(); // return value
+
+ in.setRowLimit(Const.toLong(wLimit.getText(), 0L));
+ in.setFilenameField(wInclFilenameField.getText());
+ in.setRowNumberField(wInclRownumField.getText());
+ in.setAddResultFile(wAddResult.getSelection());
+ in.setIncludeFilename(wInclFilename.getSelection());
+ in.setIncludeRowNumber(wInclRownum.getSelection());
+ in.setReadUrl(wReadUrl.getSelection());
+ in.setIgnoringEmptyFile(wIgnoreEmptyFile.getSelection());
+ in.setDoNotFailIfNoFile(wDoNotFailIfNoFile.getSelection());
+ in.setRecordPath(wRecordPath.getText());
+ in.setFieldSeparator(wFieldSeparator.getText());
+ in.setMaxFlattenDepth(Const.toInt(wMaxFlattenDepth.getText(), -1));
+ in.setArrayHandling(wArrayHandling.getText());
+ in.setBeyondDepthBehavior(wBeyondDepth.getText());
+ in.setIgnoreMissingField(wIgnoreMissingField.getSelection());
+ in.setRemoveSourceField(wRemoveSourceField.getSelection());
+ in.setInFields(wSourceStreamField.getSelection());
+ in.setIsAFile(wSourceIsAFile.getSelection());
+ in.setFieldValue(wFieldValue.getText());
+
+ in.getFileInput().getInputFiles().clear();
+ for (TableItem item : wFilenameList.getNonEmptyItems()) {
+ InputFile inputFile = new InputFile();
+ inputFile.setFileName(item.getText(1));
+ inputFile.setFileMask(item.getText(2));
+ inputFile.setExcludeFileMask(item.getText(3));
+ inputFile.setFileRequired(CONST_SYSTEM_COMBO_YES.equalsIgnoreCase(item.getText(4)));
+ inputFile.setIncludeSubFolders(CONST_SYSTEM_COMBO_YES.equalsIgnoreCase(item.getText(5)));
+ in.getFileInput().getInputFiles().add(inputFile);
+ }
+
+ in.getInputFields().clear();
+ for (TableItem item : wFields.getNonEmptyItems()) {
+ JsonInputField field = new JsonInputField();
+
+ field.setName(item.getText(1));
+ field.setPath(item.getText(2));
+ field.setType(ValueMetaFactory.getIdForValueMeta(item.getText(3)));
+ field.setFormat(item.getText(4));
+ field.setLength(Const.toInt(item.getText(5), -1));
+ field.setPrecision(Const.toInt(item.getText(6), -1));
+ field.setCurrencySymbol(item.getText(7));
+ field.setDecimalSymbol(item.getText(8));
+ field.setGroupSymbol(item.getText(9));
+ field.setTrimType(ValueMetaBase.getTrimTypeByDesc(item.getText(10)));
+ field.setRepeated(CONST_SYSTEM_COMBO_YES.equalsIgnoreCase(item.getText(11)));
+
+ in.getInputFields().add(field);
+ }
+ in.setShortFileNameField(wShortFileFieldName.getText());
+ in.setPathField(wPathFieldName.getText());
+ in.setIsHiddenField(wIsHiddenName.getText());
+ in.setLastModificationDateField(wLastModificationTimeName.getText());
+ in.setUriField(wUriName.getText());
+ in.setRootUriField(wRootUriName.getText());
+ in.setExtensionField(wExtensionFieldName.getText());
+ in.setSizeField(wSizeFieldName.getText());
+ }
+
+ private void get() {
+ try {
+ JsonNormalizeInputMeta meta = new JsonNormalizeInputMeta();
+ getInfo(meta);
+ FileInputList files = meta.getFiles(variables);
+ for (FileObject fileObject : files.getFiles()) {
+ try (InputStream inputStream = HopVfs.getInputStream(fileObject)) {
+ refreshFields(inputStream);
+ }
+ }
+ wFields.optimizeTableView();
+ } catch (Exception e) {
+ new ErrorDialog(shell, "Error", "Error sampling JSON file(s)", e);
+ }
+ }
+
+ private void refreshFields(InputStream inputStream) {
+ try {
+ String recordPath = variables.resolve(wRecordPath.getText());
+ String rawSep = wFieldSeparator.getText();
+ String sep = (rawSep == null || rawSep.isEmpty()) ? "." : variables.resolve(rawSep);
+ int maxDepth = Const.toInt(variables.resolve(wMaxFlattenDepth.getText()), -1);
+ String ah = wArrayHandling.getText();
+ String arrayHandling =
+ (ah == null || ah.isEmpty()) ? JsonNodeFlattener.CODE_ARRAY_STRINGIFY : ah;
+ String bd = wBeyondDepth.getText();
+ String beyond = (bd == null || bd.isEmpty()) ? JsonNodeFlattener.CODE_BEYOND_STRINGIFY : bd;
+
+ List<JsonNode> records =
+ JsonNormalizeRecords.extractRecordsFromStream(inputStream, recordPath);
+ if (records.isEmpty()) {
+ return;
+ }
+ Map<String, JsonNode> flat =
+ JsonNodeFlattener.flatten(records.get(0), sep, maxDepth, arrayHandling, beyond);
+ List<String> paths = new ArrayList<>(flat.keySet());
+ Collections.sort(paths);
+ wFields.table.removeAll();
+ for (String path : paths) {
+ TableItem item = new TableItem(wFields.table, SWT.NONE);
+ String shortName =
+ sep.isEmpty() || !path.contains(sep)
+ ? path
+ : path.substring(path.lastIndexOf(sep) + sep.length());
+ item.setText(1, shortName);
+ item.setText(2, path);
+ item.setText(3, "String");
+ }
+ } catch (Exception e) {
+ new ErrorDialog(
+ shell,
+ "Error",
+ BaseMessages.getString(PKG, "JsonNormalizeInputDialog.GetFields.Error"),
+ e);
+ }
+ }
+
+ // Preview the data
+ private void preview() {
+ JsonNormalizeInputMeta oneMeta = new JsonNormalizeInputMeta();
+ getInfo(oneMeta);
+
+ EnterNumberDialog numberDialog =
+ new EnterNumberDialog(
+ shell,
+ props.getDefaultPreviewSize(),
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.NumberRows.DialogTitle"),
+ BaseMessages.getString(
+ JsonInputMeta.class, "JsonInputDialog.NumberRows.DialogMessage"));
+
+ int previewSize = numberDialog.open();
+ if (previewSize > 0) {
+ oneMeta.setRowLimit(previewSize);
+ PipelineMeta previewMeta =
+ PipelinePreviewFactory.generatePreviewPipeline(
+ pipelineMeta.getMetadataProvider(), oneMeta, wTransformName.getText());
+
+ PipelinePreviewProgressDialog progressDialog =
+ new PipelinePreviewProgressDialog(
+ shell,
+ variables,
+ previewMeta,
+ new String[] {wTransformName.getText()},
+ new int[] {previewSize});
+ progressDialog.open();
+
+ if (!progressDialog.isCancelled()) {
+ Pipeline pipeline = progressDialog.getPipeline();
+ String loggingText = progressDialog.getLoggingText();
+
+ if (pipeline.getResult() != null && pipeline.getResult().getNrErrors() > 0) {
+ EnterTextDialog etd =
+ new EnterTextDialog(
+ shell,
+ BaseMessages.getString(PKG, "System.Dialog.PreviewError.Title"),
+ BaseMessages.getString(PKG, "System.Dialog.PreviewError.Message"),
+ loggingText,
+ true);
+ etd.setReadOnly();
+ etd.open();
+ }
+ PreviewRowsDialog prd =
+ new PreviewRowsDialog(
+ shell,
+ variables,
+ SWT.NONE,
+ wTransformName.getText(),
+ progressDialog.getPreviewRowsMeta(wTransformName.getText()),
+ progressDialog.getPreviewRows(wTransformName.getText()),
+ loggingText);
+ prd.open();
+ }
+ }
+ }
+
+ private void addAdditionalFieldsTab() {
+ // ////////////////////////
+ // START OF ADDITIONAL FIELDS TAB ///
+ // ////////////////////////
+ CTabItem wAdditionalFieldsTab = new CTabItem(wTabFolder, SWT.NONE);
+ wAdditionalFieldsTab.setFont(GuiResource.getInstance().getFontDefault());
+ wAdditionalFieldsTab.setText(
+ BaseMessages.getString(
+ JsonInputMeta.class, "JsonInputDialog.AdditionalFieldsTab.TabTitle"));
+
+ Composite wAdditionalFieldsComp = new Composite(wTabFolder, SWT.NONE);
+ PropsUi.setLook(wAdditionalFieldsComp);
+
+ FormLayout fieldsLayout = new FormLayout();
+ fieldsLayout.marginWidth = 3;
+ fieldsLayout.marginHeight = 3;
+ wAdditionalFieldsComp.setLayout(fieldsLayout);
+ // ShortFileFieldName line
+ Label wlShortFileFieldName = new Label(wAdditionalFieldsComp, SWT.RIGHT);
+ wlShortFileFieldName.setText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.ShortFileFieldName.Label"));
+ PropsUi.setLook(wlShortFileFieldName);
+ FormData fdlShortFileFieldName = new FormData();
+ fdlShortFileFieldName.left = new FormAttachment(0, 0);
+ fdlShortFileFieldName.top = new FormAttachment(wInclRownumField, margin);
+ fdlShortFileFieldName.right = new FormAttachment(middle, -margin);
+ wlShortFileFieldName.setLayoutData(fdlShortFileFieldName);
+
+ wShortFileFieldName =
+ new TextVar(variables, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ PropsUi.setLook(wShortFileFieldName);
+ wShortFileFieldName.addModifyListener(lsMod);
+ FormData fdShortFileFieldName = new FormData();
+ fdShortFileFieldName.left = new FormAttachment(middle, 0);
+ fdShortFileFieldName.right = new FormAttachment(100, -margin);
+ fdShortFileFieldName.top = new FormAttachment(wInclRownumField, margin);
+ wShortFileFieldName.setLayoutData(fdShortFileFieldName);
+
+ // ExtensionFieldName line
+ Label wlExtensionFieldName = new Label(wAdditionalFieldsComp, SWT.RIGHT);
+ wlExtensionFieldName.setText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.ExtensionFieldName.Label"));
+ PropsUi.setLook(wlExtensionFieldName);
+ FormData fdlExtensionFieldName = new FormData();
+ fdlExtensionFieldName.left = new FormAttachment(0, 0);
+ fdlExtensionFieldName.top = new FormAttachment(wShortFileFieldName, margin);
+ fdlExtensionFieldName.right = new FormAttachment(middle, -margin);
+ wlExtensionFieldName.setLayoutData(fdlExtensionFieldName);
+
+ wExtensionFieldName =
+ new TextVar(variables, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ PropsUi.setLook(wExtensionFieldName);
+ wExtensionFieldName.addModifyListener(lsMod);
+ FormData fdExtensionFieldName = new FormData();
+ fdExtensionFieldName.left = new FormAttachment(middle, 0);
+ fdExtensionFieldName.right = new FormAttachment(100, -margin);
+ fdExtensionFieldName.top = new FormAttachment(wShortFileFieldName, margin);
+ wExtensionFieldName.setLayoutData(fdExtensionFieldName);
+
+ // PathFieldName line
+ Label wlPathFieldName = new Label(wAdditionalFieldsComp, SWT.RIGHT);
+ wlPathFieldName.setText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.PathFieldName.Label"));
+ PropsUi.setLook(wlPathFieldName);
+ FormData fdlPathFieldName = new FormData();
+ fdlPathFieldName.left = new FormAttachment(0, 0);
+ fdlPathFieldName.top = new FormAttachment(wExtensionFieldName, margin);
+ fdlPathFieldName.right = new FormAttachment(middle, -margin);
+ wlPathFieldName.setLayoutData(fdlPathFieldName);
+
+ wPathFieldName =
+ new TextVar(variables, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ PropsUi.setLook(wPathFieldName);
+ wPathFieldName.addModifyListener(lsMod);
+ FormData fdPathFieldName = new FormData();
+ fdPathFieldName.left = new FormAttachment(middle, 0);
+ fdPathFieldName.right = new FormAttachment(100, -margin);
+ fdPathFieldName.top = new FormAttachment(wExtensionFieldName, margin);
+ wPathFieldName.setLayoutData(fdPathFieldName);
+
+ // SizeFieldName line
+ Label wlSizeFieldName = new Label(wAdditionalFieldsComp, SWT.RIGHT);
+ wlSizeFieldName.setText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.SizeFieldName.Label"));
+ PropsUi.setLook(wlSizeFieldName);
+ FormData fdlSizeFieldName = new FormData();
+ fdlSizeFieldName.left = new FormAttachment(0, 0);
+ fdlSizeFieldName.top = new FormAttachment(wPathFieldName, margin);
+ fdlSizeFieldName.right = new FormAttachment(middle, -margin);
+ wlSizeFieldName.setLayoutData(fdlSizeFieldName);
+
+ wSizeFieldName =
+ new TextVar(variables, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ PropsUi.setLook(wSizeFieldName);
+ wSizeFieldName.addModifyListener(lsMod);
+ FormData fdSizeFieldName = new FormData();
+ fdSizeFieldName.left = new FormAttachment(middle, 0);
+ fdSizeFieldName.right = new FormAttachment(100, -margin);
+ fdSizeFieldName.top = new FormAttachment(wPathFieldName, margin);
+ wSizeFieldName.setLayoutData(fdSizeFieldName);
+
+ // IsHiddenName line
+ Label wlIsHiddenName = new Label(wAdditionalFieldsComp, SWT.RIGHT);
+ wlIsHiddenName.setText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.IsHiddenName.Label"));
+ PropsUi.setLook(wlIsHiddenName);
+ FormData fdlIsHiddenName = new FormData();
+ fdlIsHiddenName.left = new FormAttachment(0, 0);
+ fdlIsHiddenName.top = new FormAttachment(wSizeFieldName, margin);
+ fdlIsHiddenName.right = new FormAttachment(middle, -margin);
+ wlIsHiddenName.setLayoutData(fdlIsHiddenName);
+
+ wIsHiddenName =
+ new TextVar(variables, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ PropsUi.setLook(wIsHiddenName);
+ wIsHiddenName.addModifyListener(lsMod);
+ FormData fdIsHiddenName = new FormData();
+ fdIsHiddenName.left = new FormAttachment(middle, 0);
+ fdIsHiddenName.right = new FormAttachment(100, -margin);
+ fdIsHiddenName.top = new FormAttachment(wSizeFieldName, margin);
+ wIsHiddenName.setLayoutData(fdIsHiddenName);
+
+ // LastModificationTimeName line
+ Label wlLastModificationTimeName = new Label(wAdditionalFieldsComp, SWT.RIGHT);
+ wlLastModificationTimeName.setText(
+ BaseMessages.getString(
+ JsonInputMeta.class, "JsonInputDialog.LastModificationTimeName.Label"));
+ PropsUi.setLook(wlLastModificationTimeName);
+ FormData fdlLastModificationTimeName = new FormData();
+ fdlLastModificationTimeName.left = new FormAttachment(0, 0);
+ fdlLastModificationTimeName.top = new FormAttachment(wIsHiddenName, margin);
+ fdlLastModificationTimeName.right = new FormAttachment(middle, -margin);
+ wlLastModificationTimeName.setLayoutData(fdlLastModificationTimeName);
+
+ wLastModificationTimeName =
+ new TextVar(variables, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ PropsUi.setLook(wLastModificationTimeName);
+ wLastModificationTimeName.addModifyListener(lsMod);
+ FormData fdLastModificationTimeName = new FormData();
+ fdLastModificationTimeName.left = new FormAttachment(middle, 0);
+ fdLastModificationTimeName.right = new FormAttachment(100, -margin);
+ fdLastModificationTimeName.top = new FormAttachment(wIsHiddenName, margin);
+ wLastModificationTimeName.setLayoutData(fdLastModificationTimeName);
+
+ // UriName line
+ Label wlUriName = new Label(wAdditionalFieldsComp, SWT.RIGHT);
+ wlUriName.setText(BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.UriName.Label"));
+ PropsUi.setLook(wlUriName);
+ FormData fdlUriName = new FormData();
+ fdlUriName.left = new FormAttachment(0, 0);
+ fdlUriName.top = new FormAttachment(wLastModificationTimeName, margin);
+ fdlUriName.right = new FormAttachment(middle, -margin);
+ wlUriName.setLayoutData(fdlUriName);
+
+ wUriName = new TextVar(variables, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ PropsUi.setLook(wUriName);
+ wUriName.addModifyListener(lsMod);
+ FormData fdUriName = new FormData();
+ fdUriName.left = new FormAttachment(middle, 0);
+ fdUriName.right = new FormAttachment(100, -margin);
+ fdUriName.top = new FormAttachment(wLastModificationTimeName, margin);
+ wUriName.setLayoutData(fdUriName);
+
+ // RootUriName line
+ Label wlRootUriName = new Label(wAdditionalFieldsComp, SWT.RIGHT);
+ wlRootUriName.setText(
+ BaseMessages.getString(JsonInputMeta.class, "JsonInputDialog.RootUriName.Label"));
+ PropsUi.setLook(wlRootUriName);
+ FormData fdlRootUriName = new FormData();
+ fdlRootUriName.left = new FormAttachment(0, 0);
+ fdlRootUriName.top = new FormAttachment(wUriName, margin);
+ fdlRootUriName.right = new FormAttachment(middle, -margin);
+ wlRootUriName.setLayoutData(fdlRootUriName);
+
+ wRootUriName =
+ new TextVar(variables, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ PropsUi.setLook(wRootUriName);
+ wRootUriName.addModifyListener(lsMod);
+ FormData fdRootUriName = new FormData();
+ fdRootUriName.left = new FormAttachment(middle, 0);
+ fdRootUriName.right = new FormAttachment(100, -margin);
+ fdRootUriName.top = new FormAttachment(wUriName, margin);
+ wRootUriName.setLayoutData(fdRootUriName);
+
+ FormData fdAdditionalFieldsComp = new FormData();
+ fdAdditionalFieldsComp.left = new FormAttachment(0, 0);
+ fdAdditionalFieldsComp.top = new FormAttachment(wSpacer, margin);
+ fdAdditionalFieldsComp.right = new FormAttachment(100, 0);
+ fdAdditionalFieldsComp.bottom = new FormAttachment(100, 0);
+ wAdditionalFieldsComp.setLayoutData(fdAdditionalFieldsComp);
+
+ wAdditionalFieldsComp.layout();
+ wAdditionalFieldsTab.setControl(wAdditionalFieldsComp);
+
+ // ///////////////////////////////////////////////////////////
+ // / END OF ADDITIONAL FIELDS TAB
+ // ///////////////////////////////////////////////////////////
+
+ }
+}
diff --git a/plugins/transforms/json/src/main/java/org/apache/hop/pipeline/transforms/jsonnormalize/JsonNormalizeInputMeta.java b/plugins/transforms/json/src/main/java/org/apache/hop/pipeline/transforms/jsonnormalize/JsonNormalizeInputMeta.java
new file mode 100644
index 0000000000..54b3177a28
--- /dev/null
+++ b/plugins/transforms/json/src/main/java/org/apache/hop/pipeline/transforms/jsonnormalize/JsonNormalizeInputMeta.java
@@ -0,0 +1,564 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hop.pipeline.transforms.jsonnormalize;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.commons.vfs2.FileObject;
+import org.apache.hop.core.CheckResult;
+import org.apache.hop.core.Const;
+import org.apache.hop.core.ICheckResult;
+import org.apache.hop.core.annotations.Transform;
+import org.apache.hop.core.exception.HopException;
+import org.apache.hop.core.exception.HopTransformException;
+import org.apache.hop.core.fileinput.FileInputList;
+import org.apache.hop.core.fileinput.InputFile;
+import org.apache.hop.core.row.IRowMeta;
+import org.apache.hop.core.row.IValueMeta;
+import org.apache.hop.core.row.value.ValueMetaInteger;
+import org.apache.hop.core.row.value.ValueMetaString;
+import org.apache.hop.core.util.Utils;
+import org.apache.hop.core.variables.IVariables;
+import org.apache.hop.i18n.BaseMessages;
+import org.apache.hop.metadata.api.HopMetadataProperty;
+import org.apache.hop.metadata.api.IHopMetadataProvider;
+import org.apache.hop.pipeline.PipelineMeta;
+import org.apache.hop.pipeline.transform.TransformMeta;
+import org.apache.hop.pipeline.transforms.file.BaseFileInput;
+import org.apache.hop.pipeline.transforms.file.BaseFileInputAdditionalFields;
+import org.apache.hop.pipeline.transforms.file.BaseFileInputMeta;
+import org.apache.hop.pipeline.transforms.jsoninput.JsonInputField;
+import org.apache.hop.resource.IResourceNaming;
+import org.apache.hop.resource.ResourceDefinition;
+import org.w3c.dom.Node;
+
+@Transform(
+ id = "JsonNormalizeInput",
+ image = "json-normalize-input.svg",
+ documentationUrl = "/pipeline/transforms/jsonnormalizeinput.html",
+ name = "i18n::JsonNormalizeInput.name",
+ description = "i18n::JsonNormalizeInput.description",
+ keywords = "i18n::JsonNormalizeInputMeta.keyword",
+ categoryDescription = "i18n::JsonInput.category")
+@Getter
+@Setter
+public class JsonNormalizeInputMeta
+ extends BaseFileInputMeta<JsonNormalizeInput, JsonNormalizeInputData, BaseFileInput> {
+ private static final Class<?> PKG = JsonNormalizeInputMeta.class;
+
+ protected static final String[] RequiredFilesDesc =
+ new String[] {
+ BaseMessages.getString(PKG, "System.Combo.No"),
+ BaseMessages.getString(PKG, "System.Combo.Yes")
+ };
+
+ @HopMetadataProperty(
+ key = "include",
+ injectionKey = "FILE_NAME_OUTPUT",
+ injectionKeyDescription = "JsonNormalizeInput.Injection.FILE_NAME_OUTPUT")
+ private boolean includeFilename;
+
+ @HopMetadataProperty(
+ key = "include_field",
+ injectionKey = "FILE_NAME_FIELDNAME",
+ injectionKeyDescription = "JsonNormalizeInput.Injection.FILE_NAME_FIELDNAME")
+ private String filenameField;
+
+ @HopMetadataProperty(
+ key = "rownum",
+ injectionKey = "ROW_NUMBER_OUTPUT",
+ injectionKeyDescription = "JsonNormalizeInput.Injection.ROW_NUMBER_OUTPUT")
+ private boolean includeRowNumber;
+
+ @HopMetadataProperty(
+ key = "rownum_field",
+ injectionKey = "ROW_NUMBER_FIELDNAME",
+ injectionKeyDescription = "JsonNormalizeInput.Injection.ROW_NUMBER_FIELDNAME")
+ private String rowNumberField;
+
+ @HopMetadataProperty(
+ key = "limit",
+ injectionKey = "ROW_LIMIT",
+ injectionKeyDescription = "JsonNormalizeInput.Injection.ROW_LIMIT")
+ private long rowLimit;
+
+ @HopMetadataProperty(
+ key = "valueField",
+ injectionKey = "SOURCE_FIELD_NAME",
+ injectionKeyDescription = "JsonNormalizeInput.Injection.SOURCE_FIELD_NAME")
+ private String valueField;
+
+ @HopMetadataProperty(
+ key = "IsInFields",
+ injectionKey = "SOURCE_IN_FIELD",
+ injectionKeyDescription = "JsonNormalizeInput.Injection.SOURCE_IN_FIELD")
+ private boolean inFields;
+
+ @HopMetadataProperty(
+ key = "IsAFile",
+ injectionKey = "SOURCE_FIELD_IS_FILENAME",
+ injectionKeyDescription = "JsonNormalizeInput.Injection.SOURCE_FIELD_IS_FILENAME")
+ private boolean sourceAFile;
+
+ @HopMetadataProperty(
+ key = "addresultfile",
+ injectionKey = "ADD_RESULT_FILE",
+ injectionKeyDescription = "JsonNormalizeInput.Injection.ADD_RESULT_FILE")
+ private boolean addResultFile;
+
+ @HopMetadataProperty(
+ key = "IsIgnoreEmptyFile",
+ injectionKey = "IGNORE_EMPTY_FILE",
+ injectionKeyDescription = "JsonNormalizeInput.Injection.IGNORE_EMPTY_FILE")
+ private boolean ignoringEmptyFile;
+
+ @HopMetadataProperty(
+ key = "doNotFailIfNoFile",
+ injectionKey = "DO_NOT_FAIL_IF_NO_FILE",
+ injectionKeyDescription = "JsonNormalizeInput.Injection.DO_NOT_FAIL_IF_NO_FILE")
+ private boolean doNotFailIfNoFile;
+
+ @HopMetadataProperty(
+ key = "readurl",
+ injectionKey = "READ_SOURCE_AS_URL",
+ injectionKeyDescription = "JsonNormalizeInput.Injection.READ_SOURCE_AS_URL")
+ private boolean readUrl;
+
+ @HopMetadataProperty(
+ key = "removeSourceField",
+ injectionKey = "REMOVE_SOURCE_FIELDS",
+ injectionKeyDescription = "JsonNormalizeInput.Injection.REMOVE_SOURCE_FIELDS")
+ private boolean removeSourceField;
+
+ @HopMetadataProperty(
+ key = "recordPath",
+ injectionKey = "RECORD_PATH",
+ injectionKeyDescription = "JsonNormalizeInput.Injection.RECORD_PATH")
+ private String recordPath;
+
+ /** Join segments when flattening (similar to pandas json_normalize {@code sep}). */
+ @HopMetadataProperty(
+ key = "fieldSeparator",
+ injectionKey = "FIELD_SEPARATOR",
+ injectionKeyDescription = "JsonNormalizeInput.Injection.FIELD_SEPARATOR")
+ private String fieldSeparator;
+
+ /**
+ * Maximum nesting depth for flattening objects. {@code -1} means unlimited (pandas {@code
+ * max_level}=None).
+ */
+ @HopMetadataProperty(
+ key = "maxFlattenDepth",
+ injectionKey = "MAX_FLATTEN_DEPTH",
+ injectionKeyDescription = "JsonNormalizeInput.Injection.MAX_FLATTEN_DEPTH")
+ private int maxFlattenDepth;
+
+ /** STRINGIFY | SINGLE_ELEMENT | ERROR — how to handle JSON arrays in a record. */
+ @HopMetadataProperty(
+ key = "arrayHandling",
+ injectionKey = "ARRAY_HANDLING",
+ injectionKeyDescription = "JsonNormalizeInput.Injection.ARRAY_HANDLING")
+ private String arrayHandling;
+
+ /** STRINGIFY | OMIT | ERROR — nested objects when max depth is reached. */
+ @HopMetadataProperty(
+ key = "beyondDepthBehavior",
+ injectionKey = "BEYOND_DEPTH_BEHAVIOR",
+ injectionKeyDescription = "JsonNormalizeInput.Injection.BEYOND_DEPTH_BEHAVIOR")
+ private String beyondDepthBehavior;
+
+ @HopMetadataProperty(
+ key = "ignoreMissingField",
+ defaultBoolean = true,
+ injectionKey = "IGNORE_MISSING_FIELD",
+ injectionKeyDescription = "JsonNormalizeInput.Injection.IGNORE_MISSING_FIELD")
+ private boolean ignoreMissingField;
+
+ @HopMetadataProperty(inline = true)
+ protected BaseFileInputAdditionalFields additionalOutputFields;
+
+ @HopMetadataProperty(
+ key = "file",
+ inline = true,
+ childKeysToIgnore = {
+ "accept_filenames",
+ "accept_transform_name",
+ "passing_through_fields",
+ "accept_field",
+ "add_to_result_filenames",
+ })
+ protected BaseFileInput fileInput;
+
+ @HopMetadataProperty(
+ key = "field",
+ groupKey = "fields",
+ injectionGroupKey = "FIELDS",
+ injectionGroupDescription = "JsonNormalizeInput.Injection.FIELDS")
+ private List<JsonInputField> inputFields;
+
+ public JsonNormalizeInputMeta() {
+ super();
+ inputFields = new ArrayList<>();
+ additionalOutputFields = new BaseFileInputAdditionalFields();
+ fileInput = new BaseFileInput();
+ ignoringEmptyFile = false;
+ doNotFailIfNoFile = true;
+ includeFilename = false;
+ filenameField = "";
+ includeRowNumber = false;
+ rowNumberField = "";
+ sourceAFile = false;
+ addResultFile = false;
+ readUrl = false;
+ removeSourceField = false;
+ rowLimit = 0;
+ inFields = false;
+ valueField = "";
+ recordPath = "$";
+ fieldSeparator = ".";
+ maxFlattenDepth = -1;
+ arrayHandling = JsonNodeFlattener.CODE_ARRAY_STRINGIFY;
+ beyondDepthBehavior = JsonNodeFlattener.CODE_BEYOND_STRINGIFY;
+ ignoreMissingField = true;
+ }
+
+ public JsonNormalizeInputMeta(JsonNormalizeInputMeta m) {
+ this();
+ this.addResultFile = m.addResultFile;
+ this.doNotFailIfNoFile = m.doNotFailIfNoFile;
+ this.filenameField = m.filenameField;
+ this.includeFilename = m.includeFilename;
+ this.includeRowNumber = m.includeRowNumber;
+ this.inFields = m.inFields;
+ this.sourceAFile = m.sourceAFile;
+ this.ignoringEmptyFile = m.ignoringEmptyFile;
+ this.readUrl = m.readUrl;
+ this.removeSourceField = m.removeSourceField;
+ this.rowLimit = m.rowLimit;
+ this.rowNumberField = m.rowNumberField;
+ this.valueField = m.valueField;
+ this.recordPath = m.recordPath;
+ this.fieldSeparator = m.fieldSeparator;
+ this.maxFlattenDepth = m.maxFlattenDepth;
+ this.arrayHandling = m.arrayHandling;
+ this.beyondDepthBehavior = m.beyondDepthBehavior;
+ this.ignoreMissingField = m.ignoreMissingField;
+ this.additionalOutputFields = new BaseFileInputAdditionalFields(m.additionalOutputFields);
+ this.fileInput = new BaseFileInput(m.fileInput);
+ m.inputFields.forEach(f -> inputFields.add(new JsonInputField(f)));
+ }
+
+ @Override
+ public JsonNormalizeInputMeta clone() {
+ return new JsonNormalizeInputMeta(this);
+ }
+
+ public String getShortFileNameField() {
+ return additionalOutputFields.getShortFilenameField();
+ }
+
+ public void setShortFileNameField(String field) {
+ additionalOutputFields.setShortFilenameField(field);
+ }
+
+ public String getPathField() {
+ return additionalOutputFields.getPathField();
+ }
+
+ public void setPathField(String field) {
+ additionalOutputFields.setPathField(field);
+ }
+
+ public String isHiddenField() {
+ return additionalOutputFields.getHiddenField();
+ }
+
+ public void setIsHiddenField(String field) {
+ additionalOutputFields.setHiddenField(field);
+ }
+
+ public String getLastModificationDateField() {
+ return additionalOutputFields.getLastModificationField();
+ }
+
+ public void setLastModificationDateField(String field) {
+ additionalOutputFields.setLastModificationField(field);
+ }
+
+ public String getUriField() {
+ return additionalOutputFields.getUriField();
+ }
+
+ public void setUriField(String field) {
+ additionalOutputFields.setUriField(field);
+ }
+
+ public String getRootUriField() {
+ return additionalOutputFields.getRootUriField();
+ }
+
+ public void setRootUriField(String field) {
+ additionalOutputFields.setRootUriField(field);
+ }
+
+ public String getExtensionField() {
+ return additionalOutputFields.getExtensionField();
+ }
+
+ public void setExtensionField(String field) {
+ additionalOutputFields.setExtensionField(field);
+ }
+
+ public String getSizeField() {
+ return additionalOutputFields.getSizeField();
+ }
+
+ public void setSizeField(String field) {
+ additionalOutputFields.setSizeField(field);
+ }
+
+ public boolean addResultFile() {
+ return addResultFile;
+ }
+
+ public String getFieldValue() {
+ return valueField;
+ }
+
+ public void setFieldValue(String value) {
+ this.valueField = value;
+ fileInput.setAcceptingField(value);
+ }
+
+ public void setInFields(boolean inFields) {
+ this.inFields = inFields;
+ fileInput.setAcceptingFilenames(inFields);
+ }
+
+ public boolean includeFilename() {
+ return includeFilename;
+ }
+
+ public boolean includeRowNumber() {
+ return includeRowNumber;
+ }
+
+ public boolean getIsAFile() {
+ return sourceAFile;
+ }
+
+ public void setIsAFile(boolean isAFile) {
+ this.sourceAFile = isAFile;
+ }
+
+ @Override
+ public void convertLegacyXml(Node node) {
+ convertLegacyXml(getFileInput().getInputFiles(), node);
+ }
+
+ public String getRequiredFilesDesc(String tt) {
+ if (Utils.isEmpty(tt)) {
+ return RequiredFilesDesc[0];
+ }
+ if (tt.equalsIgnoreCase(REQUIRED_FILES_CODE[1])) {
+ return RequiredFilesDesc[1];
+ } else {
+ return RequiredFilesDesc[0];
+ }
+ }
+
+ @Override
+ public void getFields(
+ IRowMeta rowMeta,
+ String name,
+ IRowMeta[] info,
+ TransformMeta nextTransform,
+ IVariables variables,
+ IHopMetadataProvider metadataProvider)
+ throws HopTransformException {
+
+ if (inFields && removeSourceField && !Utils.isEmpty(valueField)) {
+ int index = rowMeta.indexOfValue(valueField);
+ if (index != -1) {
+ rowMeta.removeValueMeta(index);
+ }
+ }
+
+ for (JsonInputField field : getInputFields()) {
+ try {
+ rowMeta.addValueMeta(field.toValueMeta(name, variables));
+ } catch (Exception e) {
+ throw new HopTransformException(e);
+ }
+ }
+
+ if (includeFilename) {
+ IValueMeta v = new ValueMetaString(variables.resolve(filenameField));
+ v.setLength(250);
+ v.setPrecision(-1);
+ v.setOrigin(name);
+ rowMeta.addValueMeta(v);
+ }
+
+ if (includeRowNumber) {
+ IValueMeta v = new ValueMetaInteger(variables.resolve(rowNumberField));
+ v.setLength(IValueMeta.DEFAULT_INTEGER_LENGTH, 0);
+ v.setOrigin(name);
+ rowMeta.addValueMeta(v);
+ }
+ additionalOutputFields.normalize();
+ additionalOutputFields.getFields(rowMeta, name, variables);
+ }
+
+ public FileInputList getFiles(IVariables variables) {
+ return FileInputList.createFileList(variables, getFileInput().getInputFiles());
+ }
+
+ @Override
+ public void check(
+ List<ICheckResult> remarks,
+ PipelineMeta pipelineMeta,
+ TransformMeta transformMeta,
+ IRowMeta prev,
+ String[] input,
+ String[] output,
+ IRowMeta info,
+ IVariables variables,
+ IHopMetadataProvider metadataProvider) {
+ CheckResult cr;
+
+ if (!isInFields()) {
+ if (input.length <= 0) {
+ cr =
+ new CheckResult(
+ ICheckResult.TYPE_RESULT_ERROR,
+ BaseMessages.getString(PKG, "JsonInputMeta.CheckResult.NoInputExpected"),
+ transformMeta);
+ remarks.add(cr);
+ } else {
+ cr =
+ new CheckResult(
+ ICheckResult.TYPE_RESULT_OK,
+ BaseMessages.getString(PKG, "JsonInputMeta.CheckResult.NoInput"),
+ transformMeta);
+ remarks.add(cr);
+ }
+ }
+
+ if (getInputFields().isEmpty()) {
+ cr =
+ new CheckResult(
+ ICheckResult.TYPE_RESULT_ERROR,
+ BaseMessages.getString(PKG, "JsonNormalizeInputMeta.CheckResult.NoInputField"),
+ transformMeta);
+ remarks.add(cr);
+ }
+
+ if (Utils.isEmpty(getRecordPath())) {
+ cr =
+ new CheckResult(
+ ICheckResult.TYPE_RESULT_ERROR,
+ BaseMessages.getString(PKG, "JsonNormalizeInputMeta.CheckResult.NoRecordPath"),
+ transformMeta);
+ remarks.add(cr);
+ }
+
+ if (isInFields()) {
+ if (Utils.isEmpty(getFieldValue())) {
+ cr =
+ new CheckResult(
+ ICheckResult.TYPE_RESULT_ERROR,
+ BaseMessages.getString(PKG, "JsonInputMeta.CheckResult.NoField"),
+ transformMeta);
+ remarks.add(cr);
+ } else {
+ cr =
+ new CheckResult(
+ ICheckResult.TYPE_RESULT_OK,
+ BaseMessages.getString(PKG, "JsonInputMeta.CheckResult.FieldOk"),
+ transformMeta);
+ remarks.add(cr);
+ }
+ } else {
+ FileInputList fileInputList = getFiles(variables);
+ if (fileInputList == null || fileInputList.getFiles().isEmpty()) {
+ cr =
+ new CheckResult(
+ ICheckResult.TYPE_RESULT_ERROR,
+ BaseMessages.getString(PKG, "JsonInputMeta.CheckResult.NoFiles"),
+ transformMeta);
+ remarks.add(cr);
+ } else {
+ cr =
+ new CheckResult(
+ ICheckResult.TYPE_RESULT_OK,
+ BaseMessages.getString(
+ PKG, "JsonInputMeta.CheckResult.FilesOk", "" + fileInputList.getFiles().size()),
+ transformMeta);
+ remarks.add(cr);
+ }
+ }
+ }
+
+ @Override
+ public boolean supportsErrorHandling() {
+ return true;
+ }
+
+ @Override
+ public String exportResources(
+ IVariables variables,
+ Map<String, ResourceDefinition> definitions,
+ IResourceNaming resourceNamingInterface,
+ IHopMetadataProvider metadataProvider)
+ throws HopException {
+ try {
+ List<String> newFilenames = new ArrayList<>();
+
+ if (!isInFields()) {
+ FileInputList fileList = getFiles(variables);
+ if (!fileList.getFiles().isEmpty()) {
+ for (FileObject fileObject : fileList.getFiles()) {
+ if (fileObject.exists()) {
+ newFilenames.add(fileObject.getName().getPath());
+ }
+ }
+
+ getFileInput().getInputFiles().clear();
+ for (String newFilename : newFilenames) {
+ InputFile inputFile = new InputFile();
+ inputFile.setFileName(newFilename);
+ inputFile.setFileRequired(true);
+ getFileInput().getInputFiles().add(inputFile);
+ }
+ }
+ }
+ return null;
+ } catch (Exception e) {
+ throw new HopException(e);
+ }
+ }
+
+ @Override
+ public String getEncoding() {
+ return Const.UTF_8;
+ }
+}
diff --git a/plugins/transforms/json/src/main/java/org/apache/hop/pipeline/transforms/jsonnormalize/JsonNormalizeRecords.java b/plugins/transforms/json/src/main/java/org/apache/hop/pipeline/transforms/jsonnormalize/JsonNormalizeRecords.java
new file mode 100644
index 0000000000..6496f9d611
--- /dev/null
+++ b/plugins/transforms/json/src/main/java/org/apache/hop/pipeline/transforms/jsonnormalize/JsonNormalizeRecords.java
@@ -0,0 +1,123 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hop.pipeline.transforms.jsonnormalize;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.jayway.jsonpath.Configuration;
+import com.jayway.jsonpath.JsonPath;
+import com.jayway.jsonpath.Option;
+import com.jayway.jsonpath.ReadContext;
+import com.jayway.jsonpath.spi.json.JacksonJsonNodeJsonProvider;
+import com.jayway.jsonpath.spi.mapper.JacksonMappingProvider;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.EnumSet;
+import java.util.List;
+import org.apache.hop.core.exception.HopException;
+
+/** Selects record nodes from a document using JsonPath (Jayway), similar to JSON Input. */
+public final class JsonNormalizeRecords {
+
+ private static final ObjectMapper MAPPER = new ObjectMapper();
+
+ private static final Configuration NODE_CONFIGURATION =
+ Configuration.builder()
+ .jsonProvider(new JacksonJsonNodeJsonProvider())
+ .mappingProvider(new JacksonMappingProvider())
+ .options(
+ EnumSet.of(
+ Option.SUPPRESS_EXCEPTIONS,
+ Option.ALWAYS_RETURN_LIST,
+ Option.DEFAULT_PATH_LEAF_TO_NULL))
+ .build();
+
+ private JsonNormalizeRecords() {}
+
+ public static List<JsonNode> extractRecordsFromStream(InputStream in, String recordPath)
+ throws HopException {
+ try {
+ JsonNode root = MAPPER.readTree(in);
+ return extractRecordsFromNode(root, recordPath);
+ } catch (HopException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new HopException("Failed to parse JSON document for normalize: " + e.getMessage(), e);
+ }
+ }
+
+ public static List<JsonNode> extractRecordsFromNode(JsonNode root, String recordPath)
+ throws HopException {
+ try {
+ ReadContext readContext = JsonPath.using(NODE_CONFIGURATION).parse(root);
+ return readRecordNodes(readContext, recordPath);
+ } catch (HopException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new HopException("Failed to read JSON records: " + e.getMessage(), e);
+ }
+ }
+
+ private static List<JsonNode> readRecordNodes(ReadContext readContext, String recordPath)
+ throws HopException {
+ JsonPath path = JsonPath.compile(recordPath);
+ Object raw = readContext.read(path);
+ if (raw == null) {
+ return new ArrayList<>();
+ }
+ List<JsonNode> records = new ArrayList<>();
+ if (raw instanceof List<?> list) {
+ if (list.size() == 1 && list.get(0) instanceof ArrayNode arr) {
+ for (JsonNode n : arr) {
+ records.add(n);
+ }
+ return records;
+ }
+ for (Object o : list) {
+ records.add(toJsonNode(o));
+ }
+ return records;
+ }
+ if (raw instanceof ArrayNode arr) {
+ for (JsonNode n : arr) {
+ records.add(n);
+ }
+ return records;
+ }
+ // Single value (rare with ALWAYS_RETURN_LIST but guard anyway)
+ records.add(toJsonNode(raw));
+ return records;
+ }
+
+ private static JsonNode toJsonNode(Object o) throws HopException {
+ if (o == null) {
+ return null;
+ }
+ if (o instanceof JsonNode j) {
+ return j;
+ }
+ try {
+ return MAPPER.valueToTree(o);
+ } catch (IllegalArgumentException e) {
+ throw new HopException(
+ "Could not convert JSON path element of type " + o.getClass().getName() + " to JsonNode.",
+ e);
+ }
+ }
+}
diff --git a/plugins/transforms/json/src/main/java/org/apache/hop/pipeline/transforms/jsonnormalize/NormalizeInputsReader.java b/plugins/transforms/json/src/main/java/org/apache/hop/pipeline/transforms/jsonnormalize/NormalizeInputsReader.java
new file mode 100644
index 0000000000..89b1972a29
--- /dev/null
+++ b/plugins/transforms/json/src/main/java/org/apache/hop/pipeline/transforms/jsonnormalize/NormalizeInputsReader.java
@@ -0,0 +1,327 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hop.pipeline.transforms.jsonnormalize;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Iterator;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.vfs2.FileObject;
+import org.apache.commons.vfs2.FileSystemException;
+import org.apache.hop.core.exception.HopException;
+import org.apache.hop.core.exception.HopFileException;
+import org.apache.hop.core.variables.IVariables;
+import org.apache.hop.core.vfs.HopVfs;
+import org.apache.hop.pipeline.transform.ITransform;
+import org.apache.hop.pipeline.transforms.file.BaseFileInputTransformData;
+import org.apache.hop.pipeline.transforms.jsoninput.JsonInputData;
+
+/**
+ * Input iteration for JSON Normalize (same sourcing model as JSON Input: file list, field string,
+ * URL, or JsonNode field).
+ */
+public class NormalizeInputsReader implements Iterable<InputStream> {
+
+ private final JsonNormalizeInput transform;
+ private final JsonNormalizeInputMeta meta;
+ private final JsonNormalizeInputData data;
+ private final ErrorHandler errorHandler;
+
+ private static final String CONST_REMOVE = "remove";
+
+ public NormalizeInputsReader(
+ JsonNormalizeInput transform,
+ JsonNormalizeInputMeta meta,
+ JsonNormalizeInputData data,
+ ErrorHandler errorHandler) {
+ this.transform = transform;
+ this.meta = meta;
+ this.data = data;
+ this.errorHandler = errorHandler;
+ }
+
+ @Override
+ public Iterator<InputStream> iterator() {
+ if (!meta.isInFields() || meta.getIsAFile()) {
+ Iterator<FileObject> files;
+ if (meta.getFileInput().isAcceptingFilenames()) {
+ files = new FileNamesIterator(transform, errorHandler, getFieldIterator());
+ } else {
+ if (data.files == null) {
+ data.files = meta.getFileInputList(transform);
+ }
+ files = data.files.getFiles().listIterator(data.currentFileIndex);
+ }
+ return new FileContentIterator(files, data, errorHandler);
+ } else if (meta.isReadUrl()) {
+ return new URLContentIterator(errorHandler, getFieldIterator());
+ } else {
+ return new ChainedIterator<>(getFieldIterator(), errorHandler) {
+ @Override
+ protected InputStream tryNext() throws IOException {
+ String next = inner.next();
+ return next == null ? null : IOUtils.toInputStream(next, meta.getEncoding());
+ }
+ };
+ }
+ }
+
+ public Iterator<JsonNode> jsonFieldIterator() {
+ return new JsonFieldIterator(
+ new RowIterator(transform, data, errorHandler), data.indexSourceField);
+ }
+
+ protected StringFieldIterator getFieldIterator() {
+ return new StringFieldIterator(
+ new RowIterator(transform, data, errorHandler), data.indexSourceField);
+ }
+
+ public interface ErrorHandler {
+ void error(Exception thrown);
+
+ void fileOpenError(FileObject file, FileSystemException exception);
+
+ void fileCloseError(FileObject file, FileSystemException exception);
+ }
+
+ protected abstract class ChainedIterator<T, C> implements Iterator<T> {
+
+ protected Iterator<C> inner;
+ protected ErrorHandler handler;
+
+ ChainedIterator(Iterator<C> inner, ErrorHandler handler) {
+ this.inner = inner;
+ this.handler = handler;
+ }
+
+ @Override
+ public boolean hasNext() {
+ return inner.hasNext();
+ }
+
+ @Override
+ public T next() {
+ try {
+ return tryNext();
+ } catch (Exception e) {
+ handler.error(e);
+ return null;
+ }
+ }
+
+ @Override
+ public void remove() {
+ throw new UnsupportedOperationException(CONST_REMOVE);
+ }
+
+ protected abstract T tryNext() throws Exception;
+ }
+
+ protected class FileContentIterator extends ChainedIterator<InputStream, FileObject> {
+
+ private final BaseFileInputTransformData transformData;
+
+ FileContentIterator(
+ Iterator<FileObject> inner, BaseFileInputTransformData data, ErrorHandler handler) {
+ super(inner, handler);
+ this.transformData = data;
+ }
+
+ @Override
+ public InputStream tryNext() {
+ if (hasNext()) {
+ if (transformData.file != null) {
+ try {
+ transformData.file.close();
+ } catch (FileSystemException e) {
+ handler.fileCloseError(transformData.file, e);
+ }
+ }
+ try {
+ transformData.file = inner.next();
+ transformData.currentFileIndex++;
+ if (transform.onNewFile(transformData.file)) {
+ return HopVfs.getInputStream(transformData.file);
+ }
+ } catch (FileSystemException e) {
+ handler.fileOpenError(transformData.file, e);
+ }
+ }
+ return null;
+ }
+ }
+
+ protected class FileNamesIterator extends ChainedIterator<FileObject, String> {
+
+ public FileNamesIterator(
+ IVariables varSpace, ErrorHandler handler, Iterator<String> fileNames) {
+ super(fileNames, handler);
+ }
+
+ @Override
+ public FileObject tryNext() throws HopFileException {
+ String fileName = transform.resolve(inner.next());
+ return fileName == null ? null : HopVfs.getFileObject(fileName);
+ }
+ }
+
+ protected class URLContentIterator extends ChainedIterator<InputStream, String> {
+
+ public URLContentIterator(ErrorHandler handler, Iterator<String> urls) {
+ super(urls, handler);
+ }
+
+ @Override
+ protected InputStream tryNext() throws Exception {
+ if (hasNext()) {
+ URL url = new URL(transform.resolve(inner.next()));
+ URLConnection connection = url.openConnection();
+ return connection.getInputStream();
+ }
+ return null;
+ }
+ }
+
+ protected static class StringFieldIterator implements Iterator<String> {
+
+ private final RowIterator rowIter;
+ private final int idx;
+
+ public StringFieldIterator(RowIterator rowIter, int idx) {
+ this.rowIter = rowIter;
+ this.idx = idx;
+ }
+
+ @Override
+ public boolean hasNext() {
+ return rowIter.hasNext();
+ }
+
+ @Override
+ public String next() {
+ Object[] row = rowIter.next();
+ if (row == null || row.length <= idx) {
+ return null;
+ }
+ Object v = row[idx];
+ if (v == null) {
+ return null;
+ }
+
+ if (v instanceof String vString) {
+ return vString;
+ }
+
+ throw new ClassCastException(
+ "Field at index " + idx + " is " + v.getClass().getName() + ", expected String.");
+ }
+
+ @Override
+ public void remove() {
+ throw new UnsupportedOperationException(CONST_REMOVE);
+ }
+ }
+
+ protected static class JsonFieldIterator implements Iterator<JsonNode> {
+ private final RowIterator rowIter;
+ private final int idx;
+
+ public JsonFieldIterator(RowIterator rowIter, int idx) {
+ this.rowIter = rowIter;
+ this.idx = idx;
+ }
+
+ @Override
+ public boolean hasNext() {
+ return rowIter.hasNext();
+ }
+
+ @Override
+ public JsonNode next() {
+ Object[] row = rowIter.next();
+ if (row == null || row.length <= idx) {
+ return null;
+ }
+ Object v = row[idx];
+ if (v == null) {
+ return null;
+ }
+
+ if (v instanceof JsonNode node) {
+ return node;
+ }
+
+ throw new ClassCastException(
+ "Field at index " + idx + " is " + v.getClass().getName() + ", expected JsonNode.");
+ }
+
+ @Override
+ public void remove() {
+ throw new UnsupportedOperationException(CONST_REMOVE);
+ }
+ }
+
+ protected static class RowIterator implements Iterator<Object[]> {
+
+ private final ITransform transform;
+ private final JsonInputData rowData;
+ private final ErrorHandler errorHandler;
+ private boolean gotNext;
+
+ public RowIterator(ITransform transform, JsonInputData data, ErrorHandler errorHandler) {
+ this.transform = transform;
+ this.rowData = data;
+ this.errorHandler = errorHandler;
+ gotNext = data.readrow != null;
+ }
+
+ protected void fetchNext() {
+ try {
+ rowData.readrow = transform.getRow();
+ gotNext = true;
+ } catch (HopException e) {
+ errorHandler.error(e);
+ }
+ }
+
+ @Override
+ public boolean hasNext() {
+ if (!gotNext) {
+ fetchNext();
+ }
+ return rowData.readrow != null;
+ }
+
+ @Override
+ public Object[] next() {
+ if (hasNext()) {
+ gotNext = false;
+ return rowData.readrow;
+ }
+ return null;
+ }
+
+ @Override
+ public void remove() {
+ throw new UnsupportedOperationException(CONST_REMOVE);
+ }
+ }
+}
diff --git a/plugins/transforms/json/src/main/resources/json-normalize-input.svg b/plugins/transforms/json/src/main/resources/json-normalize-input.svg
new file mode 100644
index 0000000000..2c0eb4df3a
--- /dev/null
+++ b/plugins/transforms/json/src/main/resources/json-normalize-input.svg
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="42px" height="42px" viewBox="0 0 42 42">
+<path fill="#EFF9FE" d="M32.295,10.051h-22.3v22.301h14.128l8.172-8.172V10.051z"/>
+<polygon fill="#0F3B5A" points="37.26,32.836 37.26,35.918 32.035,30.693 30.691,32.037 35.918,37.264 32.771,37.264 32.771,39.164
+ 39.161,39.161 39.161,32.836 "/>
+<polygon fill="#0F3B5A" points="9.995,10.051 32.295,10.051 32.295,24.18 33.995,22.48 33.995,8.352 8.295,8.352 8.295,34.051
+ 22.424,34.051 24.123,32.352 9.995,32.352 "/>
+<path fill="#BF03B8" d="M17.64,29.693c-1.184,0-2.053-0.263-2.606-0.79c-0.553-0.526-0.829-1.385-0.829-2.574v-2.868
+ c0-1.27-0.504-1.904-1.514-1.904v-1.561c1.008,0,1.513-0.668,1.514-2.006v-2.684c0-1.177,0.281-2.044,0.843-2.604
+ c0.562-0.56,1.427-0.841,2.592-0.842v1.601c-1.035,0-1.553,0.614-1.553,1.845v2.705c0,1.458-0.482,2.37-1.445,2.734v0.041
+ c0.963,0.325,1.445,1.217,1.445,2.675v2.696c0,0.669,0.118,1.158,0.355,1.467c0.236,0.311,0.637,0.466,1.2,0.467L17.64,29.693
+ L17.64,29.693z"/>
+<path fill="#BF03B8" d="M23.188,17.433c0.001-1.129-0.874-2.043-1.956-2.044c-1.082,0-1.957,0.914-1.958,2.043c0,0,0,0,0,0.001
+ c0,1.128,0.876,2.044,1.957,2.044C22.312,19.477,23.188,18.562,23.188,17.433z"/>
+<path fill="#BF03B8" d="M24.649,29.693c1.185,0,2.053-0.263,2.605-0.79c0.554-0.526,0.83-1.385,0.828-2.574v-2.868
+ c0-1.27,0.506-1.904,1.515-1.904v-1.561c-1.009,0-1.513-0.668-1.515-2.006v-2.684c0-1.177-0.28-2.044-0.842-2.604
+ c-0.563-0.561-1.428-0.841-2.594-0.842v1.601c1.036,0,1.555,0.614,1.555,1.845v2.705c0,1.458,0.48,2.37,1.444,2.734v0.041
+ c-0.964,0.325-1.444,1.217-1.444,2.675v2.696c0,0.669-0.118,1.158-0.355,1.467c-0.236,0.311-0.637,0.467-1.2,0.469L24.649,29.693
+ L24.649,29.693z"/>
+<path fill="#BF03B8" d="M23.204,24.362c0.001-1.129-0.874-2.044-1.957-2.044c-1.081-0.002-1.957,0.911-1.958,2.041
+ c0,0.002,0,0.002,0,0.003c0.001,1.129,0.878,2.043,1.958,2.041C22.326,26.403,23.204,25.49,23.204,24.362z"/>
+</svg>
diff --git a/plugins/transforms/json/src/main/resources/org/apache/hop/pipeline/transforms/jsoninput/messages/messages_en_US.properties b/plugins/transforms/json/src/main/resources/org/apache/hop/pipeline/transforms/jsoninput/messages/messages_en_US.properties
index 0ebb97e910..21b398cc16 100644
--- a/plugins/transforms/json/src/main/resources/org/apache/hop/pipeline/transforms/jsoninput/messages/messages_en_US.properties
+++ b/plugins/transforms/json/src/main/resources/org/apache/hop/pipeline/transforms/jsoninput/messages/messages_en_US.properties
@@ -17,7 +17,7 @@
#
JsonInput.category=Input
-JsonInput.description=Extract relevant portions out of JSON structures (file or incoming field) and output rows
+JsonInput.description=Extract JSON (file or field) with one JsonPath per output field. For an array of records flattened into dotted columns, one row per element, use JSON Normalize Input instead.
JsonInput.Error.BadStructure=The data structure is not the same inside the resource\! We found {0} values for json path [{1}], which is different that the number returned for path [{2}] ({3} values). We MUST have the same number of values for all paths.
JsonInput.Error.FileSizeZero=File [{0}] is empty\!
JsonInput.ErrorInTransformRunning=Error running transform\! {0}
diff --git a/plugins/transforms/json/src/main/resources/org/apache/hop/pipeline/transforms/jsonnormalize/messages/messages_en_US.properties b/plugins/transforms/json/src/main/resources/org/apache/hop/pipeline/transforms/jsonnormalize/messages/messages_en_US.properties
new file mode 100644
index 0000000000..0b1c2f9b97
--- /dev/null
+++ b/plugins/transforms/json/src/main/resources/org/apache/hop/pipeline/transforms/jsonnormalize/messages/messages_en_US.properties
@@ -0,0 +1,38 @@
+#
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+JsonNormalizeInput.name=JSON normalize input
+JsonNormalizeInput.description=Read JSON (files or fields), select a record array with JsonPath, flatten nested objects to dotted column paths, one row per array element. Use JSON Input when each column has its own JsonPath; use this transform to turn an array of similar records into wide rows.
+JsonNormalizeInputMeta.keyword=json,normalize,flatten,ndjson,path
+
+JsonNormalizeInputDialog.DialogTitle=JSON normalize input
+JsonNormalizeInputDialog.RecordPath.Label=Record JsonPath
+JsonNormalizeInputDialog.RecordPath.Tooltip=JsonPath that evaluates to the array of records to flatten (e.g. $.items[*] or $.store.book[*]).
+JsonNormalizeInputDialog.FieldSeparator.Label=Field separator
+JsonNormalizeInputDialog.MaxFlattenDepth.Label=Max flatten depth (-1 = unlimited)
+JsonNormalizeInputDialog.ArrayHandling.Label=Array handling
+JsonNormalizeInputDialog.BeyondDepth.Label=Beyond max depth
+JsonNormalizeInputDialog.IgnoreMissingField.Label=Ignore missing field paths
+JsonNormalizeInputDialog.IgnoreMissingField.Tooltip=If a configured field path is not present in a record, output null instead of failing.
+JsonNormalizeInputDialog.GetFields.Error=Could not derive fields from the sample JSON.
+
+JsonNormalizeInputMeta.CheckResult.NoInputField=At least one output field is required.
+JsonNormalizeInputMeta.CheckResult.NoRecordPath=A record JsonPath is required (e.g. $ or $.items).
+
+JsonNormalizeInput.ErrorInTransformRunning=Error running JSON normalize input\: {0}
+JsonNormalizeInput.Error.MissingPath=Required flatten path ''{0}'' is missing in record.
diff --git a/plugins/transforms/json/src/main/samples/data/json-normalize-complex-transactions.json b/plugins/transforms/json/src/main/samples/data/json-normalize-complex-transactions.json
new file mode 100644
index 0000000000..2a0b586448
--- /dev/null
+++ b/plugins/transforms/json/src/main/samples/data/json-normalize-complex-transactions.json
@@ -0,0 +1,6070 @@
+{
+ "schemaHint": "payments.transactions[*] \u2014 nested payer/merchant/settlement/analytics; lineItems kept as JSON array",
+ "transactions": [
+ {
+ "txId": "TX-00001",
+ "occurredAt": "2026-01-01T00:03:00Z",
+ "grossAmount": 227.08,
+ "currency": "GBP",
+ "status": "AUTHORIZED",
+ "channel": "web",
+ "deviceType": "terminal",
+ "payer": {
+ "firstName": "Bjorn",
+ "lastName": "Nielsen",
+ "email": "bjorn.nielsen0@example.test",
+ "address": {
+ "line1": "9 Oak St",
+ "city": "Porto",
+ "region": "N",
+ "postalCode": "4000",
+ "countryCode": "PT"
+ }
+ },
+ "merchant": {
+ "id": "M-FASH",
+ "displayName": "River Fashion Co",
+ "mcc": "5691"
+ },
+ "settlement": {
+ "accountLast4": "2535",
+ "bankCode": "BK-EU-01"
+ },
+ "analytics": {
+ "campaign": "loyalty_boost",
+ "utmSource": null,
+ "segment": "new"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-4257",
+ "qty": 5,
+ "unitPrice": 56.77
+ },
+ {
+ "sku": "SKU-4611",
+ "qty": 4,
+ "unitPrice": 75.69
+ },
+ {
+ "sku": "SKU-1106",
+ "qty": 2,
+ "unitPrice": 56.77
+ }
+ ],
+ "risk": {
+ "tier": "low",
+ "fraudScore": 27
+ }
+ },
+ {
+ "txId": "TX-00002",
+ "occurredAt": "2026-01-01T00:18:00Z",
+ "grossAmount": 362.17,
+ "currency": "USD",
+ "status": "CAPTURED",
+ "channel": "web",
+ "deviceType": "terminal",
+ "payer": {
+ "firstName": "Fatima",
+ "lastName": "Patel",
+ "email": "fatima.patel1@example.test",
+ "address": {
+ "line1": "138 Oak St",
+ "city": "Amsterdam",
+ "region": "NH",
+ "postalCode": "1011",
+ "countryCode": "NL"
+ }
+ },
+ "merchant": {
+ "id": "M-FUEL",
+ "displayName": "Northwind Fuel",
+ "mcc": "5541"
+ },
+ "settlement": {
+ "accountLast4": "7201",
+ "bankCode": "BK-EU-01"
+ },
+ "analytics": {
+ "campaign": null,
+ "utmSource": null,
+ "segment": "vip"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-4150",
+ "qty": 1,
+ "unitPrice": 362.17
+ },
+ {
+ "sku": "SKU-4733",
+ "qty": 3,
+ "unitPrice": 362.17
+ },
+ {
+ "sku": "SKU-4814",
+ "qty": 1,
+ "unitPrice": 90.54
+ }
+ ],
+ "risk": {
+ "tier": "high",
+ "fraudScore": 46
+ }
+ },
+ {
+ "txId": "TX-00003",
+ "occurredAt": "2026-01-01T00:44:00Z",
+ "grossAmount": 270.63,
+ "currency": "GBP",
+ "status": "DECLINED",
+ "channel": "web",
+ "deviceType": "phone",
+ "payer": {
+ "firstName": "Chen",
+ "lastName": "Yamamoto",
+ "email": "chen.yamamoto2@example.test",
+ "address": {
+ "line1": "137 Cedar St",
+ "city": "Lyon",
+ "region": "ARA",
+ "postalCode": "69001",
+ "countryCode": "FR"
+ }
+ },
+ "merchant": {
+ "id": "M-TECH",
+ "displayName": "TechVault Electronics",
+ "mcc": "5732"
+ },
+ "settlement": {
+ "accountLast4": "5010",
+ "bankCode": "BK-EU-01"
+ },
+ "analytics": {
+ "campaign": "black_friday",
+ "utmSource": "social",
+ "segment": "vip"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-4598",
+ "qty": 3,
+ "unitPrice": 270.63
+ },
+ {
+ "sku": "SKU-4752",
+ "qty": 1,
+ "unitPrice": 90.21
+ },
+ {
+ "sku": "SKU-7572",
+ "qty": 3,
+ "unitPrice": 270.63
+ }
+ ],
+ "risk": {
+ "tier": "high",
+ "fraudScore": 91
+ }
+ },
+ {
+ "txId": "TX-00004",
+ "occurredAt": "2026-01-01T00:57:00Z",
+ "grossAmount": 885.25,
+ "currency": "EUR",
+ "status": "CAPTURED",
+ "channel": "pos",
+ "deviceType": "phone",
+ "payer": {
+ "firstName": "Fatima",
+ "lastName": "Kowalski",
+ "email": "fatima.kowalski3@example.test",
+ "address": {
+ "line1": "64 Cedar St",
+ "city": "Porto",
+ "region": "N",
+ "postalCode": "4000",
+ "countryCode": "PT"
+ }
+ },
+ "merchant": {
+ "id": "M-FUEL",
+ "displayName": "Northwind Fuel",
+ "mcc": "5541"
+ },
+ "settlement": {
+ "accountLast4": "9830",
+ "bankCode": "BK-NA-02"
+ },
+ "analytics": {
+ "campaign": "black_friday",
+ "utmSource": null,
+ "segment": null
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-4593",
+ "qty": 2,
+ "unitPrice": 221.31
+ },
+ {
+ "sku": "SKU-2489",
+ "qty": 1,
+ "unitPrice": 885.25
+ }
+ ],
+ "risk": {
+ "tier": "low",
+ "fraudScore": 87
+ }
+ },
+ {
+ "txId": "TX-00005",
+ "occurredAt": "2026-01-01T01:14:00Z",
+ "grossAmount": 597.9,
+ "currency": "USD",
+ "status": "CAPTURED",
+ "channel": "web",
+ "deviceType": "desktop",
+ "payer": {
+ "firstName": "Gustav",
+ "lastName": "Dubois",
+ "email": "gustav.dubois4@example.test",
+ "address": {
+ "line1": "175 Cedar St",
+ "city": "Amsterdam",
+ "region": "NH",
+ "postalCode": "1011",
+ "countryCode": "NL"
+ }
+ },
+ "merchant": {
+ "id": "M-FUEL",
+ "displayName": "Northwind Fuel",
+ "mcc": "5541"
+ },
+ "settlement": {
+ "accountLast4": "5371",
+ "bankCode": "BK-UK-03"
+ },
+ "analytics": {
+ "campaign": null,
+ "utmSource": "email",
+ "segment": "vip"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-3591",
+ "qty": 4,
+ "unitPrice": 597.9
+ },
+ {
+ "sku": "SKU-5315",
+ "qty": 5,
+ "unitPrice": 298.95
+ }
+ ],
+ "risk": {
+ "tier": "low",
+ "fraudScore": 80
+ }
+ },
+ {
+ "txId": "TX-00006",
+ "occurredAt": "2026-01-01T01:27:00Z",
+ "grossAmount": 377.03,
+ "currency": "GBP",
+ "status": "CAPTURED",
+ "channel": "web",
+ "deviceType": "tablet",
+ "payer": {
+ "firstName": "Eduardo",
+ "lastName": "Rossi",
+ "email": "eduardo.rossi5@example.test",
+ "address": {
+ "line1": "126 Oak St",
+ "city": "Dublin",
+ "region": "L",
+ "postalCode": "D02",
+ "countryCode": "IE"
+ }
+ },
+ "merchant": {
+ "id": "M-TECH",
+ "displayName": "TechVault Electronics",
+ "mcc": "5732"
+ },
+ "settlement": {
+ "accountLast4": "2832",
+ "bankCode": "BK-NA-02"
+ },
+ "analytics": {
+ "campaign": null,
+ "utmSource": "organic",
+ "segment": "new"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-2290",
+ "qty": 1,
+ "unitPrice": 94.26
+ }
+ ],
+ "risk": {
+ "tier": "high",
+ "fraudScore": 98
+ }
+ },
+ {
+ "txId": "TX-00007",
+ "occurredAt": "2026-01-01T01:50:00Z",
+ "grossAmount": 169.29,
+ "currency": "GBP",
+ "status": "CAPTURED",
+ "channel": "kiosk",
+ "deviceType": "phone",
+ "payer": {
+ "firstName": "Chen",
+ "lastName": "Silva",
+ "email": "chen.silva6@example.test",
+ "address": {
+ "line1": "139 Cedar St",
+ "city": "Porto",
+ "region": "N",
+ "postalCode": "4000",
+ "countryCode": "PT"
+ }
+ },
+ "merchant": {
+ "id": "M-FUEL",
+ "displayName": "Northwind Fuel",
+ "mcc": "5541"
+ },
+ "settlement": {
+ "accountLast4": "4295",
+ "bankCode": "BK-UK-03"
+ },
+ "analytics": {
+ "campaign": null,
+ "utmSource": "social",
+ "segment": "vip"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-9479",
+ "qty": 4,
+ "unitPrice": 169.29
+ },
+ {
+ "sku": "SKU-5061",
+ "qty": 2,
+ "unitPrice": 169.29
+ }
+ ],
+ "risk": {
+ "tier": "high",
+ "fraudScore": 70
+ }
+ },
+ {
+ "txId": "TX-00008",
+ "occurredAt": "2026-01-01T02:00:00Z",
+ "grossAmount": 709.29,
+ "currency": "EUR",
+ "status": "CAPTURED",
+ "channel": "web",
+ "deviceType": "tablet",
+ "payer": {
+ "firstName": "Dina",
+ "lastName": "Dubois",
+ "email": "dina.dubois7@example.test",
+ "address": {
+ "line1": "19 Cedar St",
+ "city": "Berlin",
+ "region": "BE",
+ "postalCode": "10115",
+ "countryCode": "DE"
+ }
+ },
+ "merchant": {
+ "id": "M-ACME",
+ "displayName": "Acme Groceries",
+ "mcc": "5411"
+ },
+ "settlement": {
+ "accountLast4": "4899",
+ "bankCode": "BK-NA-02"
+ },
+ "analytics": {
+ "campaign": "black_friday",
+ "utmSource": "organic",
+ "segment": "returning"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-8744",
+ "qty": 2,
+ "unitPrice": 177.32
+ },
+ {
+ "sku": "SKU-7669",
+ "qty": 2,
+ "unitPrice": 709.29
+ },
+ {
+ "sku": "SKU-2588",
+ "qty": 4,
+ "unitPrice": 236.43
+ }
+ ],
+ "risk": {
+ "tier": "medium",
+ "fraudScore": 93
+ }
+ },
+ {
+ "txId": "TX-00009",
+ "occurredAt": "2026-01-01T02:27:00Z",
+ "grossAmount": 342.6,
+ "currency": "EUR",
+ "status": "REFUNDED",
+ "channel": "mobile_app",
+ "deviceType": "phone",
+ "payer": {
+ "firstName": "Aisha",
+ "lastName": "Patel",
+ "email": "aisha.patel8@example.test",
+ "address": {
+ "line1": "138 Maple St",
+ "city": "Amsterdam",
+ "region": "NH",
+ "postalCode": "1011",
+ "countryCode": "NL"
+ }
+ },
+ "merchant": {
+ "id": "M-FUEL",
+ "displayName": "Northwind Fuel",
+ "mcc": "5541"
+ },
+ "settlement": {
+ "accountLast4": "3296",
+ "bankCode": "BK-NA-02"
+ },
+ "analytics": {
+ "campaign": "loyalty_boost",
+ "utmSource": "partner",
+ "segment": null
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-2235",
+ "qty": 4,
+ "unitPrice": 342.6
+ }
+ ]
+ },
+ {
+ "txId": "TX-00010",
+ "occurredAt": "2026-01-01T02:35:00Z",
+ "grossAmount": 409.37,
+ "currency": "USD",
+ "status": "CAPTURED",
+ "channel": "web",
+ "deviceType": "phone",
+ "payer": {
+ "firstName": "Ivan",
+ "lastName": "Nielsen",
+ "email": "ivan.nielsen9@example.test",
+ "address": {
+ "line1": "98 Oak St",
+ "city": "Amsterdam",
+ "region": "NH",
+ "postalCode": "1011",
+ "countryCode": "NL"
+ }
+ },
+ "merchant": {
+ "id": "M-TECH",
+ "displayName": "TechVault Electronics",
+ "mcc": "5732"
+ },
+ "settlement": {
+ "accountLast4": "7396",
+ "bankCode": "BK-NA-02"
+ },
+ "analytics": {
+ "campaign": "black_friday",
+ "utmSource": "partner",
+ "segment": null
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-8973",
+ "qty": 2,
+ "unitPrice": 204.69
+ },
+ {
+ "sku": "SKU-5861",
+ "qty": 2,
+ "unitPrice": 409.37
+ },
+ {
+ "sku": "SKU-9883",
+ "qty": 1,
+ "unitPrice": 136.46
+ }
+ ]
+ },
+ {
+ "txId": "TX-00011",
+ "occurredAt": "2026-01-01T02:50:00Z",
+ "grossAmount": 960.97,
+ "currency": "EUR",
+ "status": "CAPTURED",
+ "channel": "web",
+ "deviceType": "desktop",
+ "payer": {
+ "firstName": "Julia",
+ "lastName": "Novak",
+ "email": "julia.novak10@example.test",
+ "address": {
+ "line1": "173 Oak St",
+ "city": "Dublin",
+ "region": "L",
+ "postalCode": "D02",
+ "countryCode": "IE"
+ }
+ },
+ "merchant": {
+ "id": "M-TECH",
+ "displayName": "TechVault Electronics",
+ "mcc": "5732"
+ },
+ "settlement": {
+ "accountLast4": "7615",
+ "bankCode": "BK-EU-01"
+ },
+ "analytics": {
+ "campaign": "loyalty_boost",
+ "utmSource": null,
+ "segment": "new"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-2343",
+ "qty": 4,
+ "unitPrice": 320.32
+ },
+ {
+ "sku": "SKU-5272",
+ "qty": 2,
+ "unitPrice": 320.32
+ },
+ {
+ "sku": "SKU-4910",
+ "qty": 3,
+ "unitPrice": 240.24
+ }
+ ],
+ "risk": {
+ "tier": "high",
+ "fraudScore": 38
+ }
+ },
+ {
+ "txId": "TX-00012",
+ "occurredAt": "2026-01-01T03:14:00Z",
+ "grossAmount": 623.04,
+ "currency": "EUR",
+ "status": "CAPTURED",
+ "channel": "web",
+ "deviceType": "phone",
+ "payer": {
+ "firstName": "Hana",
+ "lastName": "Yamamoto",
+ "email": "hana.yamamoto11@example.test",
+ "address": {
+ "line1": "130 Maple St",
+ "city": "Amsterdam",
+ "region": "NH",
+ "postalCode": "1011",
+ "countryCode": "NL"
+ }
+ },
+ "merchant": {
+ "id": "M-ACME",
+ "displayName": "Acme Groceries",
+ "mcc": "5411"
+ },
+ "settlement": {
+ "accountLast4": "3170",
+ "bankCode": "BK-NA-02"
+ },
+ "analytics": {
+ "campaign": "spring_sale",
+ "utmSource": "organic",
+ "segment": "vip"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-3584",
+ "qty": 4,
+ "unitPrice": 207.68
+ },
+ {
+ "sku": "SKU-9666",
+ "qty": 1,
+ "unitPrice": 207.68
+ }
+ ],
+ "risk": {
+ "tier": "low",
+ "fraudScore": 17
+ }
+ },
+ {
+ "txId": "TX-00013",
+ "occurredAt": "2026-01-01T03:28:00Z",
+ "grossAmount": 285.34,
+ "currency": "USD",
+ "status": "CAPTURED",
+ "channel": "mobile_app",
+ "deviceType": "tablet",
+ "payer": {
+ "firstName": "Eduardo",
+ "lastName": "Patel",
+ "email": "eduardo.patel12@example.test",
+ "address": {
+ "line1": "130 Maple St",
+ "city": "Amsterdam",
+ "region": "NH",
+ "postalCode": "1011",
+ "countryCode": "NL"
+ }
+ },
+ "merchant": {
+ "id": "M-TECH",
+ "displayName": "TechVault Electronics",
+ "mcc": "5732"
+ },
+ "settlement": {
+ "accountLast4": "5114",
+ "bankCode": "BK-EU-01"
+ },
+ "analytics": {
+ "campaign": "spring_sale",
+ "utmSource": "social",
+ "segment": "vip"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-1058",
+ "qty": 3,
+ "unitPrice": 142.67
+ }
+ ],
+ "risk": {
+ "tier": "medium",
+ "fraudScore": 20
+ }
+ },
+ {
+ "txId": "TX-00014",
+ "occurredAt": "2026-01-01T03:49:00Z",
+ "grossAmount": 14.61,
+ "currency": "GBP",
+ "status": "CAPTURED",
+ "channel": "mobile_app",
+ "deviceType": "desktop",
+ "payer": {
+ "firstName": "Hana",
+ "lastName": "Rossi",
+ "email": "hana.rossi13@example.test",
+ "address": {
+ "line1": "95 Cedar St",
+ "city": "Porto",
+ "region": "N",
+ "postalCode": "4000",
+ "countryCode": "PT"
+ }
+ },
+ "merchant": {
+ "id": "M-FUEL",
+ "displayName": "Northwind Fuel",
+ "mcc": "5541"
+ },
+ "settlement": {
+ "accountLast4": "3426",
+ "bankCode": "BK-NA-02"
+ },
+ "analytics": {
+ "campaign": "loyalty_boost",
+ "utmSource": "email",
+ "segment": "vip"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-1653",
+ "qty": 3,
+ "unitPrice": 7.3
+ },
+ {
+ "sku": "SKU-5088",
+ "qty": 1,
+ "unitPrice": 4.87
+ }
+ ],
+ "risk": {
+ "tier": "medium",
+ "fraudScore": 79
+ }
+ },
+ {
+ "txId": "TX-00015",
+ "occurredAt": "2026-01-01T04:12:00Z",
+ "grossAmount": 415.22,
+ "currency": "USD",
+ "status": "CAPTURED",
+ "channel": "kiosk",
+ "deviceType": "phone",
+ "payer": {
+ "firstName": "Chen",
+ "lastName": "Kowalski",
+ "email": "chen.kowalski14@example.test",
+ "address": {
+ "line1": "69 Oak St",
+ "city": "Berlin",
+ "region": "BE",
+ "postalCode": "10115",
+ "countryCode": "DE"
+ }
+ },
+ "merchant": {
+ "id": "M-TECH",
+ "displayName": "TechVault Electronics",
+ "mcc": "5732"
+ },
+ "settlement": {
+ "accountLast4": "2771",
+ "bankCode": "BK-NA-02"
+ },
+ "analytics": {
+ "campaign": "spring_sale",
+ "utmSource": "social",
+ "segment": "returning"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-8541",
+ "qty": 3,
+ "unitPrice": 138.41
+ }
+ ],
+ "risk": {
+ "tier": "low",
+ "fraudScore": 28
+ }
+ },
+ {
+ "txId": "TX-00016",
+ "occurredAt": "2026-01-01T04:19:00Z",
+ "grossAmount": 865.02,
+ "currency": "USD",
+ "status": "DECLINED",
+ "channel": "pos",
+ "deviceType": "terminal",
+ "payer": {
+ "firstName": "Aisha",
+ "lastName": "Kowalski",
+ "email": "aisha.kowalski15@example.test",
+ "address": {
+ "line1": "174 Cedar St",
+ "city": "Milan",
+ "region": "LOM",
+ "postalCode": "20121",
+ "countryCode": "IT"
+ }
+ },
+ "merchant": {
+ "id": "M-FASH",
+ "displayName": "River Fashion Co",
+ "mcc": "5691"
+ },
+ "settlement": {
+ "accountLast4": "6425",
+ "bankCode": "BK-EU-01"
+ },
+ "analytics": {
+ "campaign": "spring_sale",
+ "utmSource": "partner",
+ "segment": "returning"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-5349",
+ "qty": 1,
+ "unitPrice": 865.02
+ },
+ {
+ "sku": "SKU-8119",
+ "qty": 3,
+ "unitPrice": 288.34
+ },
+ {
+ "sku": "SKU-8149",
+ "qty": 5,
+ "unitPrice": 865.02
+ }
+ ],
+ "risk": {
+ "tier": "high",
+ "fraudScore": 24
+ }
+ },
+ {
+ "txId": "TX-00017",
+ "occurredAt": "2026-01-01T04:32:00Z",
+ "grossAmount": 522.31,
+ "currency": "GBP",
+ "status": "AUTHORIZED",
+ "channel": "mobile_app",
+ "deviceType": "tablet",
+ "payer": {
+ "firstName": "Eduardo",
+ "lastName": "Nielsen",
+ "email": "eduardo.nielsen16@example.test",
+ "address": {
+ "line1": "111 Oak St",
+ "city": "Porto",
+ "region": "N",
+ "postalCode": "4000",
+ "countryCode": "PT"
+ }
+ },
+ "merchant": {
+ "id": "M-FUEL",
+ "displayName": "Northwind Fuel",
+ "mcc": "5541"
+ },
+ "settlement": {
+ "accountLast4": "6409",
+ "bankCode": "BK-UK-03"
+ },
+ "analytics": {
+ "campaign": null,
+ "utmSource": "email",
+ "segment": "vip"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-6067",
+ "qty": 4,
+ "unitPrice": 174.1
+ },
+ {
+ "sku": "SKU-7592",
+ "qty": 3,
+ "unitPrice": 261.15
+ },
+ {
+ "sku": "SKU-4143",
+ "qty": 4,
+ "unitPrice": 130.58
+ }
+ ],
+ "risk": {
+ "tier": "low",
+ "fraudScore": 78
+ }
+ },
+ {
+ "txId": "TX-00018",
+ "occurredAt": "2026-01-01T04:53:00Z",
+ "grossAmount": 290.47,
+ "currency": "GBP",
+ "status": "CAPTURED",
+ "channel": "pos",
+ "deviceType": "terminal",
+ "payer": {
+ "firstName": "Julia",
+ "lastName": "Garcia",
+ "email": "julia.garcia17@example.test",
+ "address": {
+ "line1": "114 Maple St",
+ "city": "Milan",
+ "region": "LOM",
+ "postalCode": "20121",
+ "countryCode": "IT"
+ }
+ },
+ "merchant": {
+ "id": "M-ACME",
+ "displayName": "Acme Groceries",
+ "mcc": "5411"
+ },
+ "settlement": {
+ "accountLast4": "4501",
+ "bankCode": "BK-UK-03"
+ },
+ "analytics": {
+ "campaign": "black_friday",
+ "utmSource": "organic",
+ "segment": "new"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-9445",
+ "qty": 5,
+ "unitPrice": 96.82
+ },
+ {
+ "sku": "SKU-2530",
+ "qty": 2,
+ "unitPrice": 96.82
+ }
+ ],
+ "risk": {
+ "tier": "low",
+ "fraudScore": 18
+ }
+ },
+ {
+ "txId": "TX-00019",
+ "occurredAt": "2026-01-01T05:15:00Z",
+ "grossAmount": 850.48,
+ "currency": "USD",
+ "status": "CAPTURED",
+ "channel": "mobile_app",
+ "deviceType": "terminal",
+ "payer": {
+ "firstName": "Aisha",
+ "lastName": "Nielsen",
+ "email": "aisha.nielsen18@example.test",
+ "address": {
+ "line1": "127 Maple St",
+ "city": "Berlin",
+ "region": "BE",
+ "postalCode": "10115",
+ "countryCode": "DE"
+ }
+ },
+ "merchant": {
+ "id": "M-FUEL",
+ "displayName": "Northwind Fuel",
+ "mcc": "5541"
+ },
+ "settlement": {
+ "accountLast4": "4997",
+ "bankCode": "BK-EU-01"
+ },
+ "analytics": {
+ "campaign": "spring_sale",
+ "utmSource": "email",
+ "segment": null
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-3881",
+ "qty": 5,
+ "unitPrice": 212.62
+ }
+ ]
+ },
+ {
+ "txId": "TX-00020",
+ "occurredAt": "2026-01-01T05:35:00Z",
+ "grossAmount": 467.31,
+ "currency": "GBP",
+ "status": "CAPTURED",
+ "channel": "pos",
+ "deviceType": "terminal",
+ "payer": {
+ "firstName": "Dina",
+ "lastName": "Patel",
+ "email": "dina.patel19@example.test",
+ "address": {
+ "line1": "157 Cedar St",
+ "city": "Milan",
+ "region": "LOM",
+ "postalCode": "20121",
+ "countryCode": "IT"
+ }
+ },
+ "merchant": {
+ "id": "M-TECH",
+ "displayName": "TechVault Electronics",
+ "mcc": "5732"
+ },
+ "settlement": {
+ "accountLast4": "9270",
+ "bankCode": "BK-NA-02"
+ },
+ "analytics": {
+ "campaign": "black_friday",
+ "utmSource": "organic",
+ "segment": null
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-5246",
+ "qty": 2,
+ "unitPrice": 155.77
+ },
+ {
+ "sku": "SKU-9540",
+ "qty": 4,
+ "unitPrice": 233.66
+ }
+ ],
+ "risk": {
+ "tier": "low",
+ "fraudScore": 91
+ }
+ },
+ {
+ "txId": "TX-00021",
+ "occurredAt": "2026-01-01T05:45:00Z",
+ "grossAmount": 893.55,
+ "currency": "EUR",
+ "status": "CAPTURED",
+ "channel": "mobile_app",
+ "deviceType": "terminal",
+ "payer": {
+ "firstName": "Eduardo",
+ "lastName": "Kowalski",
+ "email": "eduardo.kowalski20@example.test",
+ "address": {
+ "line1": "178 Oak St",
+ "city": "Lyon",
+ "region": "ARA",
+ "postalCode": "69001",
+ "countryCode": "FR"
+ }
+ },
+ "merchant": {
+ "id": "M-FASH",
+ "displayName": "River Fashion Co",
+ "mcc": "5691"
+ },
+ "settlement": {
+ "accountLast4": "4505",
+ "bankCode": "BK-EU-01"
+ },
+ "analytics": {
+ "campaign": "black_friday",
+ "utmSource": "social",
+ "segment": "vip"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-8633",
+ "qty": 4,
+ "unitPrice": 893.55
+ },
+ {
+ "sku": "SKU-4388",
+ "qty": 4,
+ "unitPrice": 223.39
+ },
+ {
+ "sku": "SKU-1320",
+ "qty": 5,
+ "unitPrice": 223.39
+ }
+ ],
+ "risk": {
+ "tier": "medium",
+ "fraudScore": 38
+ }
+ },
+ {
+ "txId": "TX-00022",
+ "occurredAt": "2026-01-01T06:04:00Z",
+ "grossAmount": 223.31,
+ "currency": "EUR",
+ "status": "CAPTURED",
+ "channel": "kiosk",
+ "deviceType": "tablet",
+ "payer": {
+ "firstName": "Gustav",
+ "lastName": "\u00d6zt\u00fcrk",
+ "email": "gustav.\u00f6zt\u00fcrk21@example.test",
+ "address": {
+ "line1": "172 Cedar St",
+ "city": "Dublin",
+ "region": "L",
+ "postalCode": "D02",
+ "countryCode": "IE"
+ }
+ },
+ "merchant": {
+ "id": "M-TECH",
+ "displayName": "TechVault Electronics",
+ "mcc": "5732"
+ },
+ "settlement": {
+ "accountLast4": "7624",
+ "bankCode": "BK-UK-03"
+ },
+ "analytics": {
+ "campaign": "loyalty_boost",
+ "utmSource": "social",
+ "segment": "returning"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-9751",
+ "qty": 1,
+ "unitPrice": 55.83
+ },
+ {
+ "sku": "SKU-1444",
+ "qty": 1,
+ "unitPrice": 55.83
+ },
+ {
+ "sku": "SKU-3223",
+ "qty": 4,
+ "unitPrice": 111.66
+ }
+ ]
+ },
+ {
+ "txId": "TX-00023",
+ "occurredAt": "2026-01-01T06:19:00Z",
+ "grossAmount": 340.8,
+ "currency": "USD",
+ "status": "REFUNDED",
+ "channel": "kiosk",
+ "deviceType": "tablet",
+ "payer": {
+ "firstName": "Gustav",
+ "lastName": "Yamamoto",
+ "email": "gustav.yamamoto22@example.test",
+ "address": {
+ "line1": "21 Maple St",
+ "city": "Berlin",
+ "region": "BE",
+ "postalCode": "10115",
+ "countryCode": "DE"
+ }
+ },
+ "merchant": {
+ "id": "M-FUEL",
+ "displayName": "Northwind Fuel",
+ "mcc": "5541"
+ },
+ "settlement": {
+ "accountLast4": "1317",
+ "bankCode": "BK-UK-03"
+ },
+ "analytics": {
+ "campaign": "spring_sale",
+ "utmSource": "partner",
+ "segment": "returning"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-2124",
+ "qty": 1,
+ "unitPrice": 340.8
+ },
+ {
+ "sku": "SKU-5051",
+ "qty": 2,
+ "unitPrice": 340.8
+ },
+ {
+ "sku": "SKU-3496",
+ "qty": 2,
+ "unitPrice": 170.4
+ }
+ ],
+ "risk": {
+ "tier": "low",
+ "fraudScore": 72
+ }
+ },
+ {
+ "txId": "TX-00024",
+ "occurredAt": "2026-01-01T06:43:00Z",
+ "grossAmount": 372.04,
+ "currency": "GBP",
+ "status": "CAPTURED",
+ "channel": "web",
+ "deviceType": "phone",
+ "payer": {
+ "firstName": "Dina",
+ "lastName": "Novak",
+ "email": "dina.novak23@example.test",
+ "address": {
+ "line1": "80 Oak St",
+ "city": "Porto",
+ "region": "N",
+ "postalCode": "4000",
+ "countryCode": "PT"
+ }
+ },
+ "merchant": {
+ "id": "M-FASH",
+ "displayName": "River Fashion Co",
+ "mcc": "5691"
+ },
+ "settlement": {
+ "accountLast4": "1420",
+ "bankCode": "BK-NA-02"
+ },
+ "analytics": {
+ "campaign": "black_friday",
+ "utmSource": "social",
+ "segment": "returning"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-4978",
+ "qty": 1,
+ "unitPrice": 124.01
+ }
+ ],
+ "risk": {
+ "tier": "high",
+ "fraudScore": 15
+ }
+ },
+ {
+ "txId": "TX-00025",
+ "occurredAt": "2026-01-01T06:58:00Z",
+ "grossAmount": 373.71,
+ "currency": "USD",
+ "status": "CAPTURED",
+ "channel": "web",
+ "deviceType": "terminal",
+ "payer": {
+ "firstName": "Julia",
+ "lastName": "Nielsen",
+ "email": "julia.nielsen24@example.test",
+ "address": {
+ "line1": "126 Oak St",
+ "city": "Lyon",
+ "region": "ARA",
+ "postalCode": "69001",
+ "countryCode": "FR"
+ }
+ },
+ "merchant": {
+ "id": "M-FUEL",
+ "displayName": "Northwind Fuel",
+ "mcc": "5541"
+ },
+ "settlement": {
+ "accountLast4": "8102",
+ "bankCode": "BK-NA-02"
+ },
+ "analytics": {
+ "campaign": "black_friday",
+ "utmSource": "organic",
+ "segment": null
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-9548",
+ "qty": 3,
+ "unitPrice": 93.43
+ }
+ ],
+ "risk": {
+ "tier": "high",
+ "fraudScore": 75
+ }
+ },
+ {
+ "txId": "TX-00026",
+ "occurredAt": "2026-01-01T07:09:00Z",
+ "grossAmount": 882.21,
+ "currency": "USD",
+ "status": "CAPTURED",
+ "channel": "kiosk",
+ "deviceType": "tablet",
+ "payer": {
+ "firstName": "Eduardo",
+ "lastName": "Yamamoto",
+ "email": "eduardo.yamamoto25@example.test",
+ "address": {
+ "line1": "8 Maple St",
+ "city": "Berlin",
+ "region": "BE",
+ "postalCode": "10115",
+ "countryCode": "DE"
+ }
+ },
+ "merchant": {
+ "id": "M-ACME",
+ "displayName": "Acme Groceries",
+ "mcc": "5411"
+ },
+ "settlement": {
+ "accountLast4": "6325",
+ "bankCode": "BK-EU-01"
+ },
+ "analytics": {
+ "campaign": "black_friday",
+ "utmSource": "organic",
+ "segment": "vip"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-6576",
+ "qty": 3,
+ "unitPrice": 294.07
+ },
+ {
+ "sku": "SKU-1166",
+ "qty": 5,
+ "unitPrice": 441.11
+ }
+ ]
+ },
+ {
+ "txId": "TX-00027",
+ "occurredAt": "2026-01-01T07:33:00Z",
+ "grossAmount": 478.7,
+ "currency": "USD",
+ "status": "CAPTURED",
+ "channel": "web",
+ "deviceType": "desktop",
+ "payer": {
+ "firstName": "Gustav",
+ "lastName": "Novak",
+ "email": "gustav.novak26@example.test",
+ "address": {
+ "line1": "76 Oak St",
+ "city": "Dublin",
+ "region": "L",
+ "postalCode": "D02",
+ "countryCode": "IE"
+ }
+ },
+ "merchant": {
+ "id": "M-TECH",
+ "displayName": "TechVault Electronics",
+ "mcc": "5732"
+ },
+ "settlement": {
+ "accountLast4": "7625",
+ "bankCode": "BK-UK-03"
+ },
+ "analytics": {
+ "campaign": "loyalty_boost",
+ "utmSource": "partner",
+ "segment": "vip"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-9698",
+ "qty": 3,
+ "unitPrice": 119.67
+ },
+ {
+ "sku": "SKU-6419",
+ "qty": 3,
+ "unitPrice": 119.67
+ }
+ ],
+ "risk": {
+ "tier": "medium",
+ "fraudScore": 29
+ }
+ },
+ {
+ "txId": "TX-00028",
+ "occurredAt": "2026-01-01T07:50:00Z",
+ "grossAmount": 538.17,
+ "currency": "EUR",
+ "status": "AUTHORIZED",
+ "channel": "mobile_app",
+ "deviceType": "phone",
+ "payer": {
+ "firstName": "Bjorn",
+ "lastName": "Kowalski",
+ "email": "bjorn.kowalski27@example.test",
+ "address": {
+ "line1": "190 Maple St",
+ "city": "Lyon",
+ "region": "ARA",
+ "postalCode": "69001",
+ "countryCode": "FR"
+ }
+ },
+ "merchant": {
+ "id": "M-ACME",
+ "displayName": "Acme Groceries",
+ "mcc": "5411"
+ },
+ "settlement": {
+ "accountLast4": "5530",
+ "bankCode": "BK-UK-03"
+ },
+ "analytics": {
+ "campaign": null,
+ "utmSource": "email",
+ "segment": "returning"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-4727",
+ "qty": 3,
+ "unitPrice": 269.08
+ },
+ {
+ "sku": "SKU-5952",
+ "qty": 1,
+ "unitPrice": 269.08
+ }
+ ],
+ "risk": {
+ "tier": "low",
+ "fraudScore": 70
+ }
+ },
+ {
+ "txId": "TX-00029",
+ "occurredAt": "2026-01-01T07:57:00Z",
+ "grossAmount": 873.35,
+ "currency": "USD",
+ "status": "CAPTURED",
+ "channel": "kiosk",
+ "deviceType": "terminal",
+ "payer": {
+ "firstName": "Eduardo",
+ "lastName": "Silva",
+ "email": "eduardo.silva28@example.test",
+ "address": {
+ "line1": "88 Oak St",
+ "city": "Porto",
+ "region": "N",
+ "postalCode": "4000",
+ "countryCode": "PT"
+ }
+ },
+ "merchant": {
+ "id": "M-FUEL",
+ "displayName": "Northwind Fuel",
+ "mcc": "5541"
+ },
+ "settlement": {
+ "accountLast4": "1841",
+ "bankCode": "BK-NA-02"
+ },
+ "analytics": {
+ "campaign": "black_friday",
+ "utmSource": "email",
+ "segment": "new"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-9056",
+ "qty": 1,
+ "unitPrice": 873.35
+ },
+ {
+ "sku": "SKU-3485",
+ "qty": 2,
+ "unitPrice": 291.12
+ }
+ ]
+ },
+ {
+ "txId": "TX-00030",
+ "occurredAt": "2026-01-01T08:22:00Z",
+ "grossAmount": 598.14,
+ "currency": "GBP",
+ "status": "CAPTURED",
+ "channel": "kiosk",
+ "deviceType": "terminal",
+ "payer": {
+ "firstName": "Dina",
+ "lastName": "Patel",
+ "email": "dina.patel29@example.test",
+ "address": {
+ "line1": "114 Maple St",
+ "city": "Dublin",
+ "region": "L",
+ "postalCode": "D02",
+ "countryCode": "IE"
+ }
+ },
+ "merchant": {
+ "id": "M-FUEL",
+ "displayName": "Northwind Fuel",
+ "mcc": "5541"
+ },
+ "settlement": {
+ "accountLast4": "8025",
+ "bankCode": "BK-NA-02"
+ },
+ "analytics": {
+ "campaign": "spring_sale",
+ "utmSource": null,
+ "segment": "new"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-4457",
+ "qty": 3,
+ "unitPrice": 598.14
+ }
+ ],
+ "risk": {
+ "tier": "low",
+ "fraudScore": 70
+ }
+ },
+ {
+ "txId": "TX-00031",
+ "occurredAt": "2026-01-01T08:37:00Z",
+ "grossAmount": 690.91,
+ "currency": "EUR",
+ "status": "CAPTURED",
+ "channel": "mobile_app",
+ "deviceType": "tablet",
+ "payer": {
+ "firstName": "Bjorn",
+ "lastName": "Silva",
+ "email": "bjorn.silva30@example.test",
+ "address": {
+ "line1": "181 Maple St",
+ "city": "Amsterdam",
+ "region": "NH",
+ "postalCode": "1011",
+ "countryCode": "NL"
+ }
+ },
+ "merchant": {
+ "id": "M-FUEL",
+ "displayName": "Northwind Fuel",
+ "mcc": "5541"
+ },
+ "settlement": {
+ "accountLast4": "8438",
+ "bankCode": "BK-EU-01"
+ },
+ "analytics": {
+ "campaign": "loyalty_boost",
+ "utmSource": "partner",
+ "segment": "returning"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-2880",
+ "qty": 5,
+ "unitPrice": 345.45
+ },
+ {
+ "sku": "SKU-3441",
+ "qty": 3,
+ "unitPrice": 345.45
+ }
+ ]
+ },
+ {
+ "txId": "TX-00032",
+ "occurredAt": "2026-01-01T08:54:00Z",
+ "grossAmount": 128.72,
+ "currency": "GBP",
+ "status": "CAPTURED",
+ "channel": "kiosk",
+ "deviceType": "tablet",
+ "payer": {
+ "firstName": "Chen",
+ "lastName": "Garcia",
+ "email": "chen.garcia31@example.test",
+ "address": {
+ "line1": "129 Cedar St",
+ "city": "Dublin",
+ "region": "L",
+ "postalCode": "D02",
+ "countryCode": "IE"
+ }
+ },
+ "merchant": {
+ "id": "M-FASH",
+ "displayName": "River Fashion Co",
+ "mcc": "5691"
+ },
+ "settlement": {
+ "accountLast4": "9090",
+ "bankCode": "BK-NA-02"
+ },
+ "analytics": {
+ "campaign": "spring_sale",
+ "utmSource": null,
+ "segment": "new"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-6280",
+ "qty": 5,
+ "unitPrice": 42.91
+ },
+ {
+ "sku": "SKU-1423",
+ "qty": 1,
+ "unitPrice": 64.36
+ }
+ ],
+ "risk": {
+ "tier": "high",
+ "fraudScore": 75
+ }
+ },
+ {
+ "txId": "TX-00033",
+ "occurredAt": "2026-01-01T09:16:00Z",
+ "grossAmount": 757.48,
+ "currency": "GBP",
+ "status": "CAPTURED",
+ "channel": "kiosk",
+ "deviceType": "tablet",
+ "payer": {
+ "firstName": "Aisha",
+ "lastName": "Garcia",
+ "email": "aisha.garcia32@example.test",
+ "address": {
+ "line1": "47 Cedar St",
+ "city": "Dublin",
+ "region": "L",
+ "postalCode": "D02",
+ "countryCode": "IE"
+ }
+ },
+ "merchant": {
+ "id": "M-ACME",
+ "displayName": "Acme Groceries",
+ "mcc": "5411"
+ },
+ "settlement": {
+ "accountLast4": "8141",
+ "bankCode": "BK-UK-03"
+ },
+ "analytics": {
+ "campaign": "black_friday",
+ "utmSource": "email",
+ "segment": null
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-7690",
+ "qty": 3,
+ "unitPrice": 252.49
+ },
+ {
+ "sku": "SKU-2713",
+ "qty": 2,
+ "unitPrice": 252.49
+ }
+ ],
+ "risk": {
+ "tier": "medium",
+ "fraudScore": 36
+ }
+ },
+ {
+ "txId": "TX-00034",
+ "occurredAt": "2026-01-01T09:22:00Z",
+ "grossAmount": 317.93,
+ "currency": "USD",
+ "status": "CAPTURED",
+ "channel": "web",
+ "deviceType": "terminal",
+ "payer": {
+ "firstName": "Gustav",
+ "lastName": "Rossi",
+ "email": "gustav.rossi33@example.test",
+ "address": {
+ "line1": "106 Oak St",
+ "city": "Amsterdam",
+ "region": "NH",
+ "postalCode": "1011",
+ "countryCode": "NL"
+ }
+ },
+ "merchant": {
+ "id": "M-FUEL",
+ "displayName": "Northwind Fuel",
+ "mcc": "5541"
+ },
+ "settlement": {
+ "accountLast4": "4073",
+ "bankCode": "BK-UK-03"
+ },
+ "analytics": {
+ "campaign": null,
+ "utmSource": null,
+ "segment": null
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-8242",
+ "qty": 1,
+ "unitPrice": 158.97
+ },
+ {
+ "sku": "SKU-5375",
+ "qty": 5,
+ "unitPrice": 158.97
+ },
+ {
+ "sku": "SKU-5719",
+ "qty": 4,
+ "unitPrice": 79.48
+ }
+ ],
+ "risk": {
+ "tier": "high",
+ "fraudScore": 77
+ }
+ },
+ {
+ "txId": "TX-00035",
+ "occurredAt": "2026-01-01T09:46:00Z",
+ "grossAmount": 410.94,
+ "currency": "EUR",
+ "status": "CAPTURED",
+ "channel": "kiosk",
+ "deviceType": "desktop",
+ "payer": {
+ "firstName": "Dina",
+ "lastName": "Silva",
+ "email": "dina.silva34@example.test",
+ "address": {
+ "line1": "166 Oak St",
+ "city": "Lyon",
+ "region": "ARA",
+ "postalCode": "69001",
+ "countryCode": "FR"
+ }
+ },
+ "merchant": {
+ "id": "M-ACME",
+ "displayName": "Acme Groceries",
+ "mcc": "5411"
+ },
+ "settlement": {
+ "accountLast4": "9165",
+ "bankCode": "BK-UK-03"
+ },
+ "analytics": {
+ "campaign": null,
+ "utmSource": null,
+ "segment": "vip"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-8905",
+ "qty": 4,
+ "unitPrice": 205.47
+ },
+ {
+ "sku": "SKU-8483",
+ "qty": 5,
+ "unitPrice": 205.47
+ }
+ ],
+ "risk": {
+ "tier": "high",
+ "fraudScore": 65
+ }
+ },
+ {
+ "txId": "TX-00036",
+ "occurredAt": "2026-01-01T10:00:00Z",
+ "grossAmount": 934.57,
+ "currency": "EUR",
+ "status": "CAPTURED",
+ "channel": "pos",
+ "deviceType": "tablet",
+ "payer": {
+ "firstName": "Chen",
+ "lastName": "Patel",
+ "email": "chen.patel35@example.test",
+ "address": {
+ "line1": "151 Cedar St",
+ "city": "Lyon",
+ "region": "ARA",
+ "postalCode": "69001",
+ "countryCode": "FR"
+ }
+ },
+ "merchant": {
+ "id": "M-FUEL",
+ "displayName": "Northwind Fuel",
+ "mcc": "5541"
+ },
+ "settlement": {
+ "accountLast4": "9022",
+ "bankCode": "BK-EU-01"
+ },
+ "analytics": {
+ "campaign": "black_friday",
+ "utmSource": null,
+ "segment": null
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-6446",
+ "qty": 5,
+ "unitPrice": 233.64
+ },
+ {
+ "sku": "SKU-8460",
+ "qty": 3,
+ "unitPrice": 467.29
+ }
+ ],
+ "risk": {
+ "tier": "low",
+ "fraudScore": 73
+ }
+ },
+ {
+ "txId": "TX-00037",
+ "occurredAt": "2026-01-01T10:17:00Z",
+ "grossAmount": 745.97,
+ "currency": "USD",
+ "status": "CAPTURED",
+ "channel": "kiosk",
+ "deviceType": "phone",
+ "payer": {
+ "firstName": "Gustav",
+ "lastName": "Kowalski",
+ "email": "gustav.kowalski36@example.test",
+ "address": {
+ "line1": "127 Oak St",
+ "city": "Milan",
+ "region": "LOM",
+ "postalCode": "20121",
+ "countryCode": "IT"
+ }
+ },
+ "merchant": {
+ "id": "M-ACME",
+ "displayName": "Acme Groceries",
+ "mcc": "5411"
+ },
+ "settlement": {
+ "accountLast4": "3068",
+ "bankCode": "BK-UK-03"
+ },
+ "analytics": {
+ "campaign": null,
+ "utmSource": "email",
+ "segment": null
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-9617",
+ "qty": 4,
+ "unitPrice": 745.97
+ }
+ ],
+ "risk": {
+ "tier": "medium",
+ "fraudScore": 83
+ }
+ },
+ {
+ "txId": "TX-00038",
+ "occurredAt": "2026-01-01T10:34:00Z",
+ "grossAmount": 625.13,
+ "currency": "EUR",
+ "status": "CAPTURED",
+ "channel": "pos",
+ "deviceType": "terminal",
+ "payer": {
+ "firstName": "Chen",
+ "lastName": "Patel",
+ "email": "chen.patel37@example.test",
+ "address": {
+ "line1": "82 Cedar St",
+ "city": "Milan",
+ "region": "LOM",
+ "postalCode": "20121",
+ "countryCode": "IT"
+ }
+ },
+ "merchant": {
+ "id": "M-FASH",
+ "displayName": "River Fashion Co",
+ "mcc": "5691"
+ },
+ "settlement": {
+ "accountLast4": "8994",
+ "bankCode": "BK-UK-03"
+ },
+ "analytics": {
+ "campaign": "spring_sale",
+ "utmSource": null,
+ "segment": "new"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-5708",
+ "qty": 2,
+ "unitPrice": 625.13
+ }
+ ],
+ "risk": {
+ "tier": "low",
+ "fraudScore": 97
+ }
+ },
+ {
+ "txId": "TX-00039",
+ "occurredAt": "2026-01-01T11:00:00Z",
+ "grossAmount": 33.79,
+ "currency": "EUR",
+ "status": "CAPTURED",
+ "channel": "pos",
+ "deviceType": "tablet",
+ "payer": {
+ "firstName": "Bjorn",
+ "lastName": "Novak",
+ "email": "bjorn.novak38@example.test",
+ "address": {
+ "line1": "96 Maple St",
+ "city": "Berlin",
+ "region": "BE",
+ "postalCode": "10115",
+ "countryCode": "DE"
+ }
+ },
+ "merchant": {
+ "id": "M-FASH",
+ "displayName": "River Fashion Co",
+ "mcc": "5691"
+ },
+ "settlement": {
+ "accountLast4": "3385",
+ "bankCode": "BK-EU-01"
+ },
+ "analytics": {
+ "campaign": "black_friday",
+ "utmSource": null,
+ "segment": "returning"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-3868",
+ "qty": 1,
+ "unitPrice": 8.45
+ }
+ ],
+ "risk": {
+ "tier": "low",
+ "fraudScore": 63
+ }
+ },
+ {
+ "txId": "TX-00040",
+ "occurredAt": "2026-01-01T11:13:00Z",
+ "grossAmount": 257.7,
+ "currency": "EUR",
+ "status": "CAPTURED",
+ "channel": "kiosk",
+ "deviceType": "tablet",
+ "payer": {
+ "firstName": "Julia",
+ "lastName": "Silva",
+ "email": "julia.silva39@example.test",
+ "address": {
+ "line1": "174 Cedar St",
+ "city": "Berlin",
+ "region": "BE",
+ "postalCode": "10115",
+ "countryCode": "DE"
+ }
+ },
+ "merchant": {
+ "id": "M-FUEL",
+ "displayName": "Northwind Fuel",
+ "mcc": "5541"
+ },
+ "settlement": {
+ "accountLast4": "3588",
+ "bankCode": "BK-EU-01"
+ },
+ "analytics": {
+ "campaign": "black_friday",
+ "utmSource": "partner",
+ "segment": "vip"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-7951",
+ "qty": 3,
+ "unitPrice": 64.42
+ },
+ {
+ "sku": "SKU-5949",
+ "qty": 2,
+ "unitPrice": 64.42
+ },
+ {
+ "sku": "SKU-8916",
+ "qty": 1,
+ "unitPrice": 128.85
+ }
+ ],
+ "risk": {
+ "tier": "medium",
+ "fraudScore": 73
+ }
+ },
+ {
+ "txId": "TX-00041",
+ "occurredAt": "2026-01-01T11:24:00Z",
+ "grossAmount": 13.05,
+ "currency": "GBP",
+ "status": "REFUNDED",
+ "channel": "web",
+ "deviceType": "terminal",
+ "payer": {
+ "firstName": "Eduardo",
+ "lastName": "Garcia",
+ "email": "eduardo.garcia40@example.test",
+ "address": {
+ "line1": "74 Oak St",
+ "city": "Amsterdam",
+ "region": "NH",
+ "postalCode": "1011",
+ "countryCode": "NL"
+ }
+ },
+ "merchant": {
+ "id": "M-FUEL",
+ "displayName": "Northwind Fuel",
+ "mcc": "5541"
+ },
+ "settlement": {
+ "accountLast4": "6772",
+ "bankCode": "BK-EU-01"
+ },
+ "analytics": {
+ "campaign": "loyalty_boost",
+ "utmSource": null,
+ "segment": "vip"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-3240",
+ "qty": 1,
+ "unitPrice": 13.05
+ },
+ {
+ "sku": "SKU-6061",
+ "qty": 4,
+ "unitPrice": 13.05
+ },
+ {
+ "sku": "SKU-6977",
+ "qty": 2,
+ "unitPrice": 13.05
+ }
+ ],
+ "risk": {
+ "tier": "medium",
+ "fraudScore": 95
+ }
+ },
+ {
+ "txId": "TX-00042",
+ "occurredAt": "2026-01-01T11:49:00Z",
+ "grossAmount": 541.7,
+ "currency": "GBP",
+ "status": "DECLINED",
+ "channel": "pos",
+ "deviceType": "phone",
+ "payer": {
+ "firstName": "Gustav",
+ "lastName": "Silva",
+ "email": "gustav.silva41@example.test",
+ "address": {
+ "line1": "66 Maple St",
+ "city": "Berlin",
+ "region": "BE",
+ "postalCode": "10115",
+ "countryCode": "DE"
+ }
+ },
+ "merchant": {
+ "id": "M-TECH",
+ "displayName": "TechVault Electronics",
+ "mcc": "5732"
+ },
+ "settlement": {
+ "accountLast4": "5835",
+ "bankCode": "BK-UK-03"
+ },
+ "analytics": {
+ "campaign": null,
+ "utmSource": "email",
+ "segment": null
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-3306",
+ "qty": 2,
+ "unitPrice": 135.43
+ }
+ ],
+ "risk": {
+ "tier": "high",
+ "fraudScore": 46
+ }
+ },
+ {
+ "txId": "TX-00043",
+ "occurredAt": "2026-01-01T12:02:00Z",
+ "grossAmount": 127.96,
+ "currency": "GBP",
+ "status": "CAPTURED",
+ "channel": "pos",
+ "deviceType": "terminal",
+ "payer": {
+ "firstName": "Bjorn",
+ "lastName": "\u00d6zt\u00fcrk",
+ "email": "bjorn.\u00f6zt\u00fcrk42@example.test",
+ "address": {
+ "line1": "164 Maple St",
+ "city": "Amsterdam",
+ "region": "NH",
+ "postalCode": "1011",
+ "countryCode": "NL"
+ }
+ },
+ "merchant": {
+ "id": "M-FASH",
+ "displayName": "River Fashion Co",
+ "mcc": "5691"
+ },
+ "settlement": {
+ "accountLast4": "2775",
+ "bankCode": "BK-UK-03"
+ },
+ "analytics": {
+ "campaign": "loyalty_boost",
+ "utmSource": "social",
+ "segment": "new"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-6374",
+ "qty": 5,
+ "unitPrice": 63.98
+ },
+ {
+ "sku": "SKU-2035",
+ "qty": 4,
+ "unitPrice": 42.65
+ },
+ {
+ "sku": "SKU-7689",
+ "qty": 1,
+ "unitPrice": 63.98
+ }
+ ]
+ },
+ {
+ "txId": "TX-00044",
+ "occurredAt": "2026-01-01T12:12:00Z",
+ "grossAmount": 238.62,
+ "currency": "USD",
+ "status": "CAPTURED",
+ "channel": "kiosk",
+ "deviceType": "tablet",
+ "payer": {
+ "firstName": "Aisha",
+ "lastName": "Garcia",
+ "email": "aisha.garcia43@example.test",
+ "address": {
+ "line1": "172 Cedar St",
+ "city": "Milan",
+ "region": "LOM",
+ "postalCode": "20121",
+ "countryCode": "IT"
+ }
+ },
+ "merchant": {
+ "id": "M-ACME",
+ "displayName": "Acme Groceries",
+ "mcc": "5411"
+ },
+ "settlement": {
+ "accountLast4": "9850",
+ "bankCode": "BK-NA-02"
+ },
+ "analytics": {
+ "campaign": "loyalty_boost",
+ "utmSource": "social",
+ "segment": "new"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-7686",
+ "qty": 3,
+ "unitPrice": 238.62
+ },
+ {
+ "sku": "SKU-7070",
+ "qty": 2,
+ "unitPrice": 59.66
+ }
+ ],
+ "risk": {
+ "tier": "low",
+ "fraudScore": 46
+ }
+ },
+ {
+ "txId": "TX-00045",
+ "occurredAt": "2026-01-01T12:28:00Z",
+ "grossAmount": 401.14,
+ "currency": "EUR",
+ "status": "CAPTURED",
+ "channel": "kiosk",
+ "deviceType": "desktop",
+ "payer": {
+ "firstName": "Bjorn",
+ "lastName": "Yamamoto",
+ "email": "bjorn.yamamoto44@example.test",
+ "address": {
+ "line1": "170 Oak St",
+ "city": "Dublin",
+ "region": "L",
+ "postalCode": "D02",
+ "countryCode": "IE"
+ }
+ },
+ "merchant": {
+ "id": "M-FASH",
+ "displayName": "River Fashion Co",
+ "mcc": "5691"
+ },
+ "settlement": {
+ "accountLast4": "1349",
+ "bankCode": "BK-EU-01"
+ },
+ "analytics": {
+ "campaign": null,
+ "utmSource": "organic",
+ "segment": "returning"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-4362",
+ "qty": 1,
+ "unitPrice": 200.57
+ },
+ {
+ "sku": "SKU-4538",
+ "qty": 2,
+ "unitPrice": 133.71
+ },
+ {
+ "sku": "SKU-3417",
+ "qty": 5,
+ "unitPrice": 401.14
+ }
+ ],
+ "risk": {
+ "tier": "low",
+ "fraudScore": 16
+ }
+ },
+ {
+ "txId": "TX-00046",
+ "occurredAt": "2026-01-01T12:55:00Z",
+ "grossAmount": 867.11,
+ "currency": "USD",
+ "status": "CAPTURED",
+ "channel": "mobile_app",
+ "deviceType": "tablet",
+ "payer": {
+ "firstName": "Ivan",
+ "lastName": "Garcia",
+ "email": "ivan.garcia45@example.test",
+ "address": {
+ "line1": "5 Oak St",
+ "city": "Berlin",
+ "region": "BE",
+ "postalCode": "10115",
+ "countryCode": "DE"
+ }
+ },
+ "merchant": {
+ "id": "M-ACME",
+ "displayName": "Acme Groceries",
+ "mcc": "5411"
+ },
+ "settlement": {
+ "accountLast4": "5347",
+ "bankCode": "BK-EU-01"
+ },
+ "analytics": {
+ "campaign": "loyalty_boost",
+ "utmSource": "social",
+ "segment": "new"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-2041",
+ "qty": 4,
+ "unitPrice": 216.78
+ },
+ {
+ "sku": "SKU-6931",
+ "qty": 5,
+ "unitPrice": 867.11
+ },
+ {
+ "sku": "SKU-8405",
+ "qty": 5,
+ "unitPrice": 433.56
+ }
+ ],
+ "risk": {
+ "tier": "low",
+ "fraudScore": 93
+ }
+ },
+ {
+ "txId": "TX-00047",
+ "occurredAt": "2026-01-01T13:02:00Z",
+ "grossAmount": 998.58,
+ "currency": "USD",
+ "status": "REFUNDED",
+ "channel": "web",
+ "deviceType": "terminal",
+ "payer": {
+ "firstName": "Ivan",
+ "lastName": "Garcia",
+ "email": "ivan.garcia46@example.test",
+ "address": {
+ "line1": "183 Maple St",
+ "city": "Milan",
+ "region": "LOM",
+ "postalCode": "20121",
+ "countryCode": "IT"
+ }
+ },
+ "merchant": {
+ "id": "M-ACME",
+ "displayName": "Acme Groceries",
+ "mcc": "5411"
+ },
+ "settlement": {
+ "accountLast4": "2204",
+ "bankCode": "BK-EU-01"
+ },
+ "analytics": {
+ "campaign": null,
+ "utmSource": null,
+ "segment": "returning"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-3067",
+ "qty": 3,
+ "unitPrice": 332.86
+ }
+ ],
+ "risk": {
+ "tier": "high",
+ "fraudScore": 67
+ }
+ },
+ {
+ "txId": "TX-00048",
+ "occurredAt": "2026-01-01T13:20:00Z",
+ "grossAmount": 794.12,
+ "currency": "GBP",
+ "status": "CAPTURED",
+ "channel": "mobile_app",
+ "deviceType": "terminal",
+ "payer": {
+ "firstName": "Eduardo",
+ "lastName": "Novak",
+ "email": "eduardo.novak47@example.test",
+ "address": {
+ "line1": "116 Oak St",
+ "city": "Dublin",
+ "region": "L",
+ "postalCode": "D02",
+ "countryCode": "IE"
+ }
+ },
+ "merchant": {
+ "id": "M-FUEL",
+ "displayName": "Northwind Fuel",
+ "mcc": "5541"
+ },
+ "settlement": {
+ "accountLast4": "7779",
+ "bankCode": "BK-NA-02"
+ },
+ "analytics": {
+ "campaign": "black_friday",
+ "utmSource": "social",
+ "segment": null
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-2557",
+ "qty": 3,
+ "unitPrice": 198.53
+ },
+ {
+ "sku": "SKU-6120",
+ "qty": 3,
+ "unitPrice": 264.71
+ },
+ {
+ "sku": "SKU-3500",
+ "qty": 4,
+ "unitPrice": 794.12
+ }
+ ]
+ },
+ {
+ "txId": "TX-00049",
+ "occurredAt": "2026-01-01T13:47:00Z",
+ "grossAmount": 740.09,
+ "currency": "GBP",
+ "status": "AUTHORIZED",
+ "channel": "web",
+ "deviceType": "tablet",
+ "payer": {
+ "firstName": "Bjorn",
+ "lastName": "Patel",
+ "email": "bjorn.patel48@example.test",
+ "address": {
+ "line1": "172 Oak St",
+ "city": "Milan",
+ "region": "LOM",
+ "postalCode": "20121",
+ "countryCode": "IT"
+ }
+ },
+ "merchant": {
+ "id": "M-ACME",
+ "displayName": "Acme Groceries",
+ "mcc": "5411"
+ },
+ "settlement": {
+ "accountLast4": "7730",
+ "bankCode": "BK-NA-02"
+ },
+ "analytics": {
+ "campaign": "black_friday",
+ "utmSource": "email",
+ "segment": "vip"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-6119",
+ "qty": 3,
+ "unitPrice": 740.09
+ },
+ {
+ "sku": "SKU-9313",
+ "qty": 2,
+ "unitPrice": 370.05
+ },
+ {
+ "sku": "SKU-8900",
+ "qty": 2,
+ "unitPrice": 740.09
+ }
+ ],
+ "risk": {
+ "tier": "high",
+ "fraudScore": 47
+ }
+ },
+ {
+ "txId": "TX-00050",
+ "occurredAt": "2026-01-01T14:05:00Z",
+ "grossAmount": 431.96,
+ "currency": "GBP",
+ "status": "CAPTURED",
+ "channel": "web",
+ "deviceType": "tablet",
+ "payer": {
+ "firstName": "Bjorn",
+ "lastName": "Garcia",
+ "email": "bjorn.garcia49@example.test",
+ "address": {
+ "line1": "8 Oak St",
+ "city": "Dublin",
+ "region": "L",
+ "postalCode": "D02",
+ "countryCode": "IE"
+ }
+ },
+ "merchant": {
+ "id": "M-TECH",
+ "displayName": "TechVault Electronics",
+ "mcc": "5732"
+ },
+ "settlement": {
+ "accountLast4": "5477",
+ "bankCode": "BK-UK-03"
+ },
+ "analytics": {
+ "campaign": null,
+ "utmSource": "partner",
+ "segment": "vip"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-3972",
+ "qty": 2,
+ "unitPrice": 107.99
+ }
+ ]
+ },
+ {
+ "txId": "TX-00051",
+ "occurredAt": "2026-01-01T14:16:00Z",
+ "grossAmount": 422.72,
+ "currency": "USD",
+ "status": "CAPTURED",
+ "channel": "pos",
+ "deviceType": "tablet",
+ "payer": {
+ "firstName": "Aisha",
+ "lastName": "Patel",
+ "email": "aisha.patel50@example.test",
+ "address": {
+ "line1": "199 Cedar St",
+ "city": "Porto",
+ "region": "N",
+ "postalCode": "4000",
+ "countryCode": "PT"
+ }
+ },
+ "merchant": {
+ "id": "M-TECH",
+ "displayName": "TechVault Electronics",
+ "mcc": "5732"
+ },
+ "settlement": {
+ "accountLast4": "2391",
+ "bankCode": "BK-EU-01"
+ },
+ "analytics": {
+ "campaign": "loyalty_boost",
+ "utmSource": "organic",
+ "segment": "new"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-2336",
+ "qty": 3,
+ "unitPrice": 105.68
+ },
+ {
+ "sku": "SKU-7947",
+ "qty": 4,
+ "unitPrice": 105.68
+ },
+ {
+ "sku": "SKU-7785",
+ "qty": 3,
+ "unitPrice": 211.36
+ }
+ ],
+ "risk": {
+ "tier": "low",
+ "fraudScore": 44
+ }
+ },
+ {
+ "txId": "TX-00052",
+ "occurredAt": "2026-01-01T14:35:00Z",
+ "grossAmount": 668.79,
+ "currency": "USD",
+ "status": "CAPTURED",
+ "channel": "web",
+ "deviceType": "desktop",
+ "payer": {
+ "firstName": "Gustav",
+ "lastName": "Patel",
+ "email": "gustav.patel51@example.test",
+ "address": {
+ "line1": "53 Maple St",
+ "city": "Lyon",
+ "region": "ARA",
+ "postalCode": "69001",
+ "countryCode": "FR"
+ }
+ },
+ "merchant": {
+ "id": "M-FUEL",
+ "displayName": "Northwind Fuel",
+ "mcc": "5541"
+ },
+ "settlement": {
+ "accountLast4": "4460",
+ "bankCode": "BK-EU-01"
+ },
+ "analytics": {
+ "campaign": null,
+ "utmSource": "partner",
+ "segment": "vip"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-1126",
+ "qty": 4,
+ "unitPrice": 167.2
+ }
+ ],
+ "risk": {
+ "tier": "medium",
+ "fraudScore": 68
+ }
+ },
+ {
+ "txId": "TX-00053",
+ "occurredAt": "2026-01-01T14:45:00Z",
+ "grossAmount": 400.08,
+ "currency": "USD",
+ "status": "AUTHORIZED",
+ "channel": "web",
+ "deviceType": "terminal",
+ "payer": {
+ "firstName": "Dina",
+ "lastName": "Rossi",
+ "email": "dina.rossi52@example.test",
+ "address": {
+ "line1": "20 Maple St",
+ "city": "Dublin",
+ "region": "L",
+ "postalCode": "D02",
+ "countryCode": "IE"
+ }
+ },
+ "merchant": {
+ "id": "M-FASH",
+ "displayName": "River Fashion Co",
+ "mcc": "5691"
+ },
+ "settlement": {
+ "accountLast4": "8033",
+ "bankCode": "BK-UK-03"
+ },
+ "analytics": {
+ "campaign": "black_friday",
+ "utmSource": "social",
+ "segment": "vip"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-7636",
+ "qty": 1,
+ "unitPrice": 133.36
+ }
+ ],
+ "risk": {
+ "tier": "high",
+ "fraudScore": 58
+ }
+ },
+ {
+ "txId": "TX-00054",
+ "occurredAt": "2026-01-01T15:04:00Z",
+ "grossAmount": 438.49,
+ "currency": "EUR",
+ "status": "CAPTURED",
+ "channel": "kiosk",
+ "deviceType": "tablet",
+ "payer": {
+ "firstName": "Fatima",
+ "lastName": "Patel",
+ "email": "fatima.patel53@example.test",
+ "address": {
+ "line1": "191 Maple St",
+ "city": "Milan",
+ "region": "LOM",
+ "postalCode": "20121",
+ "countryCode": "IT"
+ }
+ },
+ "merchant": {
+ "id": "M-ACME",
+ "displayName": "Acme Groceries",
+ "mcc": "5411"
+ },
+ "settlement": {
+ "accountLast4": "4630",
+ "bankCode": "BK-NA-02"
+ },
+ "analytics": {
+ "campaign": "loyalty_boost",
+ "utmSource": "email",
+ "segment": "new"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-9355",
+ "qty": 2,
+ "unitPrice": 146.16
+ },
+ {
+ "sku": "SKU-6752",
+ "qty": 2,
+ "unitPrice": 219.25
+ },
+ {
+ "sku": "SKU-2684",
+ "qty": 2,
+ "unitPrice": 146.16
+ }
+ ],
+ "risk": {
+ "tier": "high",
+ "fraudScore": 19
+ }
+ },
+ {
+ "txId": "TX-00055",
+ "occurredAt": "2026-01-01T15:25:00Z",
+ "grossAmount": 755.66,
+ "currency": "USD",
+ "status": "AUTHORIZED",
+ "channel": "pos",
+ "deviceType": "tablet",
+ "payer": {
+ "firstName": "Bjorn",
+ "lastName": "Silva",
+ "email": "bjorn.silva54@example.test",
+ "address": {
+ "line1": "39 Maple St",
+ "city": "Porto",
+ "region": "N",
+ "postalCode": "4000",
+ "countryCode": "PT"
+ }
+ },
+ "merchant": {
+ "id": "M-FUEL",
+ "displayName": "Northwind Fuel",
+ "mcc": "5541"
+ },
+ "settlement": {
+ "accountLast4": "2118",
+ "bankCode": "BK-NA-02"
+ },
+ "analytics": {
+ "campaign": "black_friday",
+ "utmSource": "partner",
+ "segment": "vip"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-1920",
+ "qty": 3,
+ "unitPrice": 755.66
+ },
+ {
+ "sku": "SKU-6085",
+ "qty": 4,
+ "unitPrice": 188.91
+ },
+ {
+ "sku": "SKU-1616",
+ "qty": 1,
+ "unitPrice": 251.89
+ }
+ ],
+ "risk": {
+ "tier": "low",
+ "fraudScore": 82
+ }
+ },
+ {
+ "txId": "TX-00056",
+ "occurredAt": "2026-01-01T15:42:00Z",
+ "grossAmount": 582.42,
+ "currency": "GBP",
+ "status": "DECLINED",
+ "channel": "web",
+ "deviceType": "terminal",
+ "payer": {
+ "firstName": "Bjorn",
+ "lastName": "Dubois",
+ "email": "bjorn.dubois55@example.test",
+ "address": {
+ "line1": "147 Cedar St",
+ "city": "Dublin",
+ "region": "L",
+ "postalCode": "D02",
+ "countryCode": "IE"
+ }
+ },
+ "merchant": {
+ "id": "M-FUEL",
+ "displayName": "Northwind Fuel",
+ "mcc": "5541"
+ },
+ "settlement": {
+ "accountLast4": "4084",
+ "bankCode": "BK-NA-02"
+ },
+ "analytics": {
+ "campaign": "black_friday",
+ "utmSource": null,
+ "segment": "returning"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-8381",
+ "qty": 1,
+ "unitPrice": 194.14
+ }
+ ],
+ "risk": {
+ "tier": "low",
+ "fraudScore": 64
+ }
+ },
+ {
+ "txId": "TX-00057",
+ "occurredAt": "2026-01-01T15:59:00Z",
+ "grossAmount": 526.44,
+ "currency": "USD",
+ "status": "CAPTURED",
+ "channel": "pos",
+ "deviceType": "tablet",
+ "payer": {
+ "firstName": "Chen",
+ "lastName": "Nielsen",
+ "email": "chen.nielsen56@example.test",
+ "address": {
+ "line1": "100 Maple St",
+ "city": "Berlin",
+ "region": "BE",
+ "postalCode": "10115",
+ "countryCode": "DE"
+ }
+ },
+ "merchant": {
+ "id": "M-FUEL",
+ "displayName": "Northwind Fuel",
+ "mcc": "5541"
+ },
+ "settlement": {
+ "accountLast4": "6543",
+ "bankCode": "BK-UK-03"
+ },
+ "analytics": {
+ "campaign": "spring_sale",
+ "utmSource": "partner",
+ "segment": "new"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-2548",
+ "qty": 5,
+ "unitPrice": 131.61
+ },
+ {
+ "sku": "SKU-5655",
+ "qty": 3,
+ "unitPrice": 263.22
+ }
+ ],
+ "risk": {
+ "tier": "high",
+ "fraudScore": 84
+ }
+ },
+ {
+ "txId": "TX-00058",
+ "occurredAt": "2026-01-01T16:11:00Z",
+ "grossAmount": 597.06,
+ "currency": "USD",
+ "status": "DECLINED",
+ "channel": "kiosk",
+ "deviceType": "tablet",
+ "payer": {
+ "firstName": "Chen",
+ "lastName": "Yamamoto",
+ "email": "chen.yamamoto57@example.test",
+ "address": {
+ "line1": "33 Cedar St",
+ "city": "Lyon",
+ "region": "ARA",
+ "postalCode": "69001",
+ "countryCode": "FR"
+ }
+ },
+ "merchant": {
+ "id": "M-FUEL",
+ "displayName": "Northwind Fuel",
+ "mcc": "5541"
+ },
+ "settlement": {
+ "accountLast4": "9624",
+ "bankCode": "BK-EU-01"
+ },
+ "analytics": {
+ "campaign": "black_friday",
+ "utmSource": null,
+ "segment": "vip"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-6940",
+ "qty": 3,
+ "unitPrice": 298.53
+ }
+ ],
+ "risk": {
+ "tier": "medium",
+ "fraudScore": 98
+ }
+ },
+ {
+ "txId": "TX-00059",
+ "occurredAt": "2026-01-01T16:28:00Z",
+ "grossAmount": 81.77,
+ "currency": "EUR",
+ "status": "REFUNDED",
+ "channel": "web",
+ "deviceType": "tablet",
+ "payer": {
+ "firstName": "Hana",
+ "lastName": "Kowalski",
+ "email": "hana.kowalski58@example.test",
+ "address": {
+ "line1": "197 Cedar St",
+ "city": "Berlin",
+ "region": "BE",
+ "postalCode": "10115",
+ "countryCode": "DE"
+ }
+ },
+ "merchant": {
+ "id": "M-TECH",
+ "displayName": "TechVault Electronics",
+ "mcc": "5732"
+ },
+ "settlement": {
+ "accountLast4": "3147",
+ "bankCode": "BK-UK-03"
+ },
+ "analytics": {
+ "campaign": "black_friday",
+ "utmSource": "organic",
+ "segment": "returning"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-3712",
+ "qty": 4,
+ "unitPrice": 81.77
+ }
+ ],
+ "risk": {
+ "tier": "high",
+ "fraudScore": 92
+ }
+ },
+ {
+ "txId": "TX-00060",
+ "occurredAt": "2026-01-01T16:55:00Z",
+ "grossAmount": 749.78,
+ "currency": "GBP",
+ "status": "CAPTURED",
+ "channel": "mobile_app",
+ "deviceType": "tablet",
+ "payer": {
+ "firstName": "Dina",
+ "lastName": "Novak",
+ "email": "dina.novak59@example.test",
+ "address": {
+ "line1": "121 Oak St",
+ "city": "Dublin",
+ "region": "L",
+ "postalCode": "D02",
+ "countryCode": "IE"
+ }
+ },
+ "merchant": {
+ "id": "M-FASH",
+ "displayName": "River Fashion Co",
+ "mcc": "5691"
+ },
+ "settlement": {
+ "accountLast4": "7026",
+ "bankCode": "BK-UK-03"
+ },
+ "analytics": {
+ "campaign": "black_friday",
+ "utmSource": "social",
+ "segment": "vip"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-9239",
+ "qty": 5,
+ "unitPrice": 187.44
+ },
+ {
+ "sku": "SKU-3655",
+ "qty": 2,
+ "unitPrice": 374.89
+ }
+ ],
+ "risk": {
+ "tier": "low",
+ "fraudScore": 82
+ }
+ },
+ {
+ "txId": "TX-00061",
+ "occurredAt": "2026-01-01T17:11:00Z",
+ "grossAmount": 846.65,
+ "currency": "USD",
+ "status": "REFUNDED",
+ "channel": "web",
+ "deviceType": "phone",
+ "payer": {
+ "firstName": "Hana",
+ "lastName": "Yamamoto",
+ "email": "hana.yamamoto60@example.test",
+ "address": {
+ "line1": "70 Maple St",
+ "city": "Dublin",
+ "region": "L",
+ "postalCode": "D02",
+ "countryCode": "IE"
+ }
+ },
+ "merchant": {
+ "id": "M-ACME",
+ "displayName": "Acme Groceries",
+ "mcc": "5411"
+ },
+ "settlement": {
+ "accountLast4": "9410",
+ "bankCode": "BK-EU-01"
+ },
+ "analytics": {
+ "campaign": "black_friday",
+ "utmSource": "email",
+ "segment": "returning"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-6727",
+ "qty": 1,
+ "unitPrice": 211.66
+ },
+ {
+ "sku": "SKU-1872",
+ "qty": 4,
+ "unitPrice": 282.22
+ }
+ ],
+ "risk": {
+ "tier": "low",
+ "fraudScore": 47
+ }
+ },
+ {
+ "txId": "TX-00062",
+ "occurredAt": "2026-01-01T17:30:00Z",
+ "grossAmount": 716.12,
+ "currency": "EUR",
+ "status": "CAPTURED",
+ "channel": "mobile_app",
+ "deviceType": "desktop",
+ "payer": {
+ "firstName": "Dina",
+ "lastName": "Nielsen",
+ "email": "dina.nielsen61@example.test",
+ "address": {
+ "line1": "74 Maple St",
+ "city": "Lyon",
+ "region": "ARA",
+ "postalCode": "69001",
+ "countryCode": "FR"
+ }
+ },
+ "merchant": {
+ "id": "M-ACME",
+ "displayName": "Acme Groceries",
+ "mcc": "5411"
+ },
+ "settlement": {
+ "accountLast4": "3273",
+ "bankCode": "BK-UK-03"
+ },
+ "analytics": {
+ "campaign": "black_friday",
+ "utmSource": "social",
+ "segment": "new"
+ },
+ "lineItems": [
+ {
+ "sku": "SKU-1311",
+ "qty": 3,
+ "unitPrice": 358.06
+ }
+ ],
+ "risk": {
+ "tier": "high",
+ "fraudScore": 93
+ }
+ },
+ {
+ "txId": "TX-00063",
+ "occurredAt": "2026-01-01T17:46:00Z",
+ "grossAmount": 291.65,
+ "currency": "EUR",
+ "status": "CAPTURED",
+ "channel": "mobile_app",
+ "deviceType": "terminal",
+ "payer": {
+ "firstName": "Julia",
+ "lastName": "Rossi",
+ "email": "julia.rossi62@example.test",
+ "address": {
+ "line1": "164 Cedar St",
+ "city": "Milan",
+ "region": "LOM",
+ "postalCode": "20121",
+ "countryCode": "IT"
+ }
+ },
+ "merchant": {
+ "id": "M-ACME",
+ "displayName": "Acme Groceries",
+ "mcc": "5411"
+ },
+ "settlement": {
... 4843 lines suppressed ...