Skip to content

Commit

Permalink
fix: newline problem (DataLinkDC#2076)
Browse files Browse the repository at this point in the history
* refactor: package uri wrong, and trivial optimization

* fix: \r\n problem

Signed-off-by: Licho <lecho.sun@gmail.com>

* Spotless Apply

---------

Signed-off-by: Licho <lecho.sun@gmail.com>
Co-authored-by: leechor <leechor@users.noreply.github.com>
  • Loading branch information
leechor and leechor authored Jun 15, 2023
1 parent a3eb3fd commit d50f125
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ private String getMessageFromHtmlTemplate(String title, String content) {

requireNonNull(content, "content must not null");
String htmlTableThead =
StringUtils.isEmpty(title) ? "" : String.format("<thead>%s</thead>%n", title);
StringUtils.isEmpty(title) ? "" : String.format("<thead>%s</thead>\n", title);

return EmailConstants.HTML_HEADER_PREFIX
+ htmlTableThead
Expand Down
2 changes: 1 addition & 1 deletion dinky-common/src/main/java/org/dinky/data/model/Table.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public String getFlinkDDL(String flinkConfig, String tableName) {
@Transient
public String getFlinkTableSql(String catalogName, String flinkConfig) {
String createSql = getFlinkDDL(getFlinkTableWith(flinkConfig), name);
return String.format("DROP TABLE IF EXISTS %s;%n%s", name, createSql);
return String.format("DROP TABLE IF EXISTS %s;\n%s", name, createSql);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,19 @@ public String getSqlSelect(Table table) {
columnComment = columnComment.replaceAll("[\"']", "");
}
sb.append(
String.format("`%s` -- %s %n", columns.get(i).getName(), columnComment));
String.format("`%s` -- %s \n", columns.get(i).getName(), columnComment));
} else {
sb.append(String.format("`%s` %%n", columns.get(i).getName()));
sb.append(String.format("`%s` %\n", columns.get(i).getName()));
}
}

if (Asserts.isNotNullString(table.getComment())) {
sb.append(
String.format(
" FROM %s.%s; -- %s%n",
" FROM %s.%s; -- %s\n",
table.getSchema(), table.getName(), table.getComment()));
} else {
sb.append(String.format(" FROM %s.%s;%n", table.getSchema(), table.getName()));
sb.append(String.format(" FROM %s.%s;\n", table.getSchema(), table.getName()));
}
return sb.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,10 @@ public String getSqlSelect(Table table) {
if (Asserts.isNotNullString(table.getComment())) {
sb.append(
String.format(
" FROM `%s`.`%s`; -- %s%n",
" FROM `%s`.`%s`; -- %s\n",
table.getSchema(), table.getName(), table.getComment()));
} else {
sb.append(String.format(" FROM `%s`.`%s`;%n", table.getSchema(), table.getName()));
sb.append(String.format(" FROM `%s`.`%s`;\n", table.getSchema(), table.getName()));
}
return sb.toString();
}
Expand Down

0 comments on commit d50f125

Please sign in to comment.