MartijnVisser commented on a change in pull request #17360:
URL: https://github.com/apache/flink/pull/17360#discussion_r718315208



##########
File path: docs/content/docs/connectors/table/formats/avro-glue.md
##########
@@ -0,0 +1,191 @@
+---
+title: AWS Glue Avro
+weight: 4
+type: docs
+aliases:
+  - /dev/table/connectors/formats/avro-glue.html
+---
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# AWS Glue Avro Format
+
+{{< label "Format: Serialization Schema" >}}
+{{< label "Format: Deserialization Schema" >}}
+
+The Glue Schema Registry (``avro-glue``) format allows you to read records 
that were serialized by the 
``com.amazonaws.services.schemaregistry.serializers.avro.AWSKafkaAvroSerializer``
 and to write records that can in turn be read by the 
``com.amazonaws.services.schemaregistry.deserializers.avro.AWSKafkaAvroDeserializer``.
  These records have their schemas stored out-of-band in a configured registry 
provided by the AWS Glue Schema Registry 
[service](https://docs.aws.amazon.com/glue/latest/dg/schema-registry.html#schema-registry-schemas).
+
+When reading (deserializing) a record with this format the Avro writer schema 
is fetched from the configured AWS Glue Schema Registry based on the schema 
version id encoded in the record while the reader schema is inferred from table 
schema. 
+
+When writing (serializing) a record with this format the Avro schema is 
inferred from the table schema and used to retrieve a schema id to be encoded 
with the data. The lookup is performed against the configured AWS Glue Schema 
Registry under the 
[value](https://docs.aws.amazon.com/glue/latest/dg/schema-registry.html#schema-registry-schemas)
 given in `avro-glue.schema-name`.
+
+The Avro Glue Schema Registry format can only be used in conjunction with the 
[Apache Kafka SQL connector]({{< ref "docs/connectors/table/kafka" >}}) or the 
[Upsert Kafka SQL Connector]({{< ref "docs/connectors/table/upsert-kafka" >}}).
+
+Dependencies
+------------
+
+{{< sql_download_table "avro-glue" >}}
+
+How to create tables with Avro-Glue format
+--------------
+
+Example of a table using raw UTF-8 string as Kafka key and Avro records 
registered in the Schema Registry as Kafka values:
+
+```sql
+CREATE TABLE user_created (
+
+  -- one column mapped to the Kafka raw UTF-8 key
+  the_kafka_key STRING,
+  
+  -- a few columns mapped to the Avro fields of the Kafka value
+  id STRING,
+  name STRING, 
+  email STRING
+
+) WITH (
+
+  'connector' = 'kafka',
+  'topic' = 'user_events_example1',
+  'properties.bootstrap.servers' = 'localhost:9092',
+
+  -- UTF-8 string as Kafka keys, using the 'the_kafka_key' table column
+  'key.format' = 'raw',
+  'key.fields' = 'the_kafka_key',
+
+  'value.format' = 'avro-glue',
+  'value.avro-glue.region' = 'us-east-1',
+  'value.avro-glue.registry.name' = 'my-schema-registry',
+  'value.avro-glue.schema-name' = 'my-schema-name',
+  'value.fields-include' = 'EXCEPT_KEY'
+)
+```
+
+Format Options
+----------------
+
+Yes, these options have inconsistent naming convnetions.  No, I can't fix it.  
This is for consistentcy with the existing [AWS Glue client 
code](https://github.com/awslabs/aws-glue-schema-registry/blob/master/common/src/main/java/com/amazonaws/services/schemaregistry/utils/AWSSchemaRegistryConstants.java#L20).

Review comment:
       I don't think this sentence should be in the docs?  

##########
File path: docs/content/docs/connectors/table/formats/avro-glue.md
##########
@@ -0,0 +1,191 @@
+---
+title: AWS Glue Avro
+weight: 4
+type: docs
+aliases:
+  - /dev/table/connectors/formats/avro-glue.html
+---
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# AWS Glue Avro Format
+
+{{< label "Format: Serialization Schema" >}}
+{{< label "Format: Deserialization Schema" >}}
+
+The Glue Schema Registry (``avro-glue``) format allows you to read records 
that were serialized by the 
``com.amazonaws.services.schemaregistry.serializers.avro.AWSKafkaAvroSerializer``
 and to write records that can in turn be read by the 
``com.amazonaws.services.schemaregistry.deserializers.avro.AWSKafkaAvroDeserializer``.
  These records have their schemas stored out-of-band in a configured registry 
provided by the AWS Glue Schema Registry 
[service](https://docs.aws.amazon.com/glue/latest/dg/schema-registry.html#schema-registry-schemas).
+
+When reading (deserializing) a record with this format the Avro writer schema 
is fetched from the configured AWS Glue Schema Registry based on the schema 
version id encoded in the record while the reader schema is inferred from table 
schema. 
+
+When writing (serializing) a record with this format the Avro schema is 
inferred from the table schema and used to retrieve a schema id to be encoded 
with the data. The lookup is performed against the configured AWS Glue Schema 
Registry under the 
[value](https://docs.aws.amazon.com/glue/latest/dg/schema-registry.html#schema-registry-schemas)
 given in `avro-glue.schema-name`.
+
+The Avro Glue Schema Registry format can only be used in conjunction with the 
[Apache Kafka SQL connector]({{< ref "docs/connectors/table/kafka" >}}) or the 
[Upsert Kafka SQL Connector]({{< ref "docs/connectors/table/upsert-kafka" >}}).

Review comment:
       Why can't it be used together with Kinesis? 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to