Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ingest/kafka-connect): support MongoSourceConnector (#6416)
Co-authored-by: John Joyce <john@acryl.io> Co-authored-by: Tamas Nemeth <treff7es@gmail.com>
- Loading branch information
1 parent
e5a823e
commit 4dd66be
Showing
5 changed files
with
270 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
metadata-ingestion/tests/integration/kafka-connect/kafka_connect_mongo_mces_golden.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
[ | ||
{ | ||
"entityType": "dataFlow", | ||
"entityUrn": "urn:li:dataFlow:(kafka-connect,source_mongodb_connector,PROD)", | ||
"changeType": "UPSERT", | ||
"aspectName": "dataFlowInfo", | ||
"aspect": { | ||
"value": "{\"customProperties\": {}, \"name\": \"source_mongodb_connector\", \"description\": \"Source connector using `com.mongodb.kafka.connect.MongoSourceConnector` plugin.\"}", | ||
"contentType": "application/json" | ||
}, | ||
"systemMetadata": { | ||
"lastObserved": 1635166800000, | ||
"runId": "kafka-connect-run" | ||
} | ||
}, | ||
{ | ||
"entityType": "dataJob", | ||
"entityUrn": "urn:li:dataJob:(urn:li:dataFlow:(kafka-connect,source_mongodb_connector,PROD),test_db.purchases)", | ||
"changeType": "UPSERT", | ||
"aspectName": "dataJobInfo", | ||
"aspect": { | ||
"value": "{\"customProperties\": {}, \"name\": \"source_mongodb_connector:test_db.purchases\", \"type\": {\"string\": \"COMMAND\"}}", | ||
"contentType": "application/json" | ||
}, | ||
"systemMetadata": { | ||
"lastObserved": 1635166800000, | ||
"runId": "kafka-connect-run" | ||
} | ||
}, | ||
{ | ||
"entityType": "dataJob", | ||
"entityUrn": "urn:li:dataJob:(urn:li:dataFlow:(kafka-connect,source_mongodb_connector,PROD),test_db.purchases)", | ||
"changeType": "UPSERT", | ||
"aspectName": "dataJobInputOutput", | ||
"aspect": { | ||
"value": "{\"inputDatasets\": [\"urn:li:dataset:(urn:li:dataPlatform:mongodb,test_db.purchases,PROD)\"], \"outputDatasets\": [\"urn:li:dataset:(urn:li:dataPlatform:kafka,mongodb.test_db.purchases,PROD)\"]}", | ||
"contentType": "application/json" | ||
}, | ||
"systemMetadata": { | ||
"lastObserved": 1635166800000, | ||
"runId": "kafka-connect-run" | ||
} | ||
}, | ||
{ | ||
"entityType": "dataset", | ||
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:kafka,mongodb.test_db.purchases,PROD)", | ||
"changeType": "UPSERT", | ||
"aspectName": "dataPlatformInstance", | ||
"aspect": { | ||
"value": "{\"platform\": \"urn:li:dataPlatform:kafka\"}", | ||
"contentType": "application/json" | ||
}, | ||
"systemMetadata": { | ||
"lastObserved": 1635166800000, | ||
"runId": "kafka-connect-run" | ||
} | ||
}, | ||
{ | ||
"entityType": "dataset", | ||
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:mongodb,test_db.purchases,PROD)", | ||
"changeType": "UPSERT", | ||
"aspectName": "dataPlatformInstance", | ||
"aspect": { | ||
"value": "{\"platform\": \"urn:li:dataPlatform:mongodb\"}", | ||
"contentType": "application/json" | ||
}, | ||
"systemMetadata": { | ||
"lastObserved": 1635166800000, | ||
"runId": "kafka-connect-run" | ||
} | ||
} | ||
] |
22 changes: 22 additions & 0 deletions
22
metadata-ingestion/tests/integration/kafka-connect/setup/conf/mongo-init.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
mongo -- "$MONGO_INITDB_DATABASE" <<-EOJS | ||
conn = new Mongo(); | ||
db = conn.getDB("test_db"); | ||
db.purchases.insertOne({ _id: 3, item: "lamp post", price: 12 }); | ||
db.purchases.insertOne({ _id: 4, item: "lamp post", price: 13 }); | ||
EOJS | ||
|
||
|
||
{ | ||
sleep 3 && | ||
mongo -- "$MONGO_INITDB_DATABASE" <<-EOJS | ||
var rootUser = '$MONGO_INITDB_ROOT_USERNAME'; | ||
var rootPassword = '$MONGO_INITDB_ROOT_PASSWORD'; | ||
var admin = db.getSiblingDB('admin'); | ||
admin.auth(rootUser, rootPassword); | ||
EOJS | ||
} & | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters