Skip to content

Commit

Permalink
[INLONG-11095][Manager] Fix the problem of data preview field misalig…
Browse files Browse the repository at this point in the history
…nment
  • Loading branch information
fuweng11 committed Sep 13, 2024
1 parent 70968a9 commit 6526dbc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class QueryMessageRequest {
private String streamId;

@ApiModelProperty(value = "Message count")
private Integer messageCount = 100;
private Integer messageCount = 10;

@ApiModelProperty(value = "Field name")
private String fieldName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,13 @@ public List<FieldInfo> parseFields(String str, InlongStreamInfo streamInfo) thro
if (StringUtils.isNotBlank(streamInfo.getDataEscapeChar())) {
escapeChar = streamInfo.getDataEscapeChar().charAt(0);
}
String[][] rowValues = SplitUtils.splitCsv(str, separator, escapeChar, '\"', '\n', true);
String[][] rowValues = SplitUtils.splitCsv(str, separator, escapeChar, null, '\n', true);
int fieldIndex = 0;
for (int i = 0; i < rowValues.length; i++) {
String[] fieldValues = rowValues[i];
for (int j = 0; j < fieldValues.length; j++) {
if (i + j < fields.size()) {
fields.get(i + j).setFieldValue(fieldValues[j]);
fields.get(fieldIndex++).setFieldValue(fieldValues[j]);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public List<FieldInfo> parseFields(String str, InlongStreamInfo streamInfo) thro
lineSeparator = (char) Integer.parseInt(streamInfo.getLineSeparator());
}
List<Map<String, String>> rowValues =
KvUtils.splitKv(str, separator, kvSeparator, escapeChar, '\"', lineSeparator);
KvUtils.splitKv(str, separator, kvSeparator, escapeChar, null, lineSeparator);
for (Map<String, String> row : rowValues) {
for (FieldInfo fieldInfo : fields) {
fieldInfo.setFieldValue(row.get(fieldInfo.getFieldName()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ public List<BriefMQMessage> queryLatestMessage(PulsarClusterInfo pulsarClusterIn
LOGGER.info("begin to query message for topic {}, adminUrl={}", topicFullName, pulsarClusterInfo.getAdminUrl());
List<BriefMQMessage> messageList = new ArrayList<>();
int partitionCount = getPartitionCount(pulsarClusterInfo, topicFullName);
for (int messageIndex = 0; messageIndex < 100; messageIndex++) {
for (int messageIndex = 0; messageIndex < request.getMessageCount(); messageIndex++) {
int currentPartitionNum = messageIndex % partitionCount;
int messagePosition = messageIndex / partitionCount + 1;
String topicNameOfPartition = buildTopicNameOfPartition(topicFullName, currentPartitionNum, serial);
Expand Down

0 comments on commit 6526dbc

Please sign in to comment.