apache / apache/beam

KafkaIO: inconsistent behaviour with Beam Row coders

Aperta
#21,189 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug io java kafka P3
Lingua principale
Java
Stelle
8.7k
Fork
4.7k
Merge medio
2g 9h
PR unite (30g)
202

Descrizione

We've been using KafkaIO's _withValueDeserializerAndCoder_ method to provide a Beam Row Coder for many versions of Beam, however, it stopped working in 2.30 after _ReadFromKafkaViaSDF_ implementation was made the default in BEAM-12114.

As far as I can see, _ReadFromKafkaViaUnbounded_ simply uses the key and the value coders that were passed with _withValueDeserializerAndCoder._

But _ReadFromKafkaViaSDF_ relies on an internal _ReadSourceDescriptors_ class, which, for some reason, doesn't receive the provided coders directly. Instead, it leverages _DeserializerProvider_ which uses the _CoderRegistry_ to get the coders. BEAM-9569 added a [check](https://github.com/apache/beam/pull/10990/files#diff-fbe73e228ab8f76836ebfa899382731fe93c739f8cdb84ba9841b8f9591df175) that practically prevents using CoderRegistry with Beam Row objects. __The prevents us from using Beam Rows with KafkaIO__.

As a workaround, we can use _\--experiments=beam_fn_api_use_deprecated_read_ to force _ReadFromKafkaViaUnbounded_ implementation, but I'm afraid it'll be eventually deleted. 

So, I feel like either:
* The existing KafkaIO documentation or examples needs to be updated to show how to rely on schemas when using Beam Rows, as was suggested in BEAM-9569. But I don't see how it can work with the existing implementation of KafkaIO.
* Or _ReadFromKafkaViaSDF_ needs to use the provided coders and not fallback to __DeserializerProvider__. 

Imported from Jira [BEAM-13320](https://issues.apache.org/jira/browse/BEAM-13320). Original Jira may contain additional context.
Reported by: sap1ens.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia confrontando ReadFromKafkaViaSDF con ReadFromKafkaViaUnbounded, concentrandoti su ReadSourceDescriptors e DeserializerProvider, e consulta BEAM-12114 e BEAM-9569 come contesto. Riproduci il comportamento del Beam Row coder con l’implementazione SDF predefinita e determina se i coder forniti funzionano oppure se la documentazione di KafkaIO deve spiegare un percorso di schema supportato; il lavoro è completato quando il comportamento è risolto o chiaramente documentato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java, kafka
Ambito
stream-processing
Tipo di issue
Bug
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
30/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.