Skip to content

Commit

Permalink
fix(ftpfile): 携带路径时去掉多余前缀
Browse files Browse the repository at this point in the history
  • Loading branch information
chaorongzhi committed Sep 3, 2024
1 parent 6043592 commit 89494ee
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,17 @@ protected SeaTunnelRow dataCarryFilename(SeaTunnelRow seaTunnelRow, String path)
} else {
System.arraycopy(fields, 1, newFields, 1, fields.length - 1);
}
newFields[0] = path;
String oriPath = pluginConfig.getString(BaseSourceConfigOptions.FILE_PATH.key());
String[] split = path.split(oriPath.replace("\\", "/"));
String filePath = oriPath;
if (split.length > 1) {
if (oriPath.endsWith("/")) {
filePath = oriPath + split[1];
} else {
filePath = oriPath + "/" + split[1];
}
}
newFields[0] = filePath;
SeaTunnelRow newSeaTunnelRow = new SeaTunnelRow(newFields);
newSeaTunnelRow.setRowKind(seaTunnelRow.getRowKind());
newSeaTunnelRow.setTableId(seaTunnelRow.getTableId());
Expand Down

0 comments on commit 89494ee

Please sign in to comment.