You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by "vernedeng (via GitHub)" <gi...@apache.org> on 2023/04/03 05:00:14 UTC

[GitHub] [inlong] vernedeng commented on a diff in pull request #7740: [INLONG-7690][Manager] Creating schema of StreamSource by CSV

vernedeng commented on code in PR #7740:
URL: https://github.com/apache/inlong/pull/7740#discussion_r1155482161


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sink/StreamSinkServiceImpl.java:
##########
@@ -725,6 +730,41 @@ public List<SinkField> parseFields(ParseFieldRequest parseFieldRequest) {
         }
     }
 
+    private List<SinkField> parseFieldsByCsv(String statement) {
+        String[] lines = statement.split(InlongConstants.NEW_LINE);
+        List<SinkField> fields = new ArrayList<>();
+        for (int i = 0; i < lines.length; i++) {
+            String line = lines[i];
+            if (StringUtils.isBlank(line)) {
+                continue;
+            }
+
+            String[] cols = line.split(PARSE_FIELD_CSV_SPLITTER, 3);

Review Comment:
   Magic number, what does **_3_** means?



##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sink/StreamSinkServiceImpl.java:
##########
@@ -725,6 +730,41 @@ public List<SinkField> parseFields(ParseFieldRequest parseFieldRequest) {
         }
     }
 
+    private List<SinkField> parseFieldsByCsv(String statement) {
+        String[] lines = statement.split(InlongConstants.NEW_LINE);
+        List<SinkField> fields = new ArrayList<>();
+        for (int i = 0; i < lines.length; i++) {
+            String line = lines[i];
+            if (StringUtils.isBlank(line)) {
+                continue;
+            }
+
+            String[] cols = line.split(PARSE_FIELD_CSV_SPLITTER, 3);
+            if (cols.length < 2) {

Review Comment:
   ditto



-- 
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