Skip to content

Commit 6241505

Browse files
committed
consider delete_stage option to delete stage
1 parent d0fad24 commit 6241505

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/org/embulk/output/SnowflakeOutputPlugin.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,11 @@ public ConfigDiff transaction(
147147
snowflakeCon = (SnowflakeOutputConnection) getConnector(task, true).connect(true);
148148
snowflakeCon.runCreateStage(this.stageIdentifier);
149149
configDiff = super.transaction(config, schema, taskCount, control);
150-
snowflakeCon.runDropStage(this.stageIdentifier);
150+
if (t.getDeleteStage()) {
151+
snowflakeCon.runDropStage(this.stageIdentifier);
152+
}
151153
} catch (Exception e) {
152-
if (t.getDeleteStageOnError()) {
154+
if (t.getDeleteStage() && t.getDeleteStageOnError()) {
153155
try {
154156
snowflakeCon.runDropStage(this.stageIdentifier);
155157
} catch (SQLException ex) {

0 commit comments

Comments
 (0)