You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/10/25 08:05:55 UTC

[GitHub] [inlong] fuweng11 opened a new pull request, #6277: [INLONG-6276][Manager] Fix the problem of passing the ascll code when submitting the sort task

fuweng11 opened a new pull request, #6277:
URL: https://github.com/apache/inlong/pull/6277

   
   ### Prepare a Pull Request
   
   - Fixes #6276 
   
   ### Motivation
   
   When submitting sort, the data separator is a number.
   
   ### Modifications
   
   Before submitting the sort task, the separator is judged. If it is a number, it will be converted into characters
   
   ### Verifying this change
   
   
   - [X] This change is a trivial rework/code cleanup without any test coverage.
   
   - [ ] This change is already covered by existing tests, such as:
     *(please describe tests)*
   
   - [ ] This change added tests and can be verified as follows:
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (no)
   
   


-- 
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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] luchunliang commented on a diff in pull request #6277: [INLONG-6276][Manager] Fix the problem of passing the ascll code when submitting the sort task

Posted by GitBox <gi...@apache.org>.
luchunliang commented on code in PR #6277:
URL: https://github.com/apache/inlong/pull/6277#discussion_r1004155630


##########
inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/source/pulsar/PulsarSourceRequest.java:
##########
@@ -60,7 +60,7 @@ public class PulsarSourceRequest extends SourceRequest {
     private String dataEncoding = StandardCharsets.UTF_8.toString();
 
     @ApiModelProperty(value = "Data separator")
-    private String dataSeparator = DataSeparator.VERTICAL_BAR.getSeparator();
+    private String dataSeparator = "124";

Review Comment:
   magic number
   It is better.
   private String dataSeparator = String.valueOf((int)'|');



##########
inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/stream/InlongStreamRequest.java:
##########
@@ -65,7 +64,7 @@ public class InlongStreamRequest {
     private String dataEncoding = StandardCharsets.UTF_8.toString();
 
     @ApiModelProperty(value = "Data separator")
-    private String dataSeparator = DataSeparator.VERTICAL_BAR.getSeparator();
+    private String dataSeparator = "44";

Review Comment:
   magic number
   It is better.
   private String dataSeparator = String.valueOf((int)',');



-- 
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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] dockerzhang merged pull request #6277: [INLONG-6276][Manager] Fix the problem of parsing the ASCII code when submitting the Sort task

Posted by GitBox <gi...@apache.org>.
dockerzhang merged PR #6277:
URL: https://github.com/apache/inlong/pull/6277


-- 
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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] healchow commented on a diff in pull request #6277: [INLONG-6276][Manager] Fix the problem of passing the ascll code when submitting the sort task

Posted by GitBox <gi...@apache.org>.
healchow commented on code in PR #6277:
URL: https://github.com/apache/inlong/pull/6277#discussion_r1008974516


##########
inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/sort/util/ExtractNodeUtils.java:
##########
@@ -247,7 +247,12 @@ public static PulsarExtractNode createExtractNode(PulsarSource pulsarSource) {
         DataTypeEnum dataType = DataTypeEnum.forName(pulsarSource.getSerializationType());
         switch (dataType) {
             case CSV:
-                format = new CsvFormat(pulsarSource.getDataSeparator());
+                String dataSeparatorStr = pulsarSource.getDataSeparator();
+                if (StringUtils.isNumeric(dataSeparatorStr)) {
+                    char dataSeparator = (char) Integer.parseInt(pulsarSource.getDataSeparator());
+                    dataSeparatorStr = Character.toString(dataSeparator);
+                }
+                format = new CsvFormat(dataSeparatorStr);

Review Comment:
   ```suggestion
                   String separatorStr = pulsarSource.getDataSeparator();
                   if (StringUtils.isNumeric(separatorStr)) {
                       char separator = (char) Integer.parseInt(separatorStr);
                       separatorStr = Character.toString(separator);
                   }
                   format = new CsvFormat(separatorStr);
   ```



-- 
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-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org