airbytehq / airbytehq/airbyte

MongoDB Source Connector Fails Schema Fetch On Empty keys

Aberta
#19,206 1 comentário 0 reações 0 responsáveis Ver no GitHub
area/databases community connectors/source/mongodb connectors/sources-database frozen team/db-dw-sources type/bug
Linguagem predominante
Python
Estrelas
22.1k
Forks
5.4k
Merge médio
5h
PRs com merge (30d)
671

Descrição

## 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

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.