AHeise commented on a change in pull request #15156:
URL: https://github.com/apache/flink/pull/15156#discussion_r642902294



##########
File path: flink-formats/flink-parquet/pom.xml
##########
@@ -51,10 +51,24 @@ under the License.
                        <scope>provided</scope>
                </dependency>
 
+<!--           jackson-databind is big and in a compile transitive dep of 
flink-avro, exclude it and import it in runtime classpath-->
                <dependency>
                        <groupId>org.apache.flink</groupId>
                        <artifactId>flink-avro</artifactId>
                        <version>${project.version}</version>
+                       <optional>true</optional>
+                       <exclusions>
+                               <exclusion>
+                                       
<groupId>com.fasterxml.jackson.core</groupId>
+                                       
<artifactId>jackson-databind</artifactId>
+                               </exclusion>
+                       </exclusions>
+               </dependency>
+
+               <dependency>
+                       <groupId>com.fasterxml.jackson.core</groupId>
+                       <artifactId>jackson-databind</artifactId>
+                       <scope>runtime</scope>

Review comment:
       I think this is not working as intended. `runtime` would mean that it's 
available in flink-dist. However, we only provide `flink-shaded-jackson` with 
relocations.
   I think it's best to keep `flink-avro` optional and remove the rest 
(exclusion + this runtime dependency). Then, the user needs to bundle 
`flink-avro` themselves with jackson if they want to use ParquetAvro.

##########
File path: 
flink-formats/flink-avro/src/main/java/org/apache/flink/formats/avro/typeutils/AvroConversions.java
##########
@@ -0,0 +1,217 @@
+/*
+ * 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.typeutils;
+
+import org.apache.flink.types.Row;
+
+import org.apache.avro.LogicalType;
+import org.apache.avro.LogicalTypes;
+import org.apache.avro.Schema;
+import org.apache.avro.generic.GenericData;
+import org.apache.avro.generic.GenericRecord;
+import org.apache.avro.util.Utf8;
+
+import java.math.BigDecimal;
+import java.nio.ByteBuffer;
+import java.sql.Date;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.TimeZone;
+
+/** Utility class that takes care of conversions between avro and flink types. 
*/
+public class AvroConversions {

Review comment:
       This looks much better now! Thanks for the refactor. For the final PR, 
this should be a separate refactor commit, for example: `[FLINK-21393][formats] 
Pulling out AvroConversions out of AvroRowSerializationSchema`. The other 
changes can be squashed to one other commit then.




-- 
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.

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


Reply via email to