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): introduce file sink [WIP] #15686

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 100 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/connector/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ mysql_common = { version = "0.31", default-features = false, features = [
] }
nexmark = { version = "0.2", features = ["serde"] }
num-bigint = "0.4"
opendal = "0.44"
opendal = "0.44.2"
parking_lot = "0.12"
parquet = "50.0.0"
paste = "1"
prometheus = { version = "0.13", features = ["process"] }
prost = { version = "0.12", features = ["no-recursion-limit"] }
Expand Down
25 changes: 25 additions & 0 deletions src/connector/src/sink/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pub mod kinesis;
pub mod log_store;
pub mod mock_coordination_client;
pub mod nats;
pub mod opendal_sink;
pub mod pulsar;
pub mod redis;
pub mod remote;
Expand All @@ -46,6 +47,8 @@ use ::deltalake::DeltaTableError;
use ::redis::RedisError;
use anyhow::anyhow;
use async_trait::async_trait;
use opendal::Error as OpendalError;
use risingwave_common::array::ArrayError;
use risingwave_common::buffer::Bitmap;
use risingwave_common::catalog::{ColumnDesc, Field, Schema};
use risingwave_common::metrics::{
Expand Down Expand Up @@ -88,6 +91,8 @@ macro_rules! for_all_sinks {
{ HttpJava, $crate::sink::remote::HttpJavaSink },
{ Doris, $crate::sink::doris::DorisSink },
{ Starrocks, $crate::sink::starrocks::StarrocksSink },
{ S3, $crate::sink::opendal_sink::s3::S3Sink },
{ Gcs, $crate::sink::opendal_sink::gcs::GcsSink },
{ DeltaLake, $crate::sink::deltalake::DeltaLakeSink },
{ BigQuery, $crate::sink::big_query::BigQuerySink },
{ Test, $crate::sink::test_sink::TestSink },
Expand Down Expand Up @@ -525,6 +530,8 @@ pub enum SinkError {
),
#[error("Starrocks error: {0}")]
Starrocks(String),
#[error("Opendal error: {0}")]
Opendal(String),
#[error("Pulsar error: {0}")]
Pulsar(
#[source]
Expand Down Expand Up @@ -557,6 +564,24 @@ impl From<icelake::Error> for SinkError {
}
}

impl From<OpendalError> for SinkError {
fn from(error: OpendalError) -> Self {
SinkError::Opendal(error.to_string())
}
}

impl From<parquet::errors::ParquetError> for SinkError {
fn from(error: parquet::errors::ParquetError) -> Self {
SinkError::Opendal(error.to_string())
}
}

impl From<ArrayError> for SinkError {
fn from(error: ArrayError) -> Self {
SinkError::Opendal(error.to_string())
}
}

impl From<RpcError> for SinkError {
fn from(value: RpcError) -> Self {
SinkError::Remote(anyhow!(value))
Expand Down
Loading
Loading