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

feat(sink): support force_append_only for es sink #19919

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

Conversation

xxhZs
Copy link
Contributor

@xxhZs xxhZs commented Dec 24, 2024

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

We didn't support type for es sink, and this pr support it like other sink

Checklist

  • I have written necessary rustdoc comments.
  • I have added necessary unit tests and integration tests.
  • I have added test labels as necessary.
  • I have added fuzzing tests or opened an issue to track them.
  • My PR contains breaking changes.
  • My PR changes performance-critical code, so I will run (micro) benchmarks and present the results.
  • My PR contains critical fixes that are necessary to be merged into the latest release.

Documentation

  • My PR needs documentation updates.
Release note

Copy link
Collaborator

@hzxa21 hzxa21 left a comment

Choose a reason for hiding this comment

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

Why do we need this PR? Isn't force_append_only already been handled in the sink executor before reaching the specific sink implementation:

yield Message::Chunk(force_append_only(chunk))

@@ -79,13 +81,14 @@ impl StreamChunkConverter {

pub fn convert_chunk(&self, chunk: StreamChunk) -> Result<StreamChunk> {
match self {
StreamChunkConverter::Es(es) => es.convert_chunk(chunk),
StreamChunkConverter::Es(es) => es.convert_chunk(chunk,es.is_append_only),
Copy link
Collaborator

Choose a reason for hiding this comment

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

nits: fmt

@@ -117,7 +121,7 @@ impl EsStreamChunkConverter {
<Utf8ArrayBuilder as risingwave_common::array::ArrayBuilder>::new(chunk.capacity());
let mut routing_builder =
<Utf8ArrayBuilder as risingwave_common::array::ArrayBuilder>::new(chunk.capacity());
for build_bulk_para in self.formatter.convert_chunk(chunk)? {
for build_bulk_para in self.formatter.convert_chunk(chunk,is_append_only)? {
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto

@@ -202,7 +205,7 @@ impl AsyncTruncateSinkWriter for ElasticSearchOpenSearchSinkWriter {
let mut bulks: Vec<ElasticSearchOpenSearchBulk> = Vec::with_capacity(chunk_capacity);

let mut bulks_size = 0;
for build_bulk_para in self.formatter.convert_chunk(chunk)? {
for build_bulk_para in self.formatter.convert_chunk(chunk,self.is_append_only)? {
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto

@@ -113,7 +113,7 @@ impl ElasticSearchOpenSearchFormatter {
})
}

pub fn convert_chunk(&self, chunk: StreamChunk) -> Result<Vec<BuildBulkPara>> {
pub fn convert_chunk(&self, chunk: StreamChunk,is_append_only: bool) -> Result<Vec<BuildBulkPara>> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto

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

Successfully merging this pull request may close these issues.

2 participants