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 8885d9f8d5 Run the Table Input SQL only once with a data profile or 
lineage, fixes #9036 (#9310)
8885d9f8d5 is described below

commit 8885d9f8d5121c6df86d7d14e75555dd64ebe96e
Author: Bart Maertens <[email protected]>
AuthorDate: Fri Nov 6 10:47:37 2026 +0100

    Run the Table Input SQL only once with a data profile or lineage, fixes 
#9036 (#9310)
    
    Attaching the samplers of a data profile and reporting transform schemas to 
lineage (even with lineage off) asked every transform for its fields. A Table 
Input on SQL Server runs its SQL to answer that, so inserts and procedure calls 
in it ran twice. The samplers now take the layout from the rows, and the 
lineage schema emitter does nothing when lineage is disabled.
---
 .../sampler/IExecutionDataSamplerStore.java        |   8 +-
 .../hop/lineage/LineageTransformSchemaEmitter.java |   7 +
 .../engines/local/LocalPipelineEngine.java         |  10 +-
 .../lineage/LineageTransformSchemaEmitterTest.java |  48 ++++++
 .../local/LocalPipelineEngineSamplersTest.java     | 139 +++++++++++++++
 .../mssql/0051-table-input-sql-runs-once.hpl       | 105 +++++++++++
 .../mssql/main-0051-table-input-sql-runs-once.hwf  | 192 +++++++++++++++++++++
 .../execution-data-profile/first-last.json         |  16 ++
 .../execution-info-location/local-audit.json       |  13 ++
 .../local-exec-info.json                           |  19 ++
 .../scripts/0051-table-input-sql-runs-once.sql     |  25 +++
 11 files changed, 575 insertions(+), 7 deletions(-)

diff --git 
a/engine/src/main/java/org/apache/hop/execution/sampler/IExecutionDataSamplerStore.java
 
