risingwave_connector/schema/
mod.rs1use crate::error::ConnectorError;
16
17pub mod avro;
18mod loader;
19pub mod protobuf;
20pub mod schema_registry;
21
22pub use loader::{ConfluentSchemaLoader, SchemaLoader, SchemaVersion};
23
24const MESSAGE_NAME_KEY: &str = "message";
25const KEY_MESSAGE_NAME_KEY: &str = "key.message";
26const SCHEMA_LOCATION_KEY: &str = "schema.location";
27const SCHEMA_REGISTRY_KEY: &str = "schema.registry";
28const NAME_STRATEGY_KEY: &str = "schema.registry.name.strategy";
29pub const AWS_GLUE_SCHEMA_ARN_KEY: &str = "aws.glue.schema_arn";
30
31#[derive(Debug, thiserror::Error, thiserror_ext::Macro)]
32#[error("Invalid option: {message}")]
33pub struct InvalidOptionError {
34 pub message: String,
35 }
38
39#[derive(Debug, thiserror::Error, thiserror_ext::Macro)]
40#[error("Malformed response: {message}")]
41pub struct MalformedResponseError {
42 pub message: String,
43}
44
45#[derive(Debug, thiserror::Error)]
46pub enum SchemaFetchError {
47 #[error(transparent)]
48 InvalidOption(#[from] InvalidOptionError),
49 #[error(transparent)]
50 License(#[from] risingwave_common::license::FeatureNotAvailable),
51 #[error(transparent)]
52 Request(#[from] schema_registry::ConcurrentRequestError),
53 #[error(transparent)]
54 AwsGlue(#[from] Box<aws_sdk_glue::operation::get_schema_version::GetSchemaVersionError>),
55 #[error(transparent)]
56 MalformedResponse(#[from] MalformedResponseError),
57 #[error("schema version id invalid: {0}")]
58 InvalidUuid(#[from] uuid::Error),
59 #[error("schema compilation error: {0}")]
60 SchemaCompile(
61 #[source]
62 #[backtrace]
63 risingwave_common::error::BoxedError,
64 ),
65 #[error("{0}")] YetToMigrate(
67 #[source]
68 #[backtrace]
69 ConnectorError,
70 ),
71}