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 9fe76d43bd Issue #6569 (#6598)
9fe76d43bd is described below
commit 9fe76d43bda72ff2058f955930c6bb637ff2aa5c
Author: Matt Casters <[email protected]>
AuthorDate: Tue Feb 17 16:49:03 2026 +0100
Issue #6569 (#6598)
Co-authored-by: Matt Casters <[email protected]>
---
.../pages/pipeline/transforms/datasetinput.adoc | 47 ++++++
.../transforms/0085-data-set-input.hpl | 85 +++++++++++
.../transforms/main-0085-data-set-input.hwf | 80 ++++++++++
.../unit-test/0085-data-set-input UNIT.json | 88 +++++++++++
.../transforms/datasetinput/DataSetInput.java | 81 +++++++++++
.../transforms/datasetinput/DataSetInputData.java | 35 +++++
.../datasetinput/DataSetInputDialog.java | 161 +++++++++++++++++++++
.../transforms/datasetinput/DataSetInputMeta.java | 72 +++++++++
.../messages/messages_en_US.properties | 24 +++
9 files changed, 673 insertions(+)
diff --git
a/docs/hop-user-manual/modules/ROOT/pages/pipeline/transforms/datasetinput.adoc
b/docs/hop-user-manual/modules/ROOT/pages/pipeline/transforms/datasetinput.adoc
new file mode 100644
index 0000000000..65e4dcf3b7
--- /dev/null
+++
b/docs/hop-user-manual/modules/ROOT/pages/pipeline/transforms/datasetinput.adoc
@@ -0,0 +1,47 @@
+////
+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 Data Set Input transform allows reading from a data set in a
pipeline
+
+mage:transforms= i/icons/dataset.svg[Data Set Input transform Icon,
role="image-doc-icon"] Data Set Input
+
+[%noheader,cols="3a,1a", role="table-no-borders" ]
+|===
+|
+== Description
+
+The Data Set Input transform allows you to read from a data set in a pipeline.
This allows you to use and re-use static data in a project in various places
without having to resort to copy the information Data Grid transforms.
+
+|
+== Supported Engines
+[%noheader,cols="2,1a",frame=none, role="table-supported-engines"]
+!===
+!Hop Engine! image:check_mark.svg[Supported, 24]
+!Spark! image:check_mark.svg[Supported, 24]
+!Flink! image:check_mark.svg[Supported, 24]
+!Dataflow! image:check_mark.svg[Supported, 24]
+!===
+|===
+
+== Options
+
+[width="90%, options="header"]
+|===
+|Transform name|The name of this transform
+|Data Set Name|The name of the data set to read from
+|===
diff --git a/integration-tests/transforms/0085-data-set-input.hpl
b/integration-tests/transforms/0085-data-set-input.hpl
new file mode 100644
index 0000000000..6dc0db6bf0
--- /dev/null
+++ b/integration-tests/transforms/0085-data-set-input.hpl
@@ -0,0 +1,85 @@
+<?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>0085-data-set-input</name>
+ <name_sync_with_filename>Y</name_sync_with_filename>
+ <description/>
+ <extended_description/>
+ <pipeline_version/>
+ <pipeline_type>Normal</pipeline_type>
+ <parameters>
+ </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/02/17 15:18:48.220</created_date>
+ <modified_user>-</modified_user>
+ <modified_date>2026/02/17 15:18:48.220</modified_date>
+ </info>
+ <notepads>
+ </notepads>
+ <order>
+ <hop>
+ <from>golden-parquet-input</from>
+ <to>Validate</to>
+ <enabled>Y</enabled>
+ </hop>
+ </order>
+ <transform>
+ <name>golden-parquet-input</name>
+ <type>DataSetInput</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <dataSetName>golden-parquet-input</dataSetName>
+ <attributes/>
+ <GUI>
+ <xloc>160</xloc>
+ <yloc>96</yloc>
+ </GUI>
+ </transform>
+ <transform>
+ <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>368</xloc>
+ <yloc>96</yloc>
+ </GUI>
+ </transform>
+ <transform_error_handling>
+ </transform_error_handling>
+ <attributes/>
+</pipeline>
diff --git a/integration-tests/transforms/main-0085-data-set-input.hwf
b/integration-tests/transforms/main-0085-data-set-input.hwf
new file mode 100644
index 0000000000..fe053acafb
--- /dev/null
+++ b/integration-tests/transforms/main-0085-data-set-input.hwf
@@ -0,0 +1,80 @@
+<?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.
+
+-->
+<workflow>
+ <name>main-0085-data-set-input</name>
+ <name_sync_with_filename>Y</name_sync_with_filename>
+ <description/>
+ <extended_description/>
+ <workflow_version/>
+ <created_user>-</created_user>
+ <created_date>2025/12/07 14:10:31.342</created_date>
+ <modified_user>-</modified_user>
+ <modified_date>2025/12/07 14:10:31.342</modified_date>
+ <parameters>
+ </parameters>
+ <actions>
+ <action>
+ <name>Start</name>
+ <description/>
+ <type>SPECIAL</type>
+ <attributes/>
+ <DayOfMonth>1</DayOfMonth>
+ <doNotWaitOnFirstExecution>N</doNotWaitOnFirstExecution>
+ <hour>12</hour>
+ <intervalMinutes>60</intervalMinutes>
+ <intervalSeconds>0</intervalSeconds>
+ <minutes>0</minutes>
+ <repeat>N</repeat>
+ <schedulerType>0</schedulerType>
+ <weekDay>1</weekDay>
+ <parallel>N</parallel>
+ <xloc>80</xloc>
+ <yloc>64</yloc>
+ <attributes_hac/>
+ </action>
+ <action>
+ <name>Run 0085 tests</name>
+ <description/>
+ <type>RunPipelineTests</type>
+ <attributes/>
+ <test_names>
+ <test_name>
+ <name>0085-data-set-input UNIT</name>
+ </test_name>
+ </test_names>
+ <parallel>N</parallel>
+ <xloc>256</xloc>
+ <yloc>64</yloc>
+ <attributes_hac/>
+ </action>
+ </actions>
+ <hops>
+ <hop>
+ <from>Start</from>
+ <to>Run 0085 tests</to>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>Y</unconditional>
+ </hop>
+ </hops>
+ <notepads>
+ </notepads>
+ <attributes/>
+</workflow>
diff --git
a/integration-tests/transforms/metadata/unit-test/0085-data-set-input UNIT.json
b/integration-tests/transforms/metadata/unit-test/0085-data-set-input UNIT.json
new file mode 100644
index 0000000000..96989bfb4b
--- /dev/null
+++ b/integration-tests/transforms/metadata/unit-test/0085-data-set-input
UNIT.json
@@ -0,0 +1,88 @@
+{
+ "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": "name",
+ "data_set_field": "name"
+ },
+ {
+ "transform_field": "firstname",
+ "data_set_field": "firstname"
+ },
+ {
+ "transform_field": "zip",
+ "data_set_field": "zip"
+ },
+ {
+ "transform_field": "city",
+ "data_set_field": "city"
+ },
+ {
+ "transform_field": "birthdate",
+ "data_set_field": "birthdate"
+ },
+ {
+ "transform_field": "street",
+ "data_set_field": "street"
+ },
+ {
+ "transform_field": "housenr",
+ "data_set_field": "housenr"
+ },
+ {
+ "transform_field": "stateCode",
+ "data_set_field": "stateCode"
+ },
+ {
+ "transform_field": "state",
+ "data_set_field": "state"
+ },
+ {
+ "transform_field": "isActive",
+ "data_set_field": "isActive"
+ },
+ {
+ "transform_field": "registrationTimestamp",
+ "data_set_field": "registrationTimestamp"
+ },
+ {
+ "transform_field": "metadataJson",
+ "data_set_field": "metadataJson"
+ }
+ ],
+ "field_order": [
+ "id",
+ "name",
+ "firstname",
+ "zip",
+ "city",
+ "birthdate",
+ "street",
+ "housenr",
+ "stateCode",
+ "state",
+ "isActive",
+ "registrationTimestamp",
+ "metadataJson"
+ ],
+ "data_set_name": "golden-parquet-input",
+ "transform_name": "Validate"
+ }
+ ],
+ "input_data_sets": [],
+ "name": "0085-data-set-input UNIT",
+ "trans_test_tweaks": [],
+ "pipeline_filename": "./0085-data-set-input.hpl"
+}
\ No newline at end of file
diff --git
a/plugins/misc/testing/src/main/java/org/apache/hop/testing/transforms/datasetinput/DataSetInput.java
b/plugins/misc/testing/src/main/java/org/apache/hop/testing/transforms/datasetinput/DataSetInput.java
new file mode 100644
index 0000000000..592a04ecde
--- /dev/null
+++
b/plugins/misc/testing/src/main/java/org/apache/hop/testing/transforms/datasetinput/DataSetInput.java
@@ -0,0 +1,81 @@
+/*
+ * 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.testing.transforms.datasetinput;
+
+import java.util.List;
+import org.apache.commons.lang.StringUtils;
+import org.apache.hop.core.exception.HopException;
+import org.apache.hop.core.row.RowMeta;
+import org.apache.hop.metadata.api.IHopMetadataSerializer;
+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.testing.DataSet;
+
+public class DataSetInput extends BaseTransform<DataSetInputMeta,
DataSetInputData> {
+
+ public DataSetInput(
+ TransformMeta transformMeta,
+ DataSetInputMeta meta,
+ DataSetInputData data,
+ int copyNr,
+ PipelineMeta pipelineMeta,
+ Pipeline pipeline) {
+ super(transformMeta, meta, data, copyNr, pipelineMeta, pipeline);
+ }
+
+ @Override
+ public boolean init() {
+ try {
+ if (StringUtils.isEmpty(meta.getDataSetName())) {
+ logError("Please specify the name of the data set to read from");
+ setErrors(1);
+ return false;
+ }
+ data.realDataSetName = resolve(meta.getDataSetName());
+ IHopMetadataSerializer<DataSet> serializer =
metadataProvider.getSerializer(DataSet.class);
+ data.dataSet = serializer.load(data.realDataSetName);
+ } catch (Exception e) {
+ logError("Error initializing", e);
+ setErrors(1);
+ return false;
+ }
+
+ return super.init();
+ }
+
+ @Override
+ public boolean processRow() throws HopException {
+
+ if (first) {
+ first = false;
+
+ data.outputRowMeta = new RowMeta();
+ data.outputRowMeta.addRowMeta(data.dataSet.getSetRowMeta());
+ }
+
+ List<Object[]> rows = data.dataSet.getAllRows(this, getLogChannel());
+ for (Object[] row : rows) {
+ putRow(data.outputRowMeta, row);
+ }
+ setOutputDone();
+
+ return false;
+ }
+}
diff --git
a/plugins/misc/testing/src/main/java/org/apache/hop/testing/transforms/datasetinput/DataSetInputData.java
b/plugins/misc/testing/src/main/java/org/apache/hop/testing/transforms/datasetinput/DataSetInputData.java
new file mode 100644
index 0000000000..f0bd4708cc
--- /dev/null
+++
b/plugins/misc/testing/src/main/java/org/apache/hop/testing/transforms/datasetinput/DataSetInputData.java
@@ -0,0 +1,35 @@
+/*
+ * 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.testing.transforms.datasetinput;
+
+import org.apache.hop.core.row.IRowMeta;
+import org.apache.hop.pipeline.transform.BaseTransformData;
+import org.apache.hop.pipeline.transform.ITransformData;
+import org.apache.hop.testing.DataSet;
+
+@SuppressWarnings("java:S1104")
+public class DataSetInputData extends BaseTransformData implements
ITransformData {
+
+ public IRowMeta outputRowMeta;
+ public String realDataSetName;
+ public DataSet dataSet;
+
+ public DataSetInputData() {
+ // Do nothing
+ }
+}
diff --git
a/plugins/misc/testing/src/main/java/org/apache/hop/testing/transforms/datasetinput/DataSetInputDialog.java
b/plugins/misc/testing/src/main/java/org/apache/hop/testing/transforms/datasetinput/DataSetInputDialog.java
new file mode 100644
index 0000000000..b72384f359
--- /dev/null
+++
b/plugins/misc/testing/src/main/java/org/apache/hop/testing/transforms/datasetinput/DataSetInputDialog.java
@@ -0,0 +1,161 @@
+/*
+ * 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.testing.transforms.datasetinput;
+
+import org.apache.hop.core.Const;
+import org.apache.hop.core.exception.HopException;
+import org.apache.hop.core.util.StringUtil;
+import org.apache.hop.core.variables.IVariables;
+import org.apache.hop.i18n.BaseMessages;
+import org.apache.hop.pipeline.PipelineMeta;
+import org.apache.hop.testing.DataSet;
+import org.apache.hop.ui.core.PropsUi;
+import org.apache.hop.ui.core.dialog.BaseDialog;
+import org.apache.hop.ui.core.dialog.ErrorDialog;
+import org.apache.hop.ui.core.widget.MetaSelectionLine;
+import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
+import org.eclipse.swt.SWT;
+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.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+public class DataSetInputDialog extends BaseTransformDialog {
+ private static final Class<?> PKG = DataSetInputDialog.class;
+
+ private DataSetInputMeta input;
+
+ private MetaSelectionLine<DataSet> wDataSetName;
+
+ public DataSetInputDialog(
+ Shell parent,
+ IVariables variables,
+ DataSetInputMeta transformMeta,
+ PipelineMeta pipelineMeta) {
+ super(parent, variables, transformMeta, pipelineMeta);
+ input = transformMeta;
+ }
+
+ @Override
+ public String open() {
+
+ Shell parent = getParent();
+
+ shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MIN |
SWT.MAX);
+ PropsUi.setLook(shell);
+ setShellImage(shell, input);
+
+ FormLayout formLayout = new FormLayout();
+ formLayout.marginWidth = PropsUi.getFormMargin();
+ formLayout.marginHeight = PropsUi.getFormMargin();
+
+ shell.setLayout(formLayout);
+ shell.setText(BaseMessages.getString(PKG,
"DataSetInputDialog.Shell.Title"));
+
+ int middle = props.getMiddlePct();
+ int margin = PropsUi.getMargin();
+
+ // Transform name...
+ //
+ wlTransformName = new Label(shell, SWT.RIGHT);
+ wlTransformName.setText(BaseMessages.getString(PKG,
"DataSetInputDialog.TransformName.Label"));
+ PropsUi.setLook(wlTransformName);
+ fdlTransformName = new FormData();
+ fdlTransformName.left = new FormAttachment(0, 0);
+ fdlTransformName.right = new FormAttachment(middle, -margin);
+ fdlTransformName.top = new FormAttachment(0, margin);
+ wlTransformName.setLayoutData(fdlTransformName);
+ wTransformName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
+ wTransformName.setText(transformName);
+ PropsUi.setLook(wTransformName);
+ fdTransformName = new FormData();
+ fdTransformName.left = new FormAttachment(middle, 0);
+ fdTransformName.top = new FormAttachment(0, margin);
+ fdTransformName.right = new FormAttachment(100, 0);
+ wTransformName.setLayoutData(fdTransformName);
+ Control lastControl = wTransformName;
+
+ wDataSetName =
+ new MetaSelectionLine<>(
+ variables,
+ metadataProvider,
+ DataSet.class,
+ shell,
+ SWT.NONE,
+ BaseMessages.getString(PKG,
"DataSetInputDialog.DataSetName.Label"),
+ BaseMessages.getString(PKG,
"DataSetInputDialog.DataSetName.Tooltip"));
+ FormData fdDataSetName = new FormData();
+ fdDataSetName.left = new FormAttachment(0, 0);
+ fdDataSetName.top = new FormAttachment(lastControl, margin);
+ fdDataSetName.right = new FormAttachment(100, 0);
+ wDataSetName.setLayoutData(fdDataSetName);
+ lastControl = wDataSetName;
+
+ // Buttons go at the very bottom
+ //
+ wOk = new Button(shell, SWT.PUSH);
+ wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
+ wOk.addListener(SWT.Selection, e -> ok());
+ wCancel = new Button(shell, SWT.PUSH);
+ wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
+ wCancel.addListener(SWT.Selection, e -> cancel());
+ BaseTransformDialog.positionBottomButtons(
+ shell, new Button[] {wOk, wCancel}, margin, lastControl);
+
+ getData();
+
+ BaseDialog.defaultShellHandling(shell, c -> ok(), c -> cancel());
+
+ return transformName;
+ }
+
+ private void getData() {
+ wDataSetName.setText(Const.NVL(input.getDataSetName(), ""));
+
+ try {
+ wDataSetName.fillItems();
+ } catch (HopException e) {
+ new ErrorDialog(shell, "Error", "Error loading data set names", e);
+ }
+
+ wTransformName.selectAll();
+ wTransformName.setFocus();
+ }
+
+ private void cancel() {
+ transformName = null;
+ input.setChanged(changed);
+ dispose();
+ }
+
+ private void ok() {
+ if (StringUtil.isEmpty(wTransformName.getText())) {
+ return;
+ }
+
+ transformName = wTransformName.getText(); // return value
+ input.setDataSetName(wDataSetName.getText());
+ input.setChanged();
+
+ dispose();
+ }
+}
diff --git
a/plugins/misc/testing/src/main/java/org/apache/hop/testing/transforms/datasetinput/DataSetInputMeta.java
b/plugins/misc/testing/src/main/java/org/apache/hop/testing/transforms/datasetinput/DataSetInputMeta.java
new file mode 100644
index 0000000000..d107587d9c
--- /dev/null
+++
b/plugins/misc/testing/src/main/java/org/apache/hop/testing/transforms/datasetinput/DataSetInputMeta.java
@@ -0,0 +1,72 @@
+/*
+ * 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.testing.transforms.datasetinput;
+
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.hop.core.annotations.Transform;
+import org.apache.hop.core.exception.HopTransformException;
+import org.apache.hop.core.row.IRowMeta;
+import org.apache.hop.core.variables.IVariables;
+import org.apache.hop.metadata.api.HopMetadataProperty;
+import org.apache.hop.metadata.api.IHopMetadataProvider;
+import org.apache.hop.metadata.api.IHopMetadataSerializer;
+import org.apache.hop.pipeline.transform.BaseTransformMeta;
+import org.apache.hop.pipeline.transform.TransformMeta;
+import org.apache.hop.testing.DataSet;
+
+@Getter
+@Setter
+@Transform(
+ id = "DataSetInput",
+ description = "Read static data from a data set defined in the metadata",
+ name = "Data Set Input",
+ image = "dataset.svg",
+ categoryDescription =
"i18n:org.apache.hop.pipeline.transform:BaseTransform.Category.Input",
+ keywords = "i18n::DataSetInputMeta.keyword",
+ documentationUrl = "/pipeline/transforms/datasetinput.html")
+public class DataSetInputMeta extends BaseTransformMeta<DataSetInput,
DataSetInputData> {
+ @HopMetadataProperty private String dataSetName;
+
+ public DataSetInputMeta() {
+ super();
+ }
+
+ @Override
+ public void getFields(
+ IRowMeta inputRowMeta,
+ String name,
+ IRowMeta[] info,
+ TransformMeta nextTransform,
+ IVariables variables,
+ IHopMetadataProvider metadataProvider)
+ throws HopTransformException {
+
+ inputRowMeta.clear();
+
+ String realDataSetName = variables.resolve(dataSetName);
+ try {
+ IHopMetadataSerializer<DataSet> serializer =
metadataProvider.getSerializer(DataSet.class);
+ DataSet dataSet = serializer.load(realDataSetName);
+ inputRowMeta.addRowMeta(dataSet.getSetRowMeta());
+ } catch (Exception e) {
+ throw new HopTransformException(
+ "Error getting row metadata from dataset " + realDataSetName, e);
+ }
+ }
+}
diff --git
a/plugins/misc/testing/src/main/resources/org/apache/hop/testing/transforms/datasetinput/messages/messages_en_US.properties
b/plugins/misc/testing/src/main/resources/org/apache/hop/testing/transforms/datasetinput/messages/messages_en_US.properties
new file mode 100644
index 0000000000..b5e9872077
--- /dev/null
+++
b/plugins/misc/testing/src/main/resources/org/apache/hop/testing/transforms/datasetinput/messages/messages_en_US.properties
@@ -0,0 +1,24 @@
+#
+# 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.
+#
+#
+
+DataSetInputMeta.keyword=Data Set, Input, DataSet
+DataSetInputDialog.Shell.Title = Data Set Input
+DataSetInputDialog.TransformName.Label = Data Set Input
+DataSetInputDialog.DataSetName.Label = Data Set Name
+DataSetInputDialog.DataSetName.Tooltip = Select the name of the data set to
read from
+