b/engine/src/main/java/org/apache/hop/execution/sampler/IExecutionDataSamplerStore.java
index 79fc4a3716..f5037daeb3 100644
--- 
a/engine/src/main/java/org/apache/hop/execution/sampler/IExecutionDataSamplerStore.java
+++ 
b/engine/src/main/java/org/apache/hop/execution/sampler/IExecutionDataSamplerStore.java
@@ -28,11 +28,13 @@ import org.apache.hop.pipeline.transform.IRowListener;
 public interface IExecutionDataSamplerStore {
 
   /**
-   * Initializes this sampler store
+   * Initializes this sampler store. The row metadata is optional: the local 
pipeline engine passes
+   * null, because working out the fields of a transform can run its work an 
extra time (a Table
+   * Input query, for example). Take the layout from the rows passed to the 
sampler.
    *
    * @param variables The variables to resolve with
-   * @param inputRowMeta Transform input row metadata
-   * @param outputRowMeta Transform output row metadata
+   * @param inputRowMeta Transform input row metadata, or null if not known
+   * @param outputRowMeta Transform output row metadata, or null if not known
    */
   void init(IVariables variables, IRowMeta inputRowMeta, IRowMeta 
outputRowMeta);
 
diff --git 
a/engine/src/main/java/org/apache/hop/lineage/LineageTransformSchemaEmitter.java
 
b/engine/src/main/java/org/apache/hop/lineage/LineageTransformSchemaEmitter.java
index 4c5a713a40..c4fb43c366 100644
--- 
a/engine/src/main/java/org/apache/hop/lineage/LineageTransformSchemaEmitter.java
+++ 
b/engine/src/main/java/org/apache/hop/lineage/LineageTransformSchemaEmitter.java
@@ -74,6 +74,13 @@ public final class LineageTransformSchemaEmitter {
     if (combi == null || combi.transform == null) {
       return;
     }
+    // The design-graph fallback below asks transforms for their fields, which 
can run their work
+    // again (the SQL of a Table Input on SQL Server, for example). Don't do 
that for events that
+    // the hub would drop anyway. See #9036.
+    //
+    if (!LineageHub.getInstance().isEnabled()) {
+      return;
+    }
     LineageContext ctxRuntime = buildRuntimeTransformSchemaContext(combi);
     if (ctxRuntime == null) {
       return;
diff --git 
a/engine/src/main/java/org/apache/hop/pipeline/engines/local/LocalPipelineEngine.java
 
b/engine/src/main/java/org/apache/hop/pipeline/engines/local/LocalPipelineEngine.java
index 001fdf13c2..bb5ec9607e 100644
--- 
a/engine/src/main/java/org/apache/hop/pipeline/engines/local/LocalPipelineEngine.java
+++ 
b/engine/src/main/java/org/apache/hop/pipeline/engines/local/LocalPipelineEngine.java
@@ -35,7 +35,6 @@ import org.apache.hop.core.exception.HopDatabaseException;
 import org.apache.hop.core.exception.HopException;
 import org.apache.hop.core.logging.ILoggingObject;
 import org.apache.hop.core.parameters.INamedParameters;
-import org.apache.hop.core.row.IRowMeta;
 import org.apache.hop.core.util.ExecutorUtil;
 import org.apache.hop.core.variables.IVariables;
 import org.apache.hop.execution.ExecutionBuilder;
@@ -447,9 +446,12 @@ public class LocalPipelineEngine extends Pipeline 
implements IPipelineEngine<Pip
                 lastTransform);
 
         IExecutionDataSamplerStore samplerStore = 
sampler.createSamplerStore(samplerMeta);
-        IRowMeta inputRowMeta = getPipelineMeta().getPrevTransformFields(this, 
combi.transformMeta);
-        IRowMeta outputRowMeta = getPipelineMeta().getTransformFields(this, 
combi.transformMeta);
-        samplerStore.init(this, inputRowMeta, outputRowMeta);
+
+        // Don't ask the transforms for their fields: the samplers take the 
layout from the rows
+        // they sample. Asking can run the work of a transform an extra time, 
for example the SQL
+        // of a Table Input on SQL Server, inserts and procedure calls 
included. See #9036.
+        //
+        samplerStore.init(this, null, null);
         IRowListener rowListener = samplerStore.createRowListener(sampler);
 
         // Keep the stores and samplers safe. We'll need them later on.
diff --git 
a/engine/src/test/java/org/apache/hop/lineage/LineageTransformSchemaEmitterTest.java
 
b/engine/src/test/java/org/apache/hop/lineage/LineageTransformSchemaEmitterTest.java
index 86ba52185a..6193b3bf3d 100644
--- 
a/engine/src/test/java/org/apache/hop/lineage/LineageTransformSchemaEmitterTest.java
+++ 
b/engine/src/test/java/org/apache/hop/lineage/LineageTransformSchemaEmitterTest.java
@@ -18,15 +18,27 @@
 package org.apache.hop.lineage;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
 
 import java.util.List;
+import org.apache.hop.core.logging.ILogChannel;
 import org.apache.hop.core.row.IRowMeta;
 import org.apache.hop.core.row.IValueMeta;
 import org.apache.hop.core.row.RowMeta;
 import org.apache.hop.core.row.value.ValueMetaFactory;
 import org.apache.hop.core.row.value.ValueMetaInteger;
 import org.apache.hop.core.row.value.ValueMetaString;
+import org.apache.hop.lineage.hub.LineageConfiguration;
 import org.apache.hop.lineage.model.LineageFieldSchema;
+import org.apache.hop.pipeline.PipelineMeta;
+import org.apache.hop.pipeline.engine.IPipelineEngine;
+import org.apache.hop.pipeline.transform.ITransform;
+import org.apache.hop.pipeline.transform.TransformMeta;
+import org.apache.hop.pipeline.transform.TransformMetaDataCombi;
 import org.junit.jupiter.api.Test;
 
 class LineageTransformSchemaEmitterTest {
@@ -53,4 +65,40 @@ class LineageTransformSchemaEmitterTest {
     assertEquals(0, 
LineageTransformSchemaEmitter.fieldsFromRowMeta(null).size());
     assertEquals(0, LineageTransformSchemaEmitter.fieldsFromRowMeta(new 
RowMeta()).size());
   }
+
+  /**
+   * Issue #9036: the last transform of a pipeline has no output row sets, so 
the emitter fell back
+   * to the pipeline graph and asked the transforms for their fields. A Table 
Input on SQL Server
+   * runs its SQL to answer that, so its inserts ran twice. With lineage off 
nothing is emitted, so
+   * nothing may be asked either.
+   */
+  @Test
+  @SuppressWarnings("unchecked")
+  void disabledLineageDoesNotAskTransformsForTheirFields() throws Exception {
+    String previous = 
System.clearProperty(LineageVariables.HOP_LINEAGE_ENABLED);
+    LineageConfiguration.invalidate();
+    try {
+      PipelineMeta pipelineMeta = mock(PipelineMeta.class);
+      IPipelineEngine<PipelineMeta> pipeline = mock(IPipelineEngine.class);
+      when(pipeline.getPipelineMeta()).thenReturn(pipelineMeta);
+      ITransform transform = mock(ITransform.class);
+      when(transform.getPipeline()).thenReturn(pipeline);
+      when(transform.getLogChannel()).thenReturn(mock(ILogChannel.class));
+
+      TransformMetaDataCombi combi = new TransformMetaDataCombi();
+      combi.transformName = "Output";
+      combi.transform = transform;
+      combi.transformMeta = new TransformMeta();
+
+      LineageTransformSchemaEmitter.emitTransformBoundarySchemas(combi);
+
+      verify(pipelineMeta, never()).getTransformFields(any(), 
any(TransformMeta.class));
+      verify(pipelineMeta, never()).getPrevTransformFields(any(), 
any(TransformMeta.class));
+    } finally {
+      if (previous != null) {
+        System.setProperty(LineageVariables.HOP_LINEAGE_ENABLED, previous);
+      }
+      LineageConfiguration.invalidate();
+    }
+  }
 }
diff --git 
a/engine/src/test/java/org/apache/hop/pipeline/engines/local/LocalPipelineEngineSamplersTest.java
 
b/engine/src/test/java/org/apache/hop/pipeline/engines/local/LocalPipelineEngineSamplersTest.java
new file mode 100644
index 0000000000..5d89d185b5
--- /dev/null
+++ 
b/engine/src/test/java/org/apache/hop/pipeline/engines/local/LocalPipelineEngineSamplersTest.java
@@ -0,0 +1,139 @@
+/*
+ * 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.engines.local;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.hop.core.logging.HopLogStore;
+import org.apache.hop.core.logging.LogChannel;
+import org.apache.hop.core.row.IRowMeta;
+import org.apache.hop.core.row.RowBuffer;
+import org.apache.hop.core.row.RowMeta;
+import org.apache.hop.core.row.value.ValueMetaInteger;
+import org.apache.hop.core.variables.Variables;
+import org.apache.hop.execution.ExecutionInfoLocation;
+import org.apache.hop.execution.IExecutionInfoLocation;
+import org.apache.hop.execution.profiling.ExecutionDataProfile;
+import org.apache.hop.execution.sampler.ExecutionDataSamplerMeta;
+import org.apache.hop.execution.sampler.IExecutionDataSampler;
+import org.apache.hop.execution.sampler.IExecutionDataSamplerStore;
+import 
org.apache.hop.execution.sampler.plugins.first.FirstRowsExecutionDataSampler;
+import org.apache.hop.metadata.serializer.memory.MemoryMetadataProvider;
+import org.apache.hop.pipeline.PipelineMeta;
+import org.apache.hop.pipeline.config.PipelineRunConfiguration;
+import org.apache.hop.pipeline.transform.IRowListener;
+import org.apache.hop.pipeline.transform.ITransform;
+import org.apache.hop.pipeline.transform.ITransformMeta;
+import org.apache.hop.pipeline.transform.TransformIOMeta;
+import org.apache.hop.pipeline.transform.TransformMeta;
+import org.apache.hop.pipeline.transform.TransformMetaDataCombi;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+
+class LocalPipelineEngineSamplersTest {
+
+  @BeforeAll
+  static void initLogging() {
+    if (!HopLogStore.isInitialized()) {
+      HopLogStore.init();
+    }
+  }
+
+  /**
+   * Issue #9036: attaching the samplers asked every transform for its output 
fields. A Table Input
+   * on SQL Server can only answer that by running its SQL, so inserts and 
procedure calls in that
+   * SQL ran twice.
+   */
+  @Test
+  void attachingSamplersDoesNotAskTransformsForTheirFields() throws Exception {
+    ITransformMeta transformMeta = mock(ITransformMeta.class);
+    when(transformMeta.getTransformIOMeta())
+        .thenReturn(new TransformIOMeta(false, true, false, false, false, 
false));
+    PipelineMeta pipelineMeta = new PipelineMeta();
+    pipelineMeta.setName("samplers");
+    TransformMeta input = new TransformMeta("input", transformMeta);
+    pipelineMeta.addTransform(input);
+
+    MemoryMetadataProvider metadataProvider = new MemoryMetadataProvider();
+    metadataProvider
+        .getSerializer(ExecutionDataProfile.class)
+        .save(
+            new ExecutionDataProfile(
+                "first-rows",
+                null,
+                List.<IExecutionDataSampler>of(new 
FirstRowsExecutionDataSampler("10"))));
+
+    LocalPipelineEngine engine =
+        new LocalPipelineEngine(pipelineMeta) {
+          {
+            setTransforms(new ArrayList<>());
+          }
+        };
+    engine.setLogChannel(new LogChannel("samplers"));
+    engine.setMetadataProvider(metadataProvider);
+    PipelineRunConfiguration runConfiguration = new PipelineRunConfiguration();
+    runConfiguration.setExecutionDataProfileName("first-rows");
+    engine.setPipelineRunConfiguration(runConfiguration);
+
+    ExecutionInfoLocation location = new ExecutionInfoLocation();
+    location.setExecutionInfoLocation(mock(IExecutionInfoLocation.class));
+    engine.setExecutionInfoLocation(location);
+
+    ITransform transform = mock(ITransform.class);
+    TransformMetaDataCombi combi = new TransformMetaDataCombi();
+    combi.transformName = "input";
+    combi.copy = 0;
+    combi.transformMeta = input;
+    combi.meta = transformMeta;
+    combi.transform = transform;
+    engine.getTransforms().add(combi);
+
+    engine.addTransformExecutionSamplers();
+
+    verify(transform).addRowListener(any(IRowListener.class));
+    verify(transformMeta, never()).getFields(any(), any(), any(), any(), 
any(), any(), any());
+    verify(transformMeta, never()).getFields(any(), any(), any(), any(), 
any(), any());
+    verify(transformMeta, never()).getTableFields(any());
+  }
+
+  /** Without row metadata at init time the sampler takes the layout from the 
first sampled row. */
+  @Test
+  void samplerStoreTakesTheLayoutFromTheRows() throws Exception {
+    FirstRowsExecutionDataSampler sampler = new 
FirstRowsExecutionDataSampler("10");
+    IExecutionDataSamplerStore store =
+        sampler.createSamplerStore(new ExecutionDataSamplerMeta("input", "0", 
"id", true, true));
+    store.init(new Variables(), null, null);
+    IRowListener listener = store.createRowListener(sampler);
+
+    IRowMeta rowMeta = new RowMeta();
+    rowMeta.addValueMeta(new ValueMetaInteger("runs"));
+    listener.rowWrittenEvent(rowMeta, new Object[] {1L});
+
+    RowBuffer buffer = store.getSamples().values().iterator().next();
+    assertSame(rowMeta, buffer.getRowMeta());
+    assertEquals(1, buffer.getBuffer().size());
+  }
+}
diff --git a/integration-tests/mssql/0051-table-input-sql-runs-once.hpl 
b/integration-tests/mssql/0051-table-input-sql-runs-once.hpl
new file mode 100644
index 0000000000..e54abb6f3d
--- /dev/null
+++ b/integration-tests/mssql/0051-table-input-sql-runs-once.hpl
@@ -0,0 +1,105 @@
+<?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>0051-table-input-sql-runs-once</name>
+    <name_sync_with_filename>Y</name_sync_with_filename>
+    <description>A Table Input whose SQL inserts a row before it selects: 
every execution of that SQL leaves a row in it0051_run_log</description>
+    <extended_description>Hop may only run the SQL of a Table Input to read 
the rows, not to work out its output fields (#9036). RUN_LABEL goes into the 
SQL so every case has its own SQL text: the database cache of query fields is 
shared by the whole JVM, and an entry for one case would otherwise hide the 
extra execution in the next.</extended_description>
+    <pipeline_version/>
+    <pipeline_type>Normal</pipeline_type>
+    <parameters>
+      <parameter>
+        <name>RUN_LABEL</name>
+        <default_value>default</default_value>
+        <description>Written to it0051_run_log by every execution of the 
SQL</description>
+      </parameter>
+    </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/11/05 12:00:00.000</created_date>
+    <modified_user>-</modified_user>
+    <modified_date>2026/11/05 12:00:00.000</modified_date>
+  </info>
+  <notepads>
+  </notepads>
+  <order>
+    <hop>
+      <from>Insert and count</from>
+      <to>Log runs</to>
+      <enabled>Y</enabled>
+    </hop>
+  </order>
+  <transform>
+    <name>Insert and count</name>
+    <type>TableInput</type>
+    <description/>
+    <distribute>Y</distribute>
+    <custom_distribution/>
+    <copies>1</copies>
+    <partitioning>
+      <method>none</method>
+      <schema_name/>
+    </partitioning>
+    <connection>mssql-2022</connection>
+    <sql>INSERT INTO it0051_run_log (run_label) VALUES ('${RUN_LABEL}');
+SELECT COUNT(*) AS runs FROM it0051_run_log WHERE run_label = 
'${RUN_LABEL}';</sql>
+    <limit>0</limit>
+    <lookup/>
+    <execute_each_row>N</execute_each_row>
+    <variables_active>Y</variables_active>
+    <attributes/>
+    <GUI>
+      <xloc>128</xloc>
+      <yloc>96</yloc>
+    </GUI>
+  </transform>
+  <transform>
+    <name>Log runs</name>
+    <type>WriteToLog</type>
+    <description/>
+    <distribute>Y</distribute>
+    <custom_distribution/>
+    <copies>1</copies>
+    <partitioning>
+      <method>none</method>
+      <schema_name/>
+    </partitioning>
+    <displayHeader>Y</displayHeader>
+    <fields>
+      <field>
+        <name>runs</name>
+      </field>
+    </fields>
+    <limitRows>N</limitRows>
+    <limitRowsNumber>0</limitRowsNumber>
+    <loglevel>Basic</loglevel>
+    <attributes/>
+    <GUI>
+      <xloc>320</xloc>
+      <yloc>96</yloc>
+    </GUI>
+  </transform>
+  <transform_error_handling>
+  </transform_error_handling>
+  <attributes/>
+</pipeline>
diff --git a/integration-tests/mssql/main-0051-table-input-sql-runs-once.hwf 
b/integration-tests/mssql/main-0051-table-input-sql-runs-once.hwf
new file mode 100644
index 0000000000..f1146202ae
--- /dev/null
+++ b/integration-tests/mssql/main-0051-table-input-sql-runs-once.hwf
@@ -0,0 +1,192 @@
+<?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-0051-table-input-sql-runs-once</name>
+  <name_sync_with_filename>Y</name_sync_with_filename>
+  <description>The SQL of a Table Input on SQL Server runs once per pipeline 
run, with and without execution information and a data profile 
(#9036)</description>
+  <extended_description>Hop asked the transforms for their output fields twice 
during a run: to attach the samplers of a data profile, and to report transform 
schemas to lineage (even with lineage off). A Table Input on SQL Server can 
only answer by running its SQL, so inserts and procedure calls in it ran twice. 
The run under 'local' covers the lineage path, the run under 'local-exec-info' 
the samplers as well.</extended_description>
+  <workflow_version/>
+  <created_user>-</created_user>
+  <created_date>2026/11/05 12:00:00.000</created_date>
+  <modified_user>-</modified_user>
+  <modified_date>2026/11/05 12:00:00.000</modified_date>
+  <parameters>
+    </parameters>
+  <actions>
+    <action>
+      <name>Start</name>
+      <description/>
+      <type>SPECIAL</type>
+      <attributes/>
+      <repeat>N</repeat>
+      <schedulerType>0</schedulerType>
+      <intervalSeconds>0</intervalSeconds>
+      <intervalMinutes>60</intervalMinutes>
+      <hour>12</hour>
+      <minutes>0</minutes>
+      <weekDay>1</weekDay>
+      <DayOfMonth>1</DayOfMonth>
+      <parallel>N</parallel>
+      <xloc>64</xloc>
+      <yloc>48</yloc>
+      <attributes_hac/>
+    </action>
+    <action>
+      <name>reset run log</name>
+      <description/>
+      <type>SQL</type>
+      <attributes/>
+      <sql/>
+      <useVariableSubstitution>F</useVariableSubstitution>
+      <sqlfromfile>T</sqlfromfile>
+      
<sqlfilename>${PROJECT_HOME}/scripts/0051-table-input-sql-runs-once.sql</sqlfilename>
+      <sendOneStatement>F</sendOneStatement>
+      <connection>mssql-2022</connection>
+      <parallel>N</parallel>
+      <xloc>224</xloc>
+      <yloc>48</yloc>
+      <attributes_hac/>
+    </action>
+    <action>
+      <name>run local</name>
+      <description/>
+      <type>PIPELINE</type>
+      <attributes/>
+      <filename>${PROJECT_HOME}/0051-table-input-sql-runs-once.hpl</filename>
+      <params_from_previous>N</params_from_previous>
+      <exec_per_row>N</exec_per_row>
+      <clear_rows>N</clear_rows>
+      <clear_files>N</clear_files>
+      <set_logfile>N</set_logfile>
+      <logfile/>
+      <logext/>
+      <add_date>N</add_date>
+      <add_time>N</add_time>
+      <loglevel>Basic</loglevel>
+      <set_append_logfile>N</set_append_logfile>
+      <wait_until_finished>Y</wait_until_finished>
+      <follow_abort_remote>N</follow_abort_remote>
+      <create_parent_folder>N</create_parent_folder>
+      <run_configuration>local</run_configuration>
+      <parameters>
+        <parameter>
+          <name>RUN_LABEL</name>
+          <stream_name/>
+          <value>local</value>
+        </parameter>
+        <pass_all_parameters>Y</pass_all_parameters>
+      </parameters>
+      <parallel>N</parallel>
+      <xloc>416</xloc>
+      <yloc>48</yloc>
+      <attributes_hac/>
+    </action>
+    <action>
+      <name>run local-exec-info</name>
+      <description/>
+      <type>PIPELINE</type>
+      <attributes/>
+      <filename>${PROJECT_HOME}/0051-table-input-sql-runs-once.hpl</filename>
+      <params_from_previous>N</params_from_previous>
+      <exec_per_row>N</exec_per_row>
+      <clear_rows>N</clear_rows>
+      <clear_files>N</clear_files>
+      <set_logfile>N</set_logfile>
+      <logfile/>
+      <logext/>
+      <add_date>N</add_date>
+      <add_time>N</add_time>
+      <loglevel>Basic</loglevel>
+      <set_append_logfile>N</set_append_logfile>
+      <wait_until_finished>Y</wait_until_finished>
+      <follow_abort_remote>N</follow_abort_remote>
+      <create_parent_folder>N</create_parent_folder>
+      <run_configuration>local-exec-info</run_configuration>
+      <parameters>
+        <parameter>
+          <name>RUN_LABEL</name>
+          <stream_name/>
+          <value>exec-info</value>
+        </parameter>
+        <pass_all_parameters>Y</pass_all_parameters>
+      </parameters>
+      <parallel>N</parallel>
+      <xloc>608</xloc>
+      <yloc>48</yloc>
+      <attributes_hac/>
+    </action>
+    <action>
+      <name>check one execution per run</name>
+      <description>Every run executes the SQL once: one row per 
label</description>
+      <type>EVAL_TABLE_CONTENT</type>
+      <attributes/>
+      <connection>mssql-2022</connection>
+      <schemaname/>
+      <tablename/>
+      <success_condition>rows_count_equal</success_condition>
+      <limit>1</limit>
+      <is_custom_sql>Y</is_custom_sql>
+      <is_usevars>N</is_usevars>
+      <custom_sql>SELECT 1
+WHERE (SELECT COUNT(*) FROM it0051_run_log WHERE run_label = 
&apos;local&apos;) = 1
+  AND (SELECT COUNT(*) FROM it0051_run_log WHERE run_label = 
&apos;exec-info&apos;) = 1
+  AND (SELECT COUNT(*) FROM it0051_run_log) = 2</custom_sql>
+      <add_rows_result>N</add_rows_result>
+      <clear_result_rows>Y</clear_result_rows>
+      <parallel>N</parallel>
+      <xloc>800</xloc>
+      <yloc>48</yloc>
+      <attributes_hac/>
+    </action>
+  </actions>
+  <hops>
+    <hop>
+      <from>Start</from>
+      <to>reset run log</to>
+      <enabled>Y</enabled>
+      <evaluation>Y</evaluation>
+      <unconditional>Y</unconditional>
+    </hop>
+    <hop>
+      <from>reset run log</from>
+      <to>run local</to>
+      <enabled>Y</enabled>
+      <evaluation>Y</evaluation>
+      <unconditional>N</unconditional>
+    </hop>
+    <hop>
+      <from>run local</from>
+      <to>run local-exec-info</to>
+      <enabled>Y</enabled>
+      <evaluation>Y</evaluation>
+      <unconditional>Y</unconditional>
+    </hop>
+    <hop>
+      <from>run local-exec-info</from>
+      <to>check one execution per run</to>
+      <enabled>Y</enabled>
+      <evaluation>Y</evaluation>
+      <unconditional>Y</unconditional>
+    </hop>
+  </hops>
+  <notepads>
+  </notepads>
+  <attributes/>
+</workflow>
diff --git 
a/integration-tests/mssql/metadata/execution-data-profile/first-last.json 
b/integration-tests/mssql/metadata/execution-data-profile/first-last.json
new file mode 100644
index 0000000000..3e6dad8925
--- /dev/null
+++ b/integration-tests/mssql/metadata/execution-data-profile/first-last.json
@@ -0,0 +1,16 @@
+{
+  "name": "first-last",
+  "description": "",
+  "sampler": [
+    {
+      "FirstRowsExecutionDataSampler": {
+        "sampleSize": "100"
+      }
+    },
+    {
+      "LastRowsExecutionDataSampler": {
+        "sampleSize": "100"
+      }
+    }
+  ]
+}
diff --git 
a/integration-tests/mssql/metadata/execution-info-location/local-audit.json 
b/integration-tests/mssql/metadata/execution-info-location/local-audit.json
new file mode 100644
index 0000000000..9f80401165
--- /dev/null
+++ b/integration-tests/mssql/metadata/execution-info-location/local-audit.json
@@ -0,0 +1,13 @@
+{
+  "executionInfoLocation": {
+    "local-folder": {
+      "pluginName": "File location",
+      "pluginId": "local-folder",
+      "rootFolder": "${HOP_AUDIT_FOLDER}/executions/"
+    }
+  },
+  "dataLoggingDelay": "2000",
+  "name": "local-audit",
+  "description": "Execution information in the audit folder of the test run",
+  "dataLoggingInterval": "5000"
+}
diff --git 
a/integration-tests/mssql/metadata/pipeline-run-configuration/local-exec-info.json
 
b/integration-tests/mssql/metadata/pipeline-run-configuration/local-exec-info.json
new file mode 100644
index 0000000000..ac2cbd48de
--- /dev/null
+++ 
b/integration-tests/mssql/metadata/pipeline-run-configuration/local-exec-info.json
@@ -0,0 +1,19 @@
+{
+  "engineRunConfiguration": {
+    "Local": {
+      "feedback_size": "50000",
+      "sample_size": "100",
+      "sample_type_in_gui": "Last",
+      "rowset_size": "10000",
+      "safe_mode": false,
+      "show_feedback": false,
+      "topo_sort": false,
+      "gather_metrics": false
+    }
+  },
+  "configurationVariables": [],
+  "name": "local-exec-info",
+  "description": "Local engine with execution information and a data profile",
+  "executionInfoLocationName": "local-audit",
+  "dataProfile": "first-last"
+}
diff --git a/integration-tests/mssql/scripts/0051-table-input-sql-runs-once.sql 
b/integration-tests/mssql/scripts/0051-table-input-sql-runs-once.sql
new file mode 100644
index 0000000000..f47d915666
--- /dev/null
+++ b/integration-tests/mssql/scripts/0051-table-input-sql-runs-once.sql
@@ -0,0 +1,25 @@
+/*
+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.
+*/
+
+-- One row per execution of the Table Input SQL of 
0051-table-input-sql-runs-once.hpl
+--
+DROP TABLE IF EXISTS it0051_run_log;
+CREATE TABLE it0051_run_log
+(
+  run_label VARCHAR(50) NOT NULL
+, run_at DATETIME2 DEFAULT SYSDATETIME()
+);

Reply via email to