Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding index.name.override config #193

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

porto88
Copy link

@porto88 porto88 commented Apr 5, 2023

New Feature:
Adding new connector configuration index.name.override which allows for defining a static index name that documents will be written to.

Current Behavior:
Current logic for the index name is based off of the incoming kafka topic or data stream topic.

Problem this Solves:
There currently isn't a way to change the topic with connector configuration. The only solution is to use the kafka connect transformer "org.apache.kafka.connect.transforms.RegexRouter" to remap the incoming topic(s).

The problem with this solution is when using the key.ignore.id.strategy with value of "topic.partition.offset", the topic in this key is always mapped to the static value defined by the RegexRouter, and will cause document collisions.

Proposed Solution:
Add new configuration index.name.override which allows for defining a static index name that documents will be written to regardless of source topic(s).

Existing Issues:
#89

@porto88 porto88 requested review from a team as code owners April 5, 2023 19:01
@@ -88,6 +88,13 @@ Data Conversion
* Valid Values: ``insert``, ``upsert``
* Importance: low

``index.name.override``
Copy link
Contributor

@reta reta Apr 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@porto88 I feel like this is not the right way to write into dedicated index. First, there are many topics (and consequently) many different schemas which would not fit the same index. Secondly, you could always configure index aliases on OpenSearch side for whatever topics you would like to funnel into the same index.

Copy link
Author

@porto88 porto88 Apr 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@reta I feel this is still a nice feature too have even in the case of just one kafka topic. If you are pulling from kafka topic "A" but want to insert into an index that is named differently, this will allow that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@porto88 the connector is not dealing with just one topic, the risk of misusing this feature (and unintended consequences of moving from one topic to many with this property being set) greatly outperform the benefits (in my opinion).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could be a mapping between topic and index name, similar to the Snowflake snowflaketopic2table.map that can be set to "snowflake.topic2table.map": "topic1:table1,topic2:table2"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same thing can be achieved with the RegexRouter smt while still supporting the multiple topics case @reta mentioned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants