From 1fc823c431ab0ce185bca93c5f71410f1bcbf7bc Mon Sep 17 00:00:00 2001 From: tabVersion Date: Wed, 23 Oct 2024 16:30:24 +0800 Subject: [PATCH] remove related e2e Signed-off-by: tabVersion --- e2e_test/ddl/alter_set_schema.slt | 17 ------ e2e_test/ddl/connection.slt | 23 -------- e2e_test/sink/kafka/create_sink.slt | 42 --------------- e2e_test/source_legacy/basic/ddl.slt | 52 ------------------- .../basic/old_row_format_syntax/ddl.slt | 40 -------------- src/connector/src/sink/mod.rs | 2 - 6 files changed, 176 deletions(-) delete mode 100644 e2e_test/ddl/connection.slt diff --git a/e2e_test/ddl/alter_set_schema.slt b/e2e_test/ddl/alter_set_schema.slt index 74dcc5a77e64..db0f479c85c0 100644 --- a/e2e_test/ddl/alter_set_schema.slt +++ b/e2e_test/ddl/alter_set_schema.slt @@ -94,23 +94,6 @@ WHERE nspname = 'test_schema'; ---- test_subscription test_schema -statement ok -CREATE CONNECTION test_conn WITH (type = 'privatelink', provider = 'mock'); - -statement ok -ALTER CONNECTION test_conn SET SCHEMA test_schema; - -query TT -SELECT name AS connname, nspname AS schemaname -FROM rw_connections -JOIN pg_namespace ON pg_namespace.oid = rw_connections.schema_id -WHERE nspname = 'test_schema'; ----- -test_conn test_schema - -statement ok -DROP CONNECTION test_schema.test_conn; - statement ok DROP SINK test_schema.test_sink; diff --git a/e2e_test/ddl/connection.slt b/e2e_test/ddl/connection.slt deleted file mode 100644 index 435395e9d249..000000000000 --- a/e2e_test/ddl/connection.slt +++ /dev/null @@ -1,23 +0,0 @@ -# Create a connection. -statement ok -CREATE CONNECTION conn0 WITH (type = 'privatelink', provider = 'mock'); - -# Create another user with duplicate name. -statement error -CREATE CONNECTION conn0 WITH (type = 'privatelink', provider = 'mock'); - -# Create if not exists. -statement ok -CREATE CONNECTION IF NOT EXISTS conn0 WITH (type = 'privatelink', provider = 'mock'); - -# Test quoting. -statement ok -CREATE CONNECTION "conn1" WITH (type = 'privatelink', provider = 'mock'); - -# Drop connections. -statement ok -DROP CONNECTION conn0; - -# Drop connections. -statement ok -DROP CONNECTION conn1; diff --git a/e2e_test/sink/kafka/create_sink.slt b/e2e_test/sink/kafka/create_sink.slt index 338465c471af..7f589e4a4b23 100644 --- a/e2e_test/sink/kafka/create_sink.slt +++ b/e2e_test/sink/kafka/create_sink.slt @@ -31,48 +31,6 @@ create sink sink_non_exist_broker from t_kafka with ( type = 'append-only', ); -# Test create sink with connection -# Create a mock connection -statement ok -create connection mock with ( - type = 'privatelink', - provider = 'mock', -); - -# Refer to a non-existant connection -statement error -create sink si_kafka_append_only_conn from t_kafka with ( - connector = 'kafka', - properties.bootstrap.server = 'message_queue:29092', - topic = 'test-rw-sink-append-only', - type = 'append-only', - force_append_only = 'true', - connection.name = 'nonexist', -); - -# Create sink with connection -statement ok -create sink si_kafka_append_only_conn from t_kafka with ( - connector = 'kafka', - properties.bootstrap.server = 'message_queue:29092', - topic = 'test-rw-sink-append-only', - type = 'append-only', - force_append_only = 'true', - connection.name = 'mock', -); - -# Try to drop connection mock, which is in use -statement error -drop connection mock; - -# Drop sink -statement ok -drop sink si_kafka_append_only_conn; - -# Drop connection -statement ok -drop connection mock; - # Connection test clean-up finished statement error sink cannot be append-only diff --git a/e2e_test/source_legacy/basic/ddl.slt b/e2e_test/source_legacy/basic/ddl.slt index 8e63971fb5b8..e8b9e10b249f 100644 --- a/e2e_test/source_legacy/basic/ddl.slt +++ b/e2e_test/source_legacy/basic/ddl.slt @@ -198,35 +198,6 @@ s statement ok drop table s -# Test create source with connection -statement ok -CREATE CONNECTION mock WITH (type = 'privatelink', provider = 'mock'); - -# Reference to non-existant connection -statement error -create source s ( - column1 varchar -) with ( - connector = 'kafka', - topic = 'kafka_1_partition_topic', - properties.bootstrap.server = 'message_queue:29092', - connection.name = 'nonexist', -) FORMAT PLAIN ENCODE JSON; - -statement ok -CREATE TABLE mytable ( - column1 varchar -) with ( - connector = 'kafka', - topic = 'kafka_1_partition_topic', - properties.bootstrap.server = 'message_queue:29092', - connection.name = 'mock' -) FORMAT PLAIN ENCODE JSON; - -statement ok -DROP TABLE mytable; - - # `DEBEZIUM_MONGO_JSON` requires the source table have `_id` and `payload` columns. statement error create source s ( @@ -236,7 +207,6 @@ create source s ( connector = 'kafka', topic = 'kafka_1_partition_topic', properties.bootstrap.server = 'message_queue:29092', - connection.name = 'nonexist', ) FORMAT DEBEZIUM_MONGO ENCODE JSON; # `DEBEZIUM_MONGO_JSON` requires the `_id` column is primary key. @@ -248,7 +218,6 @@ create source s ( connector = 'kafka', topic = 'kafka_1_partition_topic', properties.bootstrap.server = 'message_queue:29092', - connection.name = 'nonexist', ) FORMAT DEBEZIUM_MONGO ENCODE JSON; # `DEBEZIUM_MONGO_JSON` requires the `payload` column is jsonb type. @@ -260,25 +229,4 @@ create source s ( connector = 'kafka', topic = 'kafka_1_partition_topic', properties.bootstrap.server = 'message_queue:29092', - connection.name = 'nonexist', ) FORMAT DEBEZIUM_MONGO ENCODE JSON; - -statement ok -create source s ( - column1 varchar -) with ( - connector = 'kafka', - topic = 'kafka_1_partition_topic', - properties.bootstrap.server = 'message_queue:29092', - connection.name = 'mock', -) FORMAT PLAIN ENCODE JSON; - -# Drop a connection in use -statement error -drop connection mock; - -statement ok -drop source s; - -statement ok -drop connection mock; diff --git a/e2e_test/source_legacy/basic/old_row_format_syntax/ddl.slt b/e2e_test/source_legacy/basic/old_row_format_syntax/ddl.slt index 0fe67a8504b5..79c3553c38c7 100644 --- a/e2e_test/source_legacy/basic/old_row_format_syntax/ddl.slt +++ b/e2e_test/source_legacy/basic/old_row_format_syntax/ddl.slt @@ -152,35 +152,6 @@ s statement ok drop table s -# Test create source with connection -statement ok -CREATE CONNECTION mock WITH (type = 'privatelink', provider = 'mock'); - -# Reference to non-existant connection -statement error -create source s ( - column1 varchar -) with ( - connector = 'kafka', - topic = 'kafka_1_partition_topic', - properties.bootstrap.server = 'message_queue:29092', - connection.name = 'nonexist', -) ROW FORMAT JSON; - -statement ok -CREATE TABLE mytable ( - column1 varchar -) with ( - connector = 'kafka', - topic = 'kafka_1_partition_topic', - properties.bootstrap.server = 'message_queue:29092', - connection.name = 'mock' -) ROW FORMAT JSON; - -statement ok -DROP TABLE mytable; - - # `DEBEZIUM_MONGO_JSON` requires the source table have `_id` and `payload` columns. statement error create source s ( @@ -190,7 +161,6 @@ create source s ( connector = 'kafka', topic = 'kafka_1_partition_topic', properties.bootstrap.server = 'message_queue:29092', - connection.name = 'nonexist', ) ROW FORMAT DEBEZIUM_MONGO_JSON; # `DEBEZIUM_MONGO_JSON` requires the `_id` column is primary key. @@ -202,7 +172,6 @@ create source s ( connector = 'kafka', topic = 'kafka_1_partition_topic', properties.bootstrap.server = 'message_queue:29092', - connection.name = 'nonexist', ) ROW FORMAT DEBEZIUM_MONGO_JSON; # `DEBEZIUM_MONGO_JSON` requires the `payload` column is jsonb type. @@ -214,7 +183,6 @@ create source s ( connector = 'kafka', topic = 'kafka_1_partition_topic', properties.bootstrap.server = 'message_queue:29092', - connection.name = 'nonexist', ) ROW FORMAT DEBEZIUM_MONGO_JSON; statement ok @@ -224,15 +192,7 @@ create source s ( connector = 'kafka', topic = 'kafka_1_partition_topic', properties.bootstrap.server = 'message_queue:29092', - connection.name = 'mock', ) ROW FORMAT JSON; -# Drop a connection in use -statement error -drop connection mock; - statement ok drop source s; - -statement ok -drop connection mock; diff --git a/src/connector/src/sink/mod.rs b/src/connector/src/sink/mod.rs index 2bbbb9558244..2111b33e29ef 100644 --- a/src/connector/src/sink/mod.rs +++ b/src/connector/src/sink/mod.rs @@ -693,12 +693,10 @@ impl SinkCommitCoordinator for DummySinkCommitCoordinator { impl SinkImpl { pub fn new(mut param: SinkParam) -> Result { - const CONNECTION_NAME_KEY: &str = "connection.name"; const PRIVATE_LINK_TARGET_KEY: &str = "privatelink.targets"; // remove privatelink related properties if any param.properties.remove(PRIVATE_LINK_TARGET_KEY); - param.properties.remove(CONNECTION_NAME_KEY); let sink_type = param .properties