You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by "Yizhou-Yang (via GitHub)" <gi...@apache.org> on 2023/01/30 11:16:37 UTC

[GitHub] [inlong] Yizhou-Yang opened a new pull request, #7289: Bugfix 3

Yizhou-Yang opened a new pull request, #7289:
URL: https://github.com/apache/inlong/pull/7289

   ### Prepare a Pull Request
   *(Change the title refer to the following example)*
   
   - Title Example: [INLONG-XYZ][Component] Title of the pull request
   
   *(The following *XYZ* should be replaced by the actual [GitHub Issue](https://github.com/apache/inlong/issues) number)*
   
   - Fixes #XYZ
   
   ### Motivation
   
   *Explain here the context, and why you're making that change. What is the problem you're trying to solve?*
   
   ### Modifications
   
   *Describe the modifications you've done.*
   
   ### Verifying this change
   
   *(Please pick either of the following options)*
   
   - [ ] 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:
   
     *(example:)*
     - *Added integration tests for end-to-end deployment with large payloads (10MB)*
     - *Extended integration test for recovery after broker failure*
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (yes / no)
     - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
     - If a feature is not applicable for documentation, explain why?
     - If a feature is not documented yet in this PR, please create a follow-up issue for adding the documentation
   


-- 
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 pull request #7289: [INLONG-7292][Sort] Fixed a bug for doris/starrocks/jdbc invokeMultiple method

Posted by "healchow (via GitHub)" <gi...@apache.org>.
healchow commented on PR #7289:
URL: https://github.com/apache/inlong/pull/7289#issuecomment-1409692370

   Please add more info for the PR, such as the Motivation, Modifications and Verifying…


-- 
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] Yizhou-Yang commented on a diff in pull request #7289: [INLONG-7292][Sort] Accurately detect and archive dirty data for Doris/StarRocks/JDBC

Posted by "Yizhou-Yang (via GitHub)" <gi...@apache.org>.
Yizhou-Yang commented on code in PR #7289:
URL: https://github.com/apache/inlong/pull/7289#discussion_r1094040106


##########
inlong-sort/sort-connectors/base/src/main/java/org/apache/inlong/sort/base/dirty/DirtySinkHelper.java:
##########
@@ -136,6 +178,51 @@ public void invokeMultiple(T dirtyData, DirtyType dirtyType, Throwable e,
         }
     }
 
+    private String regexReplace(String pattern, DirtyType dirtyType,
+            String dirtyMessage, List<String> actualIdentifier) throws IOException {
+
+        if (pattern == null) {
+            return null;
+        }
+
+        final Pattern REGEX_PATTERN = Pattern.compile("\\$\\{\\s*([\\w.-]+)\\s*}", Pattern.CASE_INSENSITIVE);

Review Comment:
   added



-- 
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] Yizhou-Yang commented on pull request #7289: [INLONG-7292][Sort] Accurately detect and archive dirty data for Doris/StarRocks/JDBC

Posted by "Yizhou-Yang (via GitHub)" <gi...@apache.org>.
Yizhou-Yang commented on PR #7289:
URL: https://github.com/apache/inlong/pull/7289#issuecomment-1413448634

   TODO : the pr is still being performance-tested and need to remove logs and add comments before the final merge


-- 
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] EMsnap commented on a diff in pull request #7289: [INLONG-7292][Sort] Fixed a bug for doris/starrocks/jdbc invokeMultiple method

Posted by "EMsnap (via GitHub)" <gi...@apache.org>.
EMsnap commented on code in PR #7289:
URL: https://github.com/apache/inlong/pull/7289#discussion_r1091365276


