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(dal-sink): support dynamic json handle mode #20418

Merged
merged 1 commit into from
Feb 12, 2025
Merged
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
10 changes: 5 additions & 5 deletions src/connector/src/sink/file_sink/opendal_sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ impl<S: OpendalSinkBackend> Sink for FileSink<S> {
&self.path,
self.schema.clone(),
writer_param.executor_id,
self.format_desc.encode.clone(),
&self.format_desc,
self.engine_type.clone(),
self.batching_strategy.clone(),
)?;
Expand Down Expand Up @@ -350,28 +350,28 @@ impl OpenDalSinkWriter {
write_path: &str,
rw_schema: Schema,
executor_id: u64,
encode_type: SinkEncode,
format_desc: &SinkFormatDesc,
engine_type: EngineType,
batching_strategy: BatchingStrategy,
) -> Result<Self> {
let arrow_schema = convert_rw_schema_to_arrow_schema(rw_schema.clone())?;
let jsonb_handling_mode = JsonbHandlingMode::from_options(&format_desc.options)?;
let row_encoder = JsonEncoder::new(
rw_schema,
None,
crate::sink::encoder::DateHandlingMode::String,
TimestampHandlingMode::String,
TimestamptzHandlingMode::UtcString,
TimeHandlingMode::String,
JsonbHandlingMode::String,
jsonb_handling_mode,
);
Ok(Self {
schema: Arc::new(arrow_schema),
write_path: write_path.to_owned(),
operator,
sink_writer: None,
executor_id,

encode_type,
encode_type: format_desc.encode.clone(),
row_encoder,
engine_type,
batching_strategy,
Expand Down
Loading