Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
Signed-off-by: xxchan <xxchan22f@gmail.com>
  • Loading branch information
xxchan committed Sep 13, 2024
1 parent a5e66d8 commit 9f2cfd1
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 5 deletions.
15 changes: 15 additions & 0 deletions src/connector/codec/src/common/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright 2024 RisingWave Labs
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

pub mod protobuf;
16 changes: 16 additions & 0 deletions src/connector/codec/src/common/protobuf/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright 2024 RisingWave Labs
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

mod compiler;
pub use compiler::compile_pb;
2 changes: 0 additions & 2 deletions src/connector/codec/src/decoder/protobuf/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

mod compiler;
pub mod parser;
use std::borrow::Cow;
use std::sync::LazyLock;

pub use compiler::compile_pb;
use parser::from_protobuf_value;
use prost_reflect::{DynamicMessage, ReflectMessage};
use risingwave_common::log::LogSuppresser;
Expand Down
1 change: 1 addition & 0 deletions src/connector/codec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#![register_tool(rw)]
#![recursion_limit = "256"]

pub mod common;
/// Converts JSON/AVRO/Protobuf data to RisingWave datum.
/// The core API is [`decoder::Access`].
pub mod decoder;
Expand Down
2 changes: 1 addition & 1 deletion src/connector/codec/tests/integration_tests/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
//! ## Why not directly test the uppermost layer `AvroParserConfig` and `AvroAccessBuilder`?
//!
//! Because their interface are not clean enough, and have complex logic like schema registry.
//! We might need to separate logic to make them clenaer and then we can use it directly for testing.
//! We might need to separate logic to make them cleaner and then we can use it directly for testing.
//!
//! ## If we reimplement a similar logic here, what are we testing?
//!
Expand Down
3 changes: 2 additions & 1 deletion src/connector/codec/tests/integration_tests/protobuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ use std::path::PathBuf;
use anyhow::Context;
use prost::Message;
use prost_reflect::{DescriptorPool, DynamicMessage, MessageDescriptor};
use risingwave_connector_codec::common::protobuf::compile_pb;
use risingwave_connector_codec::decoder::protobuf::parser::*;
use risingwave_connector_codec::decoder::protobuf::{compile_pb, ProtobufAccess};
use risingwave_connector_codec::decoder::protobuf::ProtobufAccess;
use risingwave_connector_codec::decoder::Access;
use thiserror_ext::AsReport;

Expand Down
2 changes: 1 addition & 1 deletion src/connector/src/schema/protobuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use std::collections::BTreeMap;
use std::path::PathBuf;

use prost_reflect::{DescriptorPool, FileDescriptor, MessageDescriptor};
use risingwave_connector_codec::decoder::protobuf::compile_pb;
use risingwave_connector_codec::common::protobuf::compile_pb;

use super::loader::{LoadedSchema, SchemaLoader};
use super::schema_registry::Subject;
Expand Down

0 comments on commit 9f2cfd1

Please sign in to comment.