diff --git a/e2e_test/source/basic/kafka.slt b/e2e_test/source/basic/kafka.slt index a7c8b6c73205..8c9d56dc64bf 100644 --- a/e2e_test/source/basic/kafka.slt +++ b/e2e_test/source/basic/kafka.slt @@ -132,7 +132,8 @@ create table s9 with ( topic = 'avro_bin', properties.bootstrap.server = '127.0.0.1:29092', scan.startup.mode = 'earliest' -) row format avro message 'test_student' row schema location 'file:///risingwave/avro-simple-schema.avsc' +) row format avro +row schema location 'file:///risingwave/avro-simple-schema.avsc' statement ok create table s10 with ( @@ -140,7 +141,8 @@ create table s10 with ( topic = 'avro_c_bin', properties.bootstrap.server = '127.0.0.1:29092', scan.startup.mode = 'earliest' -) row format avro message 'user' row schema location 'file:///risingwave/avro-complex-schema.avsc' +) row format avro +row schema location 'file:///risingwave/avro-complex-schema.avsc' statement ok create table s11 with ( @@ -240,7 +242,8 @@ create source s18 with ( topic = 'avro_c_bin', properties.bootstrap.server = '127.0.0.1:29092', scan.startup.mode = 'earliest' -) row format avro message 'user' row schema location 'file:///risingwave/avro-complex-schema.avsc' +) row format avro +row schema location 'file:///risingwave/avro-complex-schema.avsc' statement ok flush; diff --git a/src/sqlparser/src/ast/statement.rs b/src/sqlparser/src/ast/statement.rs index 06ed47fa2cf3..4cbe273b055c 100644 --- a/src/sqlparser/src/ast/statement.rs +++ b/src/sqlparser/src/ast/statement.rs @@ -188,28 +188,22 @@ impl fmt::Display for ProtobufSchema { } // sql_grammar!(AvroSchema { -// [Keyword::MESSAGE], -// message_name: AstString, -// [Keyword::ROW, Keyword::SCHEMA, Keyword::LOCATION], -// row_schema_location: AstString, +// [Keyword::ROW, Keyword::SCHEMA, Keyword::LOCATION, [Keyword::CONFLUENT, Keyword::SCHEMA, +// Keyword::REGISTRY]], row_schema_location: AstString, // }); #[derive(Debug, Clone, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct AvroSchema { - pub message_name: AstString, pub row_schema_location: AstString, pub use_schema_registry: bool, } impl ParseTo for AvroSchema { fn parse_to(p: &mut Parser) -> Result { - impl_parse_to!([Keyword::MESSAGE], p); - impl_parse_to!(message_name: AstString, p); impl_parse_to!([Keyword::ROW, Keyword::SCHEMA, Keyword::LOCATION], p); impl_parse_to!(use_schema_registry => [Keyword::CONFLUENT, Keyword::SCHEMA, Keyword::REGISTRY], p); impl_parse_to!(row_schema_location: AstString, p); Ok(Self { - message_name, row_schema_location, use_schema_registry, }) @@ -219,8 +213,6 @@ impl ParseTo for AvroSchema { impl fmt::Display for AvroSchema { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let mut v: Vec = vec![]; - impl_fmt_display!([Keyword::MESSAGE], v); - impl_fmt_display!(message_name, v, self); impl_fmt_display!([Keyword::ROW, Keyword::SCHEMA, Keyword::LOCATION], v); impl_fmt_display!(use_schema_registry => [Keyword::CONFLUENT, Keyword::SCHEMA, Keyword::REGISTRY], v, self); impl_fmt_display!(row_schema_location, v, self);