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

refactor: deprecate old s3 and use use s3_v2 as default #17963

Merged
merged 8 commits into from
Aug 16, 2024
Merged
Changes from 1 commit
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
16 changes: 8 additions & 8 deletions src/frontend/src/handler/create_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ use risingwave_connector::source::datagen::DATAGEN_CONNECTOR;
use risingwave_connector::source::iceberg::ICEBERG_CONNECTOR;
use risingwave_connector::source::nexmark::source::{get_event_data_types_with_names, EventType};
use risingwave_connector::source::test_source::TEST_CONNECTOR;
pub use risingwave_connector::source::UPSTREAM_SOURCE_KEY;
use risingwave_connector::source::{
ConnectorProperties, GCS_CONNECTOR, GOOGLE_PUBSUB_CONNECTOR, KAFKA_CONNECTOR,
KINESIS_CONNECTOR, MQTT_CONNECTOR, NATS_CONNECTOR, NEXMARK_CONNECTOR, OPENDAL_S3_CONNECTOR,
Expand All @@ -73,7 +74,7 @@ use super::RwPgResponse;
use crate::binder::Binder;
use crate::catalog::source_catalog::SourceCatalog;
use crate::catalog::{DatabaseId, SchemaId};
use crate::error::ErrorCode::{self, Deprecated, InvalidInputSyntax, NotSupported, ProtocolError};
use crate::error::ErrorCode::{self, InvalidInputSyntax, NotSupported, ProtocolError};
use crate::error::{Result, RwError};
use crate::expr::Expr;
use crate::handler::create_table::{
Expand All @@ -88,8 +89,6 @@ use crate::session::SessionImpl;
use crate::utils::{resolve_privatelink_in_with_option, resolve_secret_ref_in_with_options};
use crate::{bind_data_type, build_graph, OptimizerContext, WithOptions, WithOptionsSecResolved};

pub(crate) const UPSTREAM_SOURCE_KEY: &str = "connector";

/// Map a JSON schema to a relational schema
async fn extract_json_table_schema(
schema_config: &Option<(AstString, bool)>,
Expand Down Expand Up @@ -1117,7 +1116,7 @@ pub fn validate_compatibility(
source_schema: &ConnectorSchema,
props: &mut BTreeMap<String, String>,
) -> Result<()> {
let connector = props
let mut connector = props
.get_connector()
.ok_or_else(|| RwError::from(ProtocolError("missing field 'connector'".to_string())))?;

Expand Down Expand Up @@ -1151,10 +1150,11 @@ pub fn validate_compatibility(
}

if connector == S3_CONNECTOR {
return Err(RwError::from(Deprecated(
S3_CONNECTOR.to_string(),
OPENDAL_S3_CONNECTOR.to_string(),
)));
let entry = props
.get_mut(risingwave_connector::source::UPSTREAM_SOURCE_KEY)
.unwrap();
*entry = OPENDAL_S3_CONNECTOR.to_string();
connector = OPENDAL_S3_CONNECTOR.to_string();
}

let compatible_encodes = compatible_formats
Expand Down
Loading