diff --git a/src/frontend/src/handler/alter_source_with_sr.rs b/src/frontend/src/handler/alter_source_with_sr.rs index 66d38f769337..472ce8772b99 100644 --- a/src/frontend/src/handler/alter_source_with_sr.rs +++ b/src/frontend/src/handler/alter_source_with_sr.rs @@ -382,6 +382,9 @@ pub mod tests { .clone() }; + let source = get_source(); + expect_test::expect!["CREATE SOURCE src (id INT, country STRUCT
, zipcode CHARACTER VARYING>, zipcode BIGINT, rate REAL) WITH (connector = 'kafka', topic = 'test-topic', properties.bootstrap.server = 'localhost:29092') FORMAT PLAIN ENCODE PROTOBUF (message = '.test.TestRecord', schema.location = 'file://')"].assert_eq(&source.create_sql_purified().replace(proto_file.path().to_str().unwrap(), "")); + let sql = format!( r#"ALTER SOURCE src FORMAT UPSERT ENCODE PROTOBUF ( message = '.test.TestRecord', @@ -425,10 +428,6 @@ pub mod tests { .unwrap(); assert_eq!(name_column.column_desc.data_type, DataType::Varchar); - let altered_sql = format!( - r#"CREATE SOURCE src WITH (connector = 'kafka', topic = 'test-topic', properties.bootstrap.server = 'localhost:29092') FORMAT PLAIN ENCODE PROTOBUF (message = '.test.TestRecordExt', schema.location = 'file://{}')"#, - proto_file.path().to_str().unwrap() - ); - assert_eq!(altered_sql, altered_source.definition); + expect_test::expect!["CREATE SOURCE src (id INT, country STRUCT, zipcode CHARACTER VARYING>, zipcode BIGINT, rate REAL, name CHARACTER VARYING) WITH (connector = 'kafka', topic = 'test-topic', properties.bootstrap.server = 'localhost:29092') FORMAT PLAIN ENCODE PROTOBUF (message = '.test.TestRecordExt', schema.location = 'file://')"].assert_eq(&altered_source.create_sql_purified().replace(proto_file.path().to_str().unwrap(), "")); } }