You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/12/22 03:52:39 UTC

[GitHub] [incubator-doris] JNSimba opened a new pull request #7457: Flink batch delete

JNSimba opened a new pull request #7457:
URL: https://github.com/apache/incubator-doris/pull/7457


   ## Proposed changes
   
   Support Flink delete options
   
   ## Types of changes
   
   What types of changes does your code introduce to Doris?
   _Put an `x` in the boxes that apply_
   
   - [ ] Bugfix (non-breaking change which fixes an issue)
   - [ ] New feature (non-breaking change which adds functionality)
   - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
   - [ ] Documentation Update (if none of the other choices apply)
   - [ ] Code refactor (Modify the code structure, format the code, etc...)
   - [ ] Optimization. Including functional usability improvements and performance improvements.
   - [ ] Dependency. Such as changes related to third-party components.
   - [ ] Other.
   
   ## Checklist
   
   _Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._
   
   - [ ] I have created an issue on (Fix #ISSUE) and described the bug/feature there in detail
   - [ ] Compiling and unit tests pass locally with my changes
   - [ ] I have added tests that prove my fix is effective or that my feature works
   - [ ] If these changes need document changes, I have updated the document
   - [ ] Any dependent changes have been merged
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...
   


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

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] JNSimba commented on pull request #7457: [Feature][flink-connector] support flink delete option

Posted by GitBox <gi...@apache.org>.
JNSimba commented on pull request #7457:
URL: https://github.com/apache/incubator-doris/pull/7457#issuecomment-1013689568


   I will make a modification later: only when it is judged to be a unique model, perform the delete operation.


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

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] github-actions[bot] commented on pull request #7457: [Feature][flink-connector] support flink delete option

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #7457:
URL: https://github.com/apache/incubator-doris/pull/7457#issuecomment-1008672441






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

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] JNSimba commented on pull request #7457: [Feature][flink-connector] support flink delete option

Posted by GitBox <gi...@apache.org>.
JNSimba commented on pull request #7457:
URL: https://github.com/apache/incubator-doris/pull/7457#issuecomment-1008575663


   > Give examples of delete usage
   
   Thanks  remind,already 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@doris.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] JNSimba commented on pull request #7457: [Feature][flink-connector] support flink delete option

Posted by GitBox <gi...@apache.org>.
JNSimba commented on pull request #7457:
URL: https://github.com/apache/incubator-doris/pull/7457#issuecomment-1015552412


   only when it is judged to be a unique model, perform the delete operation.


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

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] JNSimba commented on a change in pull request #7457: [Feature][flink-connector] support flink delete option

Posted by GitBox <gi...@apache.org>.
JNSimba commented on a change in pull request #7457:
URL: https://github.com/apache/incubator-doris/pull/7457#discussion_r774899291



##########
File path: extension/flink-doris-connector/src/main/java/org/apache/doris/flink/table/DorisDynamicOutputFormat.java
##########
@@ -113,24 +133,26 @@ public DorisDynamicOutputFormat(DorisOptions option,
                     LINE_DELIMITER_DEFAULT);
         }
 
-        this.fieldNames = fieldNames;
-        this.jsonFormat = FORMAT_JSON_VALUE.equals(executionOptions.getStreamLoadProp().getProperty(FORMAT_KEY));
-        this.fieldGetters = new RowData.FieldGetter[logicalTypes.length];
-        for (int i = 0; i < logicalTypes.length; i++) {
-            fieldGetters[i] = createFieldGetter(logicalTypes[i], i);
+        //add column key
+        if (!streamLoadProp.containsKey(COLUMNS_KEY)) {
+            String columns = String.join(",", Arrays.stream(fieldNames).map(item -> String.format("`%s`", item.trim().replace("`", ""))).collect(Collectors.toList()));

Review comment:
       Thank you for reminding me that I ignored the datastream submission 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@doris.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] aihai commented on a change in pull request #7457: [Feature][flink-connector] support flink delete option

Posted by GitBox <gi...@apache.org>.
aihai commented on a change in pull request #7457:
URL: https://github.com/apache/incubator-doris/pull/7457#discussion_r773738937



##########
File path: docs/zh-CN/extending-doris/flink-doris-connector.md
##########
@@ -300,6 +300,7 @@ outputFormat.close();
 | sink.max-retries     | 1                | 写BE失败之后的重试次数       |
 | sink.batch.interval     | 1s                | flush 间隔时间,超过该时间后异步线程将 缓存中数据写入BE。 默认值为1秒,支持时间单位ms、s、min、h和d。设置为0表示关闭定期写入。|
 | sink.properties.*     | --               | Stream load 的导入参数<br /><br />例如:<br />'sink.properties.column_separator' = ', '<br />定义列分隔符<br /><br />'sink.properties.escape_delimiters' = 'true'<br />特殊字符作为分隔符,'\\x01'会被转换为二进制的0x01<br /><br /> 'sink.properties.format' = 'json'<br />'sink.properties.strip_outer_array' = 'true' <br />JSON格式导入|
+| sink.enable-delete     | false               | 是否启用删除。此选项需要Doris表开启批量删除功能|

Review comment:
       How to set the delete flag, if using the datastream api.




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

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] morningman commented on pull request #7457: [Feature][flink-connector] support flink delete option

