airbytehq / airbytehq/airbyte

MongoDB Source Connector Fails Schema Fetch On Empty keys

未關閉
#19,206 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
area/databases community connectors/source/mongodb connectors/sources-database frozen team/db-dw-sources type/bug
主要語言
Python
星號
22.1k
分支
5.4k
平均合併
5 小時
30 天內合併 PR
671

描述

## Environment
- **Airbyte version**: example is 0.22.0-alpha
- **OS Version / Instance**: AWS EC2
- **Deployment**:
- **Source Connector and version**: airbyte/source-mongodb-v2 0.1.19
- **Destination Connector and version**:
- **Step where error happened**: Schema discovery | Setup new connection

## Current Behavior
A document with an empty key will trigger this offending pipeline query
`[{
$limit: 10000
}, {
$project: {
_id: 0,
fieldType: {
$type: '$'
}
}
}]`

`Stack Trace: com.mongodb.MongoCommandException: Command failed with error 16410 (Location16410): 'Invalid $project :: caused by :: FieldPath field names may not start with '$'. Consider using $getField or $setField.' on server ****.mongodb.net:27017. The full response is {"ok": 0.0, "errmsg": "Invalid $project :: caused by :: FieldPath field names may not start with '$'. Consider using $getField or $setField.", "code": 16410, "codeName": "Location16410", "$clusterTime": {"clusterTime": {"$timestamp": {"t": 1667988730, "i": 1}}, "signature": {"hash": {"$binary": {"base64": "YNckmnaSmCvMEGMCmgWubyXrL40=", "subType": "00"}}, "keyId": 7148703941541232644}}, "operationTime": {"$timestamp": {"t": 1667988730, "i": 1}}}`

## Expected Behavior
Deal with empty keys in another way, or skip them with a warning?

## Logs

## Steps to Reproduce
1. Have a collection with an empty key as such
image
2. Trigger schema discovery

## Are you willing to submit a PR?
I can't

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。