diff --git a/linkis-commons/linkis-storage/src/main/java/org/apache/linkis/storage/csv/StorageCSVWriter.java b/linkis-commons/linkis-storage/src/main/java/org/apache/linkis/storage/csv/StorageCSVWriter.java index ed7527bcbc..ba4d877f3a 100644 --- a/linkis-commons/linkis-storage/src/main/java/org/apache/linkis/storage/csv/StorageCSVWriter.java +++ b/linkis-commons/linkis-storage/src/main/java/org/apache/linkis/storage/csv/StorageCSVWriter.java @@ -102,8 +102,8 @@ private String compact(String[] row) { rowBuilder.append(decoratedValue).append(delimiter); } if (rowBuilder.length() > 0 && rowBuilder.toString().endsWith(delimiter)) { - int index = rowBuilder.lastIndexOf(separator); - rowBuilder.delete(index, index + separator.length()); + int index = rowBuilder.lastIndexOf(delimiter); + rowBuilder.delete(index, index + delimiter.length()); } rowBuilder.append("\n"); if (logger.isDebugEnabled()) {