ably / kafka-connect-ably

Kafka Connector for publishing data from Kafka to Ably
https://ably.com/solutions/extend-kafka-to-the-edge
Apache License 2.0
11 stars 5 forks source link

Support Maps and Arrays in RecordMappings #144

Closed jaley closed 9 months ago

jaley commented 1 year ago

TemplatedRecordMapping currently supports Struct objects and scalars, so you can access nested fields within structs to refer to any field we can reasonably convert to a string as part of a channel name or message name. It may be useful to also support Maps and Arrays, as these are supported by Kafka Connect schemas. Conceptually, it's not a big change, but it may complicate the grammar for parsing placeholder strings, hence it was left out of the initial 3.0 delivery scope.

To support structs, we only needed to split the template string on dots then walk the schema, e.g. #{value.struct1.struct2.id}. If we were to support arrays and maps, it'd make sense to use notation consistent with the Ably Firehose Integration routingKey, for example #{value.myMap[someKey]}. This may be the point at which we need to start using a real parser generator -- needs some consideration.

sync-by-unito[bot] commented 1 year ago

➤ Automation for Jira commented:

The link to the corresponding Jira issue is https://ably.atlassian.net/browse/SDK-3709

mattheworiordan commented 9 months ago

I am closing this issue as this has not been requested by customers. Whilst we could certainly add this feature, there's no evidence we need it today.