MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / parse_glue_avro_option

Method parse_glue_avro_option

src/sql-parser/src/parser.rs:2269–2284  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

2267 }
2268
2269 fn parse_glue_avro_option(&mut self) -> Result<GlueAvroOption<Raw>, ParserError> {
2270 self.expect_keywords(&[SCHEMA, NAME])?;
2271 // The value is parsed as optional even though SCHEMA NAME requires one currently.
2272 // Enforcing it here wouldn't let us drop the purification-layer check:
2273 // the whole option list is optional, so `CONNECTION glue_conn` and
2274 // `(...)` with no SCHEMA NAME bypass this function entirely. This also allows
2275 // us to provide more detailed errors.
2276 //
2277 // Future work may add mutually exclusive options (or interpret a lack of schema name).
2278 // For example, a lack of schema name may fall back to the default AWS Glue naming strategy:
2279 // See <https://github.com/awslabs/aws-glue-schema-registry/blob/4b9cac477d6876a883e2a8893738a30c072694dc/common/src/main/java/com/amazonaws/services/schemaregistry/common/AWSSchemaNamingStrategyDefaultImpl.java#L18>
2280 Ok(GlueAvroOption {
2281 name: GlueAvroOptionName::SchemaName,
2282 value: self.parse_optional_option_value()?,
2283 })
2284 }
2285
2286 fn parse_protobuf_schema(&mut self) -> Result<ProtobufSchema<Raw>, ParserError> {
2287 if self.parse_keywords(&[USING, CONFLUENT, SCHEMA, REGISTRY]) {

Callers

nothing calls this directly

Calls 2

expect_keywordsMethod · 0.80

Tested by

no test coverage detected