Hello,

In some ETL I read a SQL script which I then execute in a table input step. The SQL is supposed to output 1 row with 1 column with a specified name. Now in some of these scripts, I want to add some statement not generating result rows.

To fix the idea, this is a query doing a count of what just changed, and this script running against hive an example would be:
Code:
set hive.query.name=something;
select count(*) from somewhere where something;
Pentaho fails with the error:
java.sql.SQLException: The query did not generate a result set!
A requirement is that the Pentaho job is a generic job executing whatever SQL it finds in some directory, so I cannot do much in Pentaho itself. The best option I have found so far is to run an external command for which I would capture the output but it feels very brittle.

How could I do what I want?
Thanks,