You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "z3d1k (via GitHub)" <gi...@apache.org> on 2024/04/12 16:30:41 UTC

Re: [PR] [FLINK-24379][Formats] Avro Glue Schema Registry table format [flink-connector-aws]

z3d1k commented on code in PR #122:
URL: https://github.com/apache/flink-connector-aws/pull/122#discussion_r1484534168


##########
flink-formats-aws/flink-sql-avro-glue-schema-registry/src/main/resources/META-INF/NOTICE:
##########
@@ -0,0 +1,28 @@
+link-sql-avro-glue-schema-registryu

Review Comment:
   Typo, should be `flink-sql-avro-glue-schema-registry`



##########
flink-formats-aws/flink-avro-glue-schema-registry/src/main/java/org/apache/flink/formats/avro/glue/schema/registry/AvroGlueFormatOptions.java:
##########
@@ -0,0 +1,92 @@
+/*
+ * 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.
+ */
+
+package org.apache.flink.formats.avro.glue.schema.registry;
+
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.configuration.ConfigOption;
+import org.apache.flink.configuration.ConfigOptions;
+
+import com.amazonaws.services.schemaregistry.utils.AWSSchemaRegistryConstants;
+import com.amazonaws.services.schemaregistry.utils.AvroRecordType;
+import software.amazon.awssdk.services.glue.model.Compatibility;
+
+import java.time.Duration;
+
+/** Options for AWS Glue Schema Registry Avro format. */
+@PublicEvolving
+public class AvroGlueFormatOptions {
+    public static final ConfigOption<String> AWS_REGION =
+            ConfigOptions.key("aws.region")
+                    .stringType()
+                    .noDefaultValue()
+                    .withDescription("AWS region");
+
+    public static final ConfigOption<String> AWS_ENDPOINT =
+            ConfigOptions.key("aws.endpoint").stringType().noDefaultValue();
+
+    public static final ConfigOption<Integer> CACHE_SIZE =
+            ConfigOptions.key("cache.size")
+                    .intType()
+                    .defaultValue(200)
+                    .withDescription("Cache maximum size in *items*.  Defaults to 200");
+
+    public static final ConfigOption<Long> CACHE_TTL_MS =
+            ConfigOptions.key("cache.ttlMs")
+                    .longType()
+                    .defaultValue(Duration.ofDays(1L).toMillis())
+                    .withDescription("Cache TTL in milliseconds.  Defaults to 1 day");
+
+    public static final ConfigOption<String> REGISTRY_NAME =
+            ConfigOptions.key("registry.name")
+                    .stringType()
+                    .noDefaultValue()
+                    .withDescription("Registry name");
+
+    public static final ConfigOption<Boolean> SCHEMA_AUTO_REGISTRATION =
+            ConfigOptions.key("schema.autoRegistration")
+                    .booleanType()
+                    .defaultValue(false)
+                    .withDescription("Whether auto-registration is enabled.  Defaults to true.");

Review Comment:
   Description does not match value set in code



##########
flink-formats-aws/flink-sql-avro-glue-schema-registry/pom.xml:
##########
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.flink</groupId>
+        <artifactId>flink-formats-aws-parent</artifactId>
+        <version>4.3-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>flink-sql-avro-glue-schema-registry</artifactId>
+    <name>Flink : Formats : AWS : SQL : Avro Glue Schema Registry</name>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-avro-glue-schema-registry</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-test-utils</artifactId>
+            <version>${flink.version}</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>shade-flink</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <configuration>
+                            <artifactSet>
+                                <includes>
+                                    <include>org.apache.flink:flink-connector-aws-base</include>
+                                    <include>org.apache.flink:flink-avro-glue-schema-registry</include>
+                                    <include>com.amazonaws:*</include>
+                                    <include>software.amazon.awssdk:*</include>
+                                    <include>software.amazon.glue:*</include>
+
+                                    <include>org.apache.flink:flink-avro</include>
+                                    <include>org.apache.avro:avro</include>
+                                    <include>com.fasterxml.jackson.core:*</include>
+                                    <include>com.fasterxml.jackson.dataformat:*</include>
+                                    <include>org.apache.commons:commons-compress</include>
+                                    <include>org.reactivestreams:reactive-streams</include>
+                                    <include>com.google.guava:guava</include>
+                                    <include>com.google.guava:failureaccess</include>
+                                </includes>
+                                <excludes>
+                                    <exclude>software.amazon.glue:schema-registry-build-tools</exclude>
+
+                                    <exclude>com.google.guava:listenablefuture</exclude>
+                                    <exclude>org.checkerframework:checker-qual</exclude>
+                                    <exclude>com.google.errorprone:error_prone_annotations</exclude>
+                                    <exclude>com.google.j2objc:j2objc-annotations</exclude>
+                                    <exclude>com.google.code.findbugs:jsr305</exclude>
+                                </excludes>
+                            </artifactSet>
+                            <relocations>
+                                <relocation>
+                                    <pattern>software.amazon</pattern>
+                                    <shadedPattern>org.apache.flink.avro.registry.glue.shaded.software.amazon</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>com.amazonaws</pattern>
+                                    <shadedPattern>org.apache.flink.avro.registry.glue.shaded.com.amazonaws</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>org.apache.kafka</pattern>
+                                    <shadedPattern>org.apache.flink.avro.registry.glue.shaded.org.apache.kafka</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>org.reactivestreams</pattern>
+                                    <shadedPattern>org.apache.flink.avro.registry.glue.shaded.org.reactivestreams</shadedPattern>
+                                </relocation>

Review Comment:
   Are these dependencies required or can these be safely excluded?



##########
flink-formats-aws/flink-avro-glue-schema-registry/pom.xml:
##########
@@ -61,6 +73,38 @@ under the License.
             <version>${glue.schema.registry.version}</version>
         </dependency>
 
+        <!-- test dependencies -->
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-table-runtime</artifactId>
+            <version>${flink.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-table-api-java</artifactId>
+            <version>${flink.version}</version>
+            <scope>test</scope>
+            <type>test-jar</type>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-table-common</artifactId>
+            <version>${flink.version}</version>
+            <scope>test</scope>
+            <type>test-jar</type>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.flink</groupId>
+            <artifactId>flink-avro</artifactId>
+            <version>${flink.version}</version>
+            <scope>test</scope>
+            <type>test-jar</type>
+        </dependency>
+
+
+
+

Review Comment:
   nit: redundant empty lines



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org