healchow commented on code in PR #7541: URL: https://github.com/apache/inlong/pull/7541#discussion_r1128798630
########## inlong-sort/sort-connectors/starrocks/src/main/java/org/apache/inlong/sort/starrocks/manager/StarRocksSinkManager.java: ########## @@ -523,35 +523,37 @@ private boolean asyncFlush() throws Exception { private void handleDirtyData(SinkBufferEntity flushData, Exception e) throws JsonProcessingException { // archive dirty data - if (StarRocksSinkOptions.StreamLoadFormat.CSV.equals(sinkOptions.getStreamLoadFormat())) { - String columnSeparator = StarRocksDelimiterParser.parse( - sinkOptions.getSinkStreamLoadProperties().get("column_separator"), "\t"); - String[] col = flushData.getColumns().split(","); - int len = col.length; - for (byte[] row : flushData.getBuffer()) { - Map<String, String> jsonData = new LinkedHashMap<>(16); - // convert csv to json - String[] values = new String(row, StandardCharsets.UTF_8).split(columnSeparator); - for (int i = 0; i < len && i < values.length; i++) { - jsonData.put(col[i], values[i]); + if (dirtySinkHelper.getDirtyOptions().ignoreDirty()) { Review Comment: 1. Does the condition here need to be reversed? 2. Can you use guard statements to simplify the code, for example: ```java if (true) { return; } // other operations, not need to use else statement ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org