Skip to content

Commit cc5298a

Browse files
committed
Wrap names with double quotes
1 parent 5fd4e49 commit cc5298a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,7 @@ protected JdbcOutputConnector getConnector(PluginTask task, boolean retryableMet
167167
throw new ConfigException(e);
168168
}
169169
}
170-
171-
props.setProperty("warehouse", t.getWarehouse());
170+
props.setProperty("warehouse", wrapDoubleQuates(t.getWarehouse()));
172171
props.setProperty("db", t.getDatabase());
173172
props.setProperty("schema", t.getSchema());
174173
if (!t.getRole().isEmpty()) {
@@ -368,4 +367,12 @@ public void timestampColumn(Column column) {
368367
}
369368
return new JdbcSchema(Collections.unmodifiableList(columns));
370369
}
370+
371+
private String wrapDoubleQuates(String s) {
372+
if (s.startsWith("\"") && s.endsWith("\"")) {
373+
return s;
374+
}
375+
376+
return "\"" + s + "\"";
377+
}
371378
}

0 commit comments

Comments
 (0)