You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by "featzhang (via GitHub)" <gi...@apache.org> on 2023/01/24 16:18:34 UTC
[GitHub] [inlong] featzhang opened a new pull request, #7272: [INLONG-7271][Manager] The primary key and partition key of the hudi table support comma separation
featzhang opened a new pull request, #7272:
URL: https://github.com/apache/inlong/pull/7272
### Prepare a Pull Request
- [INLONG-7271][Manager] The primary key and partition key of the hudi table support comma separation
- Fixes #7271
### 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)*
- [x] This change is a trivial rework/code cleanup without any test coverage.
- [x] 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] gosonzhang commented on a diff in pull request #7272: [INLONG-7271][Manager] Support comma separation for primary key and partition key of Hudi table
Posted by "gosonzhang (via GitHub)" <gi...@apache.org>.
gosonzhang commented on code in PR #7272:
URL: https://github.com/apache/inlong/pull/7272#discussion_r1089852903
##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sink/hudi/HudiSinkOperator.java:
##########
@@ -77,20 +82,22 @@ protected void setTargetEntity(SinkRequest request, StreamSinkEntity targetEntit
String partitionKey = sinkRequest.getPartitionKey();
String primaryKey = sinkRequest.getPrimaryKey();
- boolean primaryKeyExist = StringUtils.isNotEmpty(partitionKey);
- boolean partitionKeyExist = StringUtils.isNotEmpty(primaryKey);
+ boolean primaryKeyExist = StringUtils.isNotBlank(partitionKey);
Review Comment:
Is the judgment value of the partitionKey and the primaryKey reversed?
--
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 #7272: [INLONG-7271][Manager] Support comma separation for primary key and partition key of Hudi table
Posted by "healchow (via GitHub)" <gi...@apache.org>.
healchow commented on code in PR #7272:
URL: https://github.com/apache/inlong/pull/7272#discussion_r1088529095
##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sink/hudi/HudiSinkOperator.java:
##########
@@ -77,20 +81,22 @@ protected void setTargetEntity(SinkRequest request, StreamSinkEntity targetEntit
String partitionKey = sinkRequest.getPartitionKey();
String primaryKey = sinkRequest.getPrimaryKey();
- boolean primaryKeyExist = StringUtils.isNotEmpty(partitionKey);
- boolean partitionKeyExist = StringUtils.isNotEmpty(primaryKey);
+ boolean primaryKeyExist = StringUtils.isNotBlank(partitionKey);
+ boolean partitionKeyExist = StringUtils.isNotBlank(primaryKey);
if (primaryKeyExist || partitionKeyExist) {
Set<String> fieldNames = sinkRequest.getSinkFieldList().stream().map(SinkField::getFieldName)
.collect(Collectors.toSet());
- if (primaryKeyExist) {
- if (!fieldNames.contains(partitionKey)) {
+ if (partitionKeyExist) {
+ List<String> partitionKeys = Arrays.asList(partitionKey.split(","));
Review Comment:
Please replace `,` with 'InlongConstants.COMMA'.
--
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] featzhang commented on a diff in pull request #7272: [INLONG-7271][Manager] Support comma separation for primary key and partition key of Hudi table
Posted by "featzhang (via GitHub)" <gi...@apache.org>.
featzhang commented on code in PR #7272:
URL: https://github.com/apache/inlong/pull/7272#discussion_r1089860212
##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sink/hudi/HudiSinkOperator.java:
##########
@@ -77,20 +82,22 @@ protected void setTargetEntity(SinkRequest request, StreamSinkEntity targetEntit
String partitionKey = sinkRequest.getPartitionKey();
String primaryKey = sinkRequest.getPrimaryKey();
- boolean primaryKeyExist = StringUtils.isNotEmpty(partitionKey);
- boolean partitionKeyExist = StringUtils.isNotEmpty(primaryKey);
+ boolean primaryKeyExist = StringUtils.isNotBlank(partitionKey);
Review Comment:
fixed
--
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] gosonzhang merged pull request #7272: [INLONG-7271][Manager] Support comma separation for primary key and partition key of Hudi table
Posted by "gosonzhang (via GitHub)" <gi...@apache.org>.
gosonzhang merged PR #7272:
URL: https://github.com/apache/inlong/pull/7272
--
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