diff --git a/src/main/java/org/embulk/output/SnowflakeOutputPlugin.java b/src/main/java/org/embulk/output/SnowflakeOutputPlugin.java index 7f34019..0afc206 100644 --- a/src/main/java/org/embulk/output/SnowflakeOutputPlugin.java +++ b/src/main/java/org/embulk/output/SnowflakeOutputPlugin.java @@ -167,8 +167,7 @@ protected JdbcOutputConnector getConnector(PluginTask task, boolean retryableMet throw new ConfigException(e); } } - - props.setProperty("warehouse", t.getWarehouse()); + props.setProperty("warehouse", wrapDoubleQuates(t.getWarehouse())); props.setProperty("db", t.getDatabase()); props.setProperty("schema", t.getSchema()); if (!t.getRole().isEmpty()) { @@ -368,4 +367,12 @@ public void timestampColumn(Column column) { } return new JdbcSchema(Collections.unmodifiableList(columns)); } + + private String wrapDoubleQuates(String s) { + if (s.startsWith("\"") && s.endsWith("\"")) { + return s; + } + + return "\"" + s + "\""; + } }