Posted by GitBox <gi...@apache.org>.
morningman commented on pull request #7457:
URL: https://github.com/apache/incubator-doris/pull/7457#issuecomment-1001632436


   hi @JNSimba , Could you please rebase the master and resolve the conflict?


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

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] JNSimba commented on pull request #7457: [Feature][flink-connector] support flink delete option

Posted by GitBox <gi...@apache.org>.
JNSimba commented on pull request #7457:
URL: https://github.com/apache/incubator-doris/pull/7457#issuecomment-1019458406


   Compatible with history Doris versions


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

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] aihai commented on pull request #7457: [Feature][flink-connector] support flink delete option

Posted by GitBox <gi...@apache.org>.
aihai commented on pull request #7457:
URL: https://github.com/apache/incubator-doris/pull/7457#issuecomment-1000690559


   I am worry about whether the key word `__DORIS_DELETE_SIGN__` is compatible in the later version.


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

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] aihai commented on a change in pull request #7457: [Feature][flink-connector] support flink delete option

Posted by GitBox <gi...@apache.org>.
aihai commented on a change in pull request #7457:
URL: https://github.com/apache/incubator-doris/pull/7457#discussion_r774281289



##########
File path: extension/flink-doris-connector/src/main/java/org/apache/doris/flink/table/DorisDynamicOutputFormat.java
##########
@@ -113,24 +133,26 @@ public DorisDynamicOutputFormat(DorisOptions option,
                     LINE_DELIMITER_DEFAULT);
         }
 
-        this.fieldNames = fieldNames;
-        this.jsonFormat = FORMAT_JSON_VALUE.equals(executionOptions.getStreamLoadProp().getProperty(FORMAT_KEY));
-        this.fieldGetters = new RowData.FieldGetter[logicalTypes.length];
-        for (int i = 0; i < logicalTypes.length; i++) {
-            fieldGetters[i] = createFieldGetter(logicalTypes[i], i);
+        //add column key
+        if (!streamLoadProp.containsKey(COLUMNS_KEY)) {
+            String columns = String.join(",", Arrays.stream(fieldNames).map(item -> String.format("`%s`", item.trim().replace("`", ""))).collect(Collectors.toList()));

Review comment:
       if using datastream api, fieldNames should be defined.




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

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] JNSimba commented on pull request #7457: [Feature][flink-connector] support flink delete option

Posted by GitBox <gi...@apache.org>.
JNSimba commented on pull request #7457:
URL: https://github.com/apache/incubator-doris/pull/7457#issuecomment-1001897341


   > hi @JNSimba , Could you please rebase the master and resolve the conflict?
   
   thanks, resolved


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

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] aihai commented on a change in pull request #7457: [Feature][flink-connector] support flink delete option

Posted by GitBox <gi...@apache.org>.
aihai commented on a change in pull request #7457:
URL: https://github.com/apache/incubator-doris/pull/7457#discussion_r773738937



##########
File path: docs/zh-CN/extending-doris/flink-doris-connector.md
##########
@@ -300,6 +300,7 @@ outputFormat.close();
 | sink.max-retries     | 1                | 写BE失败之后的重试次数       |
 | sink.batch.interval     | 1s                | flush 间隔时间,超过该时间后异步线程将 缓存中数据写入BE。 默认值为1秒,支持时间单位ms、s、min、h和d。设置为0表示关闭定期写入。|
 | sink.properties.*     | --               | Stream load 的导入参数<br /><br />例如:<br />'sink.properties.column_separator' = ', '<br />定义列分隔符<br /><br />'sink.properties.escape_delimiters' = 'true'<br />特殊字符作为分隔符,'\\x01'会被转换为二进制的0x01<br /><br /> 'sink.properties.format' = 'json'<br />'sink.properties.strip_outer_array' = 'true' <br />JSON格式导入|
+| sink.enable-delete     | false               | 是否启用删除。此选项需要Doris表开启批量删除功能|

Review comment:
       How to set the delete flag, if using the datastream api.




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

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] hf200012 merged pull request #7457: [Feature][flink-connector] support flink delete option

Posted by GitBox <gi...@apache.org>.
hf200012 merged pull request #7457:
URL: https://github.com/apache/incubator-doris/pull/7457


   


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

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] morningman commented on pull request #7457: [Feature][flink-connector] support flink delete option

Posted by GitBox <gi...@apache.org>.
morningman commented on pull request #7457:
URL: https://github.com/apache/incubator-doris/pull/7457#issuecomment-1001631154


   > I am worry about whether the key word `__DORIS_DELETE_SIGN__` is compatible in the later version.
   
   It will not change.


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

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org