mirror of https://github.com/alibaba/DataX.git
fix an error
This commit is contained in:
parent
abf3ea0230
commit
7097651cd8
|
@ -22,7 +22,7 @@ public class SqlWriter implements UnstructuredWriter {
|
||||||
this.sqlWriter = writer;
|
this.sqlWriter = writer;
|
||||||
this.quoteChar = quoteChar;
|
this.quoteChar = quoteChar;
|
||||||
this.lineSeparator = lineSeparator;
|
this.lineSeparator = lineSeparator;
|
||||||
this.tableName = tableName;
|
this.tableName = quoteChar + tableName + quoteChar;
|
||||||
this.nullFormat = nullFormat;
|
this.nullFormat = nullFormat;
|
||||||
buildInsertPrefix(columnNames);
|
buildInsertPrefix(columnNames);
|
||||||
}
|
}
|
||||||
|
@ -55,10 +55,9 @@ public class SqlWriter implements UnstructuredWriter {
|
||||||
sb.append(quoteChar).append(columnName).append(quoteChar);
|
sb.append(quoteChar).append(columnName).append(quoteChar);
|
||||||
}
|
}
|
||||||
|
|
||||||
int capacity = 18 + tableName.length() + sb.length();
|
int capacity = 16 + tableName.length() + sb.length();
|
||||||
this.insertPrefix = new StringBuilder(capacity);
|
this.insertPrefix = new StringBuilder(capacity);
|
||||||
this.insertPrefix
|
this.insertPrefix.append("INSERT INTO ").append(tableName).append(" (").append(sb).append(")").append(" VALUES(");
|
||||||
.append("INSERT INTO ").append(quoteChar).append(tableName).append(quoteChar).append(" (").append(sb).append(")").append(" VALUES(");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void appendCommit() throws IOException {
|
public void appendCommit() throws IOException {
|
||||||
|
|
Loading…
Reference in New Issue