##########
inlong-sort/sort-connectors/jdbc/src/main/java/org/apache/inlong/sort/jdbc/internal/JdbcMultiBatchingOutputFormat.java:
##########
@@ -566,7 +566,8 @@ protected void attemptFlush() throws IOException {
                         outputMetrics(tableIdentifier, Long.valueOf(tableIdRecordList.size()),
                                 1L, true);
                         if (!schemaUpdateExceptionPolicy.equals(SchemaUpdateExceptionPolicy.THROW_WITH_STOP)) {
-                            dirtySinkHelper.invokeMultiple(record, DirtyType.RETRY_LOAD_ERROR, tableException,
+                            dirtySinkHelper.invokeMultiple(tableIdentifier + "%#%#%#" + record.toString(),

Review Comment:
   "%#%#%#" make constant with meaningful name 



-- 
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] gong commented on a diff in pull request #7289: [INLONG-7292][Sort] Accurately detect and archive dirty data for Doris/StarRocks/JDBC

Posted by "gong (via GitHub)" <gi...@apache.org>.
gong commented on code in PR #7289:
URL: https://github.com/apache/inlong/pull/7289#discussion_r1092711552


##########
inlong-sort/sort-connectors/base/src/main/java/org/apache/inlong/sort/base/dirty/DirtySinkHelper.java:
##########
@@ -136,6 +178,51 @@ public void invokeMultiple(T dirtyData, DirtyType dirtyType, Throwable e,
         }
     }
 
+    private String regexReplace(String pattern, DirtyType dirtyType,
+            String dirtyMessage, List<String> actualIdentifier) throws IOException {
+
+        if (pattern == null) {
+            return null;
+        }
+
+        final Pattern REGEX_PATTERN = Pattern.compile("\\$\\{\\s*([\\w.-]+)\\s*}", Pattern.CASE_INSENSITIVE);

Review Comment:
   Add some UT for this REGEX_PATTERN or regexReplace method



-- 
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 #7289: [INLONG-7292][Sort] Fixed a bug for doris/starrocks/jdbc invokeMultiple method

Posted by "healchow (via GitHub)" <gi...@apache.org>.
healchow commented on code in PR #7289:
URL: https://github.com/apache/inlong/pull/7289#discussion_r1091391336


##########
inlong-sort/sort-connectors/base/src/main/java/org/apache/inlong/sort/base/dirty/DirtySinkHelper.java:
##########
@@ -136,6 +185,51 @@ public void invokeMultiple(T dirtyData, DirtyType dirtyType, Throwable e,
         }
     }
 
+    private String regexReplace(String pattern, DirtyType dirtyType,
+            String dirtyMessage, List<String> actualIdentifier) throws IOException {
+
+        if (pattern == null) {
+            return null;
+        }
+
+        final Pattern REGEX_PATTERN = Pattern.compile("\\$\\{\\s*([\\w.-]+)\\s*}", Pattern.CASE_INSENSITIVE);

Review Comment:
   Suggest changing this regex pattern to a final static variable, or changing the `regexReplace` method to static, which can improve the performance.



-- 
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 #7289: [INLONG-7292][Sort] Fixed a bug for doris/starrocks/jdbc invokeMultiple method

Posted by "healchow (via GitHub)" <gi...@apache.org>.
healchow commented on code in PR #7289:
URL: https://github.com/apache/inlong/pull/7289#discussion_r1091413467


##########
inlong-sort/sort-connectors/base/src/main/java/org/apache/inlong/sort/base/Constants.java:
##########
@@ -135,6 +135,8 @@ public final class Constants {
 
     public static final String AUTO_DESERIALIZE_FALSE = "autoDeserialize=false";
 
+    public static final String SEPARATOR = "%#%#%#";

Review Comment:
   The name of `SEPARATOR` was unclearly.



-- 
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] yunqingmoswu commented on a diff in pull request #7289: [INLONG-7292][Sort] Accurately detect and archive dirty data for Doris/StarRocks/JDBC

Posted by "yunqingmoswu (via GitHub)" <gi...@apache.org>.
yunqingmoswu commented on code in PR #7289:
URL: https://github.com/apache/inlong/pull/7289#discussion_r1091509651


##########
inlong-sort/sort-connectors/base/src/main/java/org/apache/inlong/sort/base/Constants.java:
##########
@@ -135,6 +135,8 @@ public final class Constants {
 
     public static final String AUTO_DESERIALIZE_FALSE = "autoDeserialize=false";
 
+    public static final String DIRTY_IDENTIFIER_SEPARATOR = "%#%#%#";

Review Comment:
   Make sure it is right?



-- 
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] EMsnap commented on a diff in pull request #7289: [INLONG-7292][Sort] Fixed a bug for doris/starrocks/jdbc invokeMultiple method

Posted by "EMsnap (via GitHub)" <gi...@apache.org>.
EMsnap commented on code in PR #7289:
URL: https://github.com/apache/inlong/pull/7289#discussion_r1091364011


##########
inlong-sort/sort-connectors/base/src/main/java/org/apache/inlong/sort/base/dirty/DirtySinkHelper.java:
##########
@@ -110,22 +118,56 @@ public void invokeMultiple(T dirtyData, DirtyType dirtyType, Throwable e,
             }
             throw ex;
         }
-        if (dirtySink != null) {
-            JsonNode rootNode;
-            DirtyData.Builder<T> builder = DirtyData.builder();
-            try {
+
+        JsonDynamicSchemaFormat jsonDynamicSchemaFormat =

Review Comment:
   too long for one method



-- 
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] EMsnap merged pull request #7289: [INLONG-7292][Sort] Accurately detect and archive dirty data for Doris/StarRocks/JDBC

Posted by "EMsnap (via GitHub)" <gi...@apache.org>.
EMsnap merged PR #7289:
URL: https://github.com/apache/inlong/pull/7289


-- 
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] Yizhou-Yang commented on a diff in pull request #7289: [INLONG-7292][Sort] Accurately detect and archive dirty data for Doris/StarRocks/JDBC

Posted by "Yizhou-Yang (via GitHub)" <gi...@apache.org>.
Yizhou-Yang commented on code in PR #7289:
URL: https://github.com/apache/inlong/pull/7289#discussion_r1091525820


##########
inlong-sort/sort-connectors/base/src/main/java/org/apache/inlong/sort/base/Constants.java:
##########
@@ -135,6 +135,8 @@ public final class Constants {
 
     public static final String AUTO_DESERIALIZE_FALSE = "autoDeserialize=false";
 
+    public static final String DIRTY_IDENTIFIER_SEPARATOR = "%#%#%#";

Review Comment:
   it is entirely made up to pass in identifier before the actual dirty data, so it can be anything as long as it wont be user's db/table name



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