gong commented on code in PR #4666:
URL: https://github.com/apache/incubator-inlong/pull/4666#discussion_r896645972
##########
inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/node/extract/MongoExtractNode.java:
##########
@@ -61,23 +61,23 @@ public class MongoExtractNode extends ExtractNode
implements Serializable {
@JsonCreator
public MongoExtractNode(@JsonProperty("id") String id,
- @JsonProperty("name") String name,
- @JsonProperty("fields") List<FieldInfo> fields,
- @Nullable @JsonProperty("watermarkField") WatermarkField
waterMarkField,
- @JsonProperty("properties") Map<String, String> properties,
- @JsonProperty("primaryKey") String primaryKey,
- @JsonProperty("collection") @Nonnull String collection,
- @JsonProperty("hostname") String hostname,
- @JsonProperty("username") String username,
- @JsonProperty("password") String password,
- @JsonProperty("database") String database) {
+ @JsonProperty("name") String name,
+ @JsonProperty("fields") List<FieldInfo> fields,
+ @Nullable @JsonProperty("watermarkField") WatermarkField
waterMarkField,
+ @JsonProperty("properties") Map<String, String> properties,
+ @JsonProperty("collection") @Nonnull String collection,
+ @JsonProperty("hostname") String hostname,
+ @JsonProperty("username") String username,
+ @JsonProperty("password") String password,
+ @JsonProperty("database") String database) {
super(id, name, fields, waterMarkField, properties);
this.collection = Preconditions.checkNotNull(collection, "collection
is null");
this.hosts = Preconditions.checkNotNull(hostname, "hostname is null");
this.username = Preconditions.checkNotNull(username, "username is
null");
this.password = Preconditions.checkNotNull(password, "password is
null");
this.database = Preconditions.checkNotNull(database, "database is
null");
- this.primaryKey = primaryKey;
+ // the primaryKey must be "_id"
+ this.primaryKey = "_id";
Review Comment:
`fields` should add "_id" field
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]