From a3f3f543841766a2aa9b47a3659f967a5b124302 Mon Sep 17 00:00:00 2001 From: StrikeW Date: Sun, 18 Feb 2024 17:10:19 +0800 Subject: [PATCH] fix --- src/connector/src/parser/debezium/mongo_json_parser.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/connector/src/parser/debezium/mongo_json_parser.rs b/src/connector/src/parser/debezium/mongo_json_parser.rs index 94c36285b91e9..9f19b1690dcd1 100644 --- a/src/connector/src/parser/debezium/mongo_json_parser.rs +++ b/src/connector/src/parser/debezium/mongo_json_parser.rs @@ -18,7 +18,7 @@ use anyhow::Context; use risingwave_common::bail; use risingwave_common::types::DataType; -use crate::parser::simd_json_parser::{DebeziumJsonAccessBuilder, DebeziumMongoJsonAccessBuilder}; +use crate::parser::simd_json_parser::DebeziumMongoJsonAccessBuilder; use crate::parser::unified::debezium::DebeziumChangeEvent; use crate::parser::unified::util::apply_row_operation_on_stream_chunk_writer; use crate::parser::{ @@ -37,12 +37,8 @@ pub struct DebeziumMongoJsonParser { payload_builder: AccessBuilderImpl, } -// key and payload in DEBEZIUM_MONGO format are accessed in different ways fn build_accessor_builder(config: EncodingProperties) -> anyhow::Result { match config { - EncodingProperties::Json(_) => Ok(AccessBuilderImpl::DebeziumJson( - DebeziumJsonAccessBuilder::new()?, - )), EncodingProperties::MongoJson(_) => Ok(AccessBuilderImpl::DebeziumMongoJson( DebeziumMongoJsonAccessBuilder::new()?, )), @@ -79,6 +75,7 @@ impl DebeziumMongoJsonParser { bail!("Debezium Mongo needs no more columns except `_id` and `payload` in table"); } + // encodings are fixed to MongoJson let key_builder = build_accessor_builder(EncodingProperties::MongoJson(JsonProperties::default()))?; let payload_builder =