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 2023/03/29 10:44:16 UTC
[hop] branch master updated: Add support for constants on empty lists, fixes #2102
This is an automated email from the ASF dual-hosted git repository.
hansva pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hop.git
The following commit(s) were added to refs/heads/master by this push:
new b82b48a558 Add support for constants on empty lists, fixes #2102
new 506cb71156 Merge pull request #2762 from hansva/2102
b82b48a558 is described below
commit b82b48a5587824c0b2a4dac47b408ba93c952e55
Author: Hans Van Akelyen <ha...@gmail.com>
AuthorDate: Thu Mar 23 12:10:43 2023 +0100
Add support for constants on empty lists, fixes #2102
---
.../hop/core/injection/bean/BeanInjector.java | 21 ++-
.../mdi/0025-get-variables-parent.hpl | 49 +++---
.../mdi/0026-inject-using-constants-only-child.hpl | 123 ++++++++++++++
...=> 0026-inject-using-constants-only-parent.hpl} | 182 ++++++++-------------
.../mdi/datasets/golden-only-use-constants.csv | 2 +
.../mdi/main-0025-inject-get-variables.hwf | 79 +++++++++
.../mdi/main-0026-inject-using-constants-only.hwf | 79 +++++++++
.../dataset/golden-only-use-constants.json | 24 +++
...26-inject-using-constants-only-parent UNIT.json | 33 ++++
.../pipeline/transforms/metainject/MetaInject.java | 2 -
10 files changed, 446 insertions(+), 148 deletions(-)
diff --git a/engine/src/main/java/org/apache/hop/core/injection/bean/BeanInjector.java b/engine/src/main/java/org/apache/hop/core/injection/bean/BeanInjector.java
index c4e9cee512..aaa03a536e 100644
--- a/engine/src/main/java/org/apache/hop/core/injection/bean/BeanInjector.java
+++ b/engine/src/main/java/org/apache/hop/core/injection/bean/BeanInjector.java
@@ -17,12 +17,8 @@
package org.apache.hop.core.injection.bean;
-import org.apache.hop.core.RowMetaAndData;
-import org.apache.hop.core.exception.HopException;
-import org.apache.hop.core.injection.AfterInjection;
-import org.apache.hop.metadata.api.IHopMetadata;
-import org.apache.hop.metadata.api.IHopMetadataProvider;
-import org.apache.hop.metadata.api.IHopMetadataSerializer;
+import static com.google.common.collect.Lists.newLinkedList;
+import static java.util.Objects.requireNonNull;
import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
@@ -34,9 +30,12 @@ import java.util.List;
import java.util.Optional;
import java.util.Queue;
import java.util.stream.Collectors;
-
-import static com.google.common.collect.Lists.newLinkedList;
-import static java.util.Objects.requireNonNull;
+import org.apache.hop.core.RowMetaAndData;
+import org.apache.hop.core.exception.HopException;
+import org.apache.hop.core.injection.AfterInjection;
+import org.apache.hop.metadata.api.IHopMetadata;
+import org.apache.hop.metadata.api.IHopMetadataProvider;
+import org.apache.hop.metadata.api.IHopMetadataSerializer;
/** Engine for get/set metadata injection properties from bean. */
public class BeanInjector<Meta extends Object> {
@@ -443,6 +442,10 @@ public class BeanInjector<Meta extends Object> {
if (existList == null) {
return null;
}
+ // if constants are added without data we still want 1 row created
+ if (existList.size() == 0) {
+ return extendList(s, obj, 1);
+ }
return index < existList.size() ? existList : null;
}
diff --git a/integration-tests/mdi/0025-get-variables-parent.hpl b/integration-tests/mdi/0025-get-variables-parent.hpl
index 0e36aec6f0..6fa8bb7d9f 100644
--- a/integration-tests/mdi/0025-get-variables-parent.hpl
+++ b/integration-tests/mdi/0025-get-variables-parent.hpl
@@ -25,6 +25,7 @@ limitations under the License.
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
+ <pipeline_status>0</pipeline_status>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
@@ -34,8 +35,6 @@ limitations under the License.
<created_date>2022/12/05 22:54:39.724</created_date>
<modified_user>-</modified_user>
<modified_date>2022/12/05 22:54:39.724</modified_date>
- <key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA=</key_for_session_key>
- <is_key_private>N</is_key_private>
</info>
<notepads>
</notepads>
@@ -147,46 +146,46 @@ limitations under the License.
<method>none</method>
<schema_name/>
</partitioning>
+ <data>
+ <line>
+ <item>A</item>
+ <item>${A}</item>
+ <item>String</item>
+ </line>
+ <line>
+ <item>B</item>
+ <item>${B}</item>
+ <item>String</item>
+ </line>
+ <line>
+ <item>C</item>
+ <item>${C}</item>
+ <item>String</item>
+ </line>
+ </data>
<fields>
<field>
- <set_empty_string>N</set_empty_string>
<length>-1</length>
- <name>name</name>
<precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ <name>name</name>
<type>String</type>
</field>
<field>
- <set_empty_string>N</set_empty_string>
<length>-1</length>
- <name>variable</name>
<precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ <name>variable</name>
<type>String</type>
</field>
<field>
- <set_empty_string>N</set_empty_string>
<length>-1</length>
- <name>type</name>
<precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ <name>type</name>
<type>String</type>
</field>
</fields>
- <data>
- <line>
- <item>A</item>
- <item>${A}</item>
- <item>2</item>
- </line>
- <line>
- <item>B</item>
- <item>${B}</item>
- <item>2</item>
- </line>
- <line>
- <item>C</item>
- <item>${C}</item>
- <item>2</item>
- </line>
- </data>
<attributes/>
<GUI>
<xloc>128</xloc>
diff --git a/integration-tests/mdi/0026-inject-using-constants-only-child.hpl b/integration-tests/mdi/0026-inject-using-constants-only-child.hpl
new file mode 100644
index 0000000000..c47ce0b76e
--- /dev/null
+++ b/integration-tests/mdi/0026-inject-using-constants-only-child.hpl
@@ -0,0 +1,123 @@
+<?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>0026-inject-using-constants-only-child</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>2022/03/23 12:29:35.111</created_date>
+ <modified_user>-</modified_user>
+ <modified_date>2022/03/23 12:29:35.111</modified_date>
+ </info>
+ <notepads>
+ </notepads>
+ <order>
+ <hop>
+ <from>Data grid</from>
+ <to>Row denormaliser</to>
+ <enabled>Y</enabled>
+ </hop>
+ </order>
+ <transform>
+ <name>Data grid</name>
+ <type>DataGrid</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <data>
+ <line>
+ <item>A</item>
+ <item>A</item>
+ <item>100</item>
+ </line>
+ <line>
+ <item>A</item>
+ <item>A</item>
+ <item>20</item>
+ </line>
+ </data>
+ <fields>
+ <field>
+ <length>-1</length>
+ <precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ <name>group</name>
+ <type>String</type>
+ </field>
+ <field>
+ <length>-1</length>
+ <precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ <name>key</name>
+ <type>String</type>
+ </field>
+ <field>
+ <length>-1</length>
+ <precision>-1</precision>
+ <set_empty_string>N</set_empty_string>
+ <name>value</name>
+ <type>Number</type>
+ </field>
+ </fields>
+ <attributes/>
+ <GUI>
+ <xloc>96</xloc>
+ <yloc>64</yloc>
+ </GUI>
+ </transform>
+ <transform>
+ <name>Row denormaliser</name>
+ <type>Denormaliser</type>
+ <description/>
+ <distribute>Y</distribute>
+ <custom_distribution/>
+ <copies>1</copies>
+ <partitioning>
+ <method>none</method>
+ <schema_name/>
+ </partitioning>
+ <fields>
+</fields>
+ <group>
+</group>
+ <attributes/>
+ <GUI>
+ <xloc>240</xloc>
+ <yloc>64</yloc>
+ </GUI>
+ </transform>
+ <transform_error_handling>
+ </transform_error_handling>
+ <attributes/>
+</pipeline>
diff --git a/integration-tests/mdi/0025-get-variables-parent.hpl b/integration-tests/mdi/0026-inject-using-constants-only-parent.hpl
similarity index 50%
copy from integration-tests/mdi/0025-get-variables-parent.hpl
copy to integration-tests/mdi/0026-inject-using-constants-only-parent.hpl
index 0e36aec6f0..6c209833ee 100644
--- a/integration-tests/mdi/0025-get-variables-parent.hpl
+++ b/integration-tests/mdi/0026-inject-using-constants-only-parent.hpl
@@ -19,7 +19,7 @@ limitations under the License.
-->
<pipeline>
<info>
- <name>0025-get-variables-parent</name>
+ <name>0026-inject-using-constants-only-parent</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
@@ -31,28 +31,38 @@ limitations under the License.
<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>2022/12/05 22:54:39.724</created_date>
+ <created_date>2023/03/23 11:08:16.063</created_date>
<modified_user>-</modified_user>
- <modified_date>2022/12/05 22:54:39.724</modified_date>
- <key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA=</key_for_session_key>
- <is_key_private>N</is_key_private>
+ <modified_date>2023/03/23 11:08:16.063</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
- <from>variable fields</from>
- <to>0025-get-variables-child.hpl</to>
- <enabled>Y</enabled>
- </hop>
- <hop>
- <from>0025-get-variables-child.hpl</from>
- <to>Verify</to>
+ <from>ETL metadata injection</from>
+ <to>Dummy (do nothing)</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
- <name>0025-get-variables-child.hpl</name>
+ <name>Dummy (do nothing)</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>112</yloc>
+ </GUI>
+ </transform>
+ <transform>
+ <name>ETL metadata injection</name>
<type>MetaInject</type>
<description/>
<distribute>Y</distribute>
@@ -62,25 +72,19 @@ limitations under the License.
<method>none</method>
<schema_name/>
</partitioning>
- <filename>${PROJECT_HOME}/0025-get-variables-child.hpl</filename>
+ <filename>${PROJECT_HOME}/0026-inject-using-constants-only-child.hpl</filename>
<run_configuration>local</run_configuration>
- <source_transform>Output</source_transform>
+ <source_transform>Row denormaliser</source_transform>
<source_output_fields>
<source_output_field>
- <source_output_field_name>A</source_output_field_name>
- <source_output_field_type>String</source_output_field_type>
- <source_output_field_length>-1</source_output_field_length>
- <source_output_field_precision>-1</source_output_field_precision>
- </source_output_field>
- <source_output_field>
- <source_output_field_name>B</source_output_field_name>
+ <source_output_field_name>group</source_output_field_name>
<source_output_field_type>String</source_output_field_type>
<source_output_field_length>-1</source_output_field_length>
<source_output_field_precision>-1</source_output_field_precision>
</source_output_field>
<source_output_field>
- <source_output_field_name>C</source_output_field_name>
- <source_output_field_type>String</source_output_field_type>
+ <source_output_field_name>A</source_output_field_name>
+ <source_output_field_type>Number</source_output_field_type>
<source_output_field_length>-1</source_output_field_length>
<source_output_field_precision>-1</source_output_field_precision>
</source_output_field>
@@ -92,105 +96,59 @@ limitations under the License.
<stream_target_transform/>
<mappings>
<mapping>
- <target_transform_name>Get variables</target_transform_name>
- <target_attribute_key>FIELDNAME</target_attribute_key>
+ <target_transform_name>Row denormaliser</target_transform_name>
+ <target_attribute_key>TARGET_AGGREGATION</target_attribute_key>
+ <target_detail>Y</target_detail>
+ <source_transform/>
+ <source_field>SUM</source_field>
+ </mapping>
+ <mapping>
+ <target_transform_name>Row denormaliser</target_transform_name>
+ <target_attribute_key>key_field</target_attribute_key>
+ <target_detail>N</target_detail>
+ <source_transform/>
+ <source_field>key</source_field>
+ </mapping>
+ <mapping>
+ <target_transform_name>Row denormaliser</target_transform_name>
+ <target_attribute_key>TARGET_NAME</target_attribute_key>
<target_detail>Y</target_detail>
- <source_transform>variable fields</source_transform>
- <source_field>name</source_field>
+ <source_transform/>
+ <source_field>A</source_field>
</mapping>
<mapping>
- <target_transform_name>Get variables</target_transform_name>
- <target_attribute_key>FIELDTYPE</target_attribute_key>
+ <target_transform_name>Row denormaliser</target_transform_name>
+ <target_attribute_key>name</target_attribute_key>
<target_detail>Y</target_detail>
- <source_transform>variable fields</source_transform>
- <source_field>type</source_field>
+ <source_transform/>
+ <source_field>group</source_field>
</mapping>
<mapping>
- <target_transform_name>Get variables</target_transform_name>
- <target_attribute_key>VARIABLE</target_attribute_key>
+ <target_transform_name>Row denormaliser</target_transform_name>
+ <target_attribute_key>NAME</target_attribute_key>
<target_detail>Y</target_detail>
- <source_transform>variable fields</source_transform>
- <source_field>variable</source_field>
+ <source_transform/>
+ <source_field>value</source_field>
+ </mapping>
+ <mapping>
+ <target_transform_name>Row denormaliser</target_transform_name>
+ <target_attribute_key>KEY_VALUE</target_attribute_key>
+ <target_detail>Y</target_detail>
+ <source_transform/>
+ <source_field>A</source_field>
+ </mapping>
+ <mapping>
+ <target_transform_name>Row denormaliser</target_transform_name>
+ <target_attribute_key>TARGET_TYPE</target_attribute_key>
+ <target_detail>Y</target_detail>
+ <source_transform/>
+ <source_field>Number</source_field>
</mapping>
</mappings>
<attributes/>
<GUI>
- <xloc>368</xloc>
- <yloc>80</yloc>
- </GUI>
- </transform>
- <transform>
- <name>Verify</name>
- <type>Dummy</type>
- <description/>
- <distribute>Y</distribute>
- <custom_distribution/>
- <copies>1</copies>
- <partitioning>
- <method>none</method>
- <schema_name/>
- </partitioning>
- <attributes/>
- <GUI>
- <xloc>592</xloc>
- <yloc>80</yloc>
- </GUI>
- </transform>
- <transform>
- <name>variable fields</name>
- <type>DataGrid</type>
- <description/>
- <distribute>Y</distribute>
- <custom_distribution/>
- <copies>1</copies>
- <partitioning>
- <method>none</method>
- <schema_name/>
- </partitioning>
- <fields>
- <field>
- <set_empty_string>N</set_empty_string>
- <length>-1</length>
- <name>name</name>
- <precision>-1</precision>
- <type>String</type>
- </field>
- <field>
- <set_empty_string>N</set_empty_string>
- <length>-1</length>
- <name>variable</name>
- <precision>-1</precision>
- <type>String</type>
- </field>
- <field>
- <set_empty_string>N</set_empty_string>
- <length>-1</length>
- <name>type</name>
- <precision>-1</precision>
- <type>String</type>
- </field>
- </fields>
- <data>
- <line>
- <item>A</item>
- <item>${A}</item>
- <item>2</item>
- </line>
- <line>
- <item>B</item>
- <item>${B}</item>
- <item>2</item>
- </line>
- <line>
- <item>C</item>
- <item>${C}</item>
- <item>2</item>
- </line>
- </data>
- <attributes/>
- <GUI>
- <xloc>128</xloc>
- <yloc>80</yloc>
+ <xloc>144</xloc>
+ <yloc>112</yloc>
</GUI>
</transform>
<transform_error_handling>
diff --git a/integration-tests/mdi/datasets/golden-only-use-constants.csv b/integration-tests/mdi/datasets/golden-only-use-constants.csv
new file mode 100644
index 0000000000..7a1e2e26f5
--- /dev/null
+++ b/integration-tests/mdi/datasets/golden-only-use-constants.csv
@@ -0,0 +1,2 @@
+group,A
+A,120.0
diff --git a/integration-tests/mdi/main-0025-inject-get-variables.hwf b/integration-tests/mdi/main-0025-inject-get-variables.hwf
new file mode 100644
index 0000000000..083acf1321
--- /dev/null
+++ b/integration-tests/mdi/main-0025-inject-get-variables.hwf
@@ -0,0 +1,79 @@
+<?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-0025-inject-get-variables</name>
+ <name_sync_with_filename>Y</name_sync_with_filename>
+ <description/>
+ <extended_description/>
+ <workflow_version/>
+ <created_user>-</created_user>
+ <created_date>2022/12/05 15:56:29.618</created_date>
+ <modified_user>-</modified_user>
+ <modified_date>2022/12/05 15:56:29.618</modified_date>
+ <parameters>
+ </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>
+ <weekDay>1</weekDay>
+ <parallel>N</parallel>
+ <xloc>96</xloc>
+ <yloc>80</yloc>
+ <attributes_hac/>
+ </action>
+ <action>
+ <name>Run Pipeline Unit Tests</name>
+ <description/>
+ <type>RunPipelineTests</type>
+ <attributes/>
+ <test_names>
+ <test_name>
+ <name>0025-get-variables-parent UNIT</name>
+ </test_name>
+ </test_names>
+ <parallel>N</parallel>
+ <xloc>304</xloc>
+ <yloc>80</yloc>
+ <attributes_hac/>
+ </action>
+ </actions>
+ <hops>
+ <hop>
+ <from>Start</from>
+ <to>Run Pipeline Unit Tests</to>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>Y</unconditional>
+ </hop>
+ </hops>
+ <notepads>
+ </notepads>
+ <attributes/>
+</workflow>
diff --git a/integration-tests/mdi/main-0026-inject-using-constants-only.hwf b/integration-tests/mdi/main-0026-inject-using-constants-only.hwf
new file mode 100644
index 0000000000..da9a1e5bb7
--- /dev/null
+++ b/integration-tests/mdi/main-0026-inject-using-constants-only.hwf
@@ -0,0 +1,79 @@
+<?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-0026-inject-using-constants-only</name>
+ <name_sync_with_filename>Y</name_sync_with_filename>
+ <description/>
+ <extended_description/>
+ <workflow_version/>
+ <created_user>-</created_user>
+ <created_date>2022/12/05 15:56:29.618</created_date>
+ <modified_user>-</modified_user>
+ <modified_date>2022/12/05 15:56:29.618</modified_date>
+ <parameters>
+ </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>
+ <weekDay>1</weekDay>
+ <parallel>N</parallel>
+ <xloc>96</xloc>
+ <yloc>80</yloc>
+ <attributes_hac/>
+ </action>
+ <action>
+ <name>Run Pipeline Unit Tests</name>
+ <description/>
+ <type>RunPipelineTests</type>
+ <attributes/>
+ <test_names>
+ <test_name>
+ <name>0026-inject-using-constants-only-parent UNIT</name>
+ </test_name>
+ </test_names>
+ <parallel>N</parallel>
+ <xloc>304</xloc>
+ <yloc>80</yloc>
+ <attributes_hac/>
+ </action>
+ </actions>
+ <hops>
+ <hop>
+ <from>Start</from>
+ <to>Run Pipeline Unit Tests</to>
+ <enabled>Y</enabled>
+ <evaluation>Y</evaluation>
+ <unconditional>Y</unconditional>
+ </hop>
+ </hops>
+ <notepads>
+ </notepads>
+ <attributes/>
+</workflow>
diff --git a/integration-tests/mdi/metadata/dataset/golden-only-use-constants.json b/integration-tests/mdi/metadata/dataset/golden-only-use-constants.json
new file mode 100644
index 0000000000..19132d3a17
--- /dev/null
+++ b/integration-tests/mdi/metadata/dataset/golden-only-use-constants.json
@@ -0,0 +1,24 @@
+{
+ "base_filename": "golden-only-use-constants.csv",
+ "name": "golden-only-use-constants",
+ "description": "",
+ "dataset_fields": [
+ {
+ "field_comment": "",
+ "field_length": -1,
+ "field_type": 2,
+ "field_precision": -1,
+ "field_name": "group",
+ "field_format": ""
+ },
+ {
+ "field_comment": "",
+ "field_length": 0,
+ "field_type": 1,
+ "field_precision": 0,
+ "field_name": "A",
+ "field_format": "####0.0#########;-####0.0#########"
+ }
+ ],
+ "folder_name": ""
+}
\ No newline at end of file
diff --git a/integration-tests/mdi/metadata/unit-test/0026-inject-using-constants-only-parent UNIT.json b/integration-tests/mdi/metadata/unit-test/0026-inject-using-constants-only-parent UNIT.json
new file mode 100644
index 0000000000..3e4ff5e150
--- /dev/null
+++ b/integration-tests/mdi/metadata/unit-test/0026-inject-using-constants-only-parent UNIT.json
@@ -0,0 +1,33 @@
+{
+ "variableValues": [],
+ "database_replacements": [],
+ "autoOpening": true,
+ "basePath": "",
+ "golden_data_sets": [
+ {
+ "field_mappings": [
+ {
+ "transform_field": "group",
+ "data_set_field": "group"
+ },
+ {
+ "transform_field": "A",
+ "data_set_field": "A"
+ }
+ ],
+ "field_order": [
+ "group",
+ "A"
+ ],
+ "data_set_name": "golden-only-use-constants",
+ "transform_name": "Dummy (do nothing)"
+ }
+ ],
+ "input_data_sets": [],
+ "name": "0026-inject-using-constants-only-parent UNIT",
+ "description": "",
+ "persist_filename": "",
+ "trans_test_tweaks": [],
+ "pipeline_filename": "./0026-inject-using-constants-only-parent.hpl",
+ "test_type": "UNIT_TEST"
+}
\ No newline at end of file
diff --git a/plugins/transforms/metainject/src/main/java/org/apache/hop/pipeline/transforms/metainject/MetaInject.java b/plugins/transforms/metainject/src/main/java/org/apache/hop/pipeline/transforms/metainject/MetaInject.java
index ef64d6e632..f703c5a505 100644
--- a/plugins/transforms/metainject/src/main/java/org/apache/hop/pipeline/transforms/metainject/MetaInject.java
+++ b/plugins/transforms/metainject/src/main/java/org/apache/hop/pipeline/transforms/metainject/MetaInject.java
@@ -425,7 +425,6 @@ public class MetaInject extends BaseTransform<MetaInjectMeta, MetaInjectData> {
}
} else {
// target transform doesn't have specified key - just report but don't fail like in
- // 6.0 (BACKLOG-6753)
logError(
BaseMessages.getString(
PKG,
@@ -474,7 +473,6 @@ public class MetaInject extends BaseTransform<MetaInjectMeta, MetaInjectData> {
targetTransformMeta, target.getAttributeKey(), null, value);
} else {
// target transform doesn't have specified key - just report but don't fail like in 6.0
- // (BACKLOG-6753)
logError(
BaseMessages.getString(
PKG,