Skip to content

Commit c234f9b

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

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

+5-2
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", "\"" + escapeDoubleQuote(t.getWarehouse()) + "\"");
172171
props.setProperty("db", t.getDatabase());
173172
props.setProperty("schema", t.getSchema());
174173
if (!t.getRole().isEmpty()) {
@@ -368,4 +367,8 @@ public void timestampColumn(Column column) {
368367
}
369368
return new JdbcSchema(Collections.unmodifiableList(columns));
370369
}
370+
371+
private String escapeDoubleQuote(String s) {
372+
return s.replaceAll("\"", "\"\"");
373+
}
371374
}

0 commit comments

Comments
 (0)