skywalker0618 commented on code in PR #19330:
URL: https://github.com/apache/hudi/pull/19330#discussion_r3627628550


##########
packaging/hudi-flink-bundle/pom.xml:
##########
@@ -651,6 +651,121 @@
           <scope>${flink.bundle.hive.scope}</scope>
         </dependency>
       </dependencies>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-shade-plugin</artifactId>
+            <version>${maven-shade-plugin.version}</version>
+            <executions>
+              <execution>
+                <configuration>
+                  <artifactSet>
+                    <!-- hive-exec needs the ANTLR runtime for Hive DDL parsing
+                         (Driver.compile) but does not embed it. -->
+                    <includes combine.children="append">
+                      <include>org.antlr:antlr-runtime</include>
+                      <include>org.antlr:ST4</include>
+                      <include>org.antlr:antlr4-runtime</include>
+                    </includes>
+                  </artifactSet>
+                  <!-- hive-exec is a fat jar that embeds these deps 
un-relocated; under Flink
+                       child-first classloading they would shadow the versions 
Hudi/Flink need.
+                       Scoped to this profile so the default (no-Hive) 
bundle's ABI is unchanged. -->
+                  <relocations combine.children="append">
+                    <relocation>
+                      <pattern>com.google.common.</pattern>
+                      
<shadedPattern>${flink.bundle.shade.prefix}com.google.common.</shadedPattern>
+                    </relocation>
+                    <relocation>
+                      <pattern>com.google.protobuf.</pattern>
+                      
<shadedPattern>${flink.bundle.shade.prefix}com.google.protobuf.</shadedPattern>
+                    </relocation>
+                    <relocation>
+                      <pattern>org.apache.commons.lang3.</pattern>
+                      
<shadedPattern>${flink.bundle.shade.prefix}org.apache.commons.lang3.</shadedPattern>
+                    </relocation>
+                    <relocation>
+                      <pattern>org.apache.commons.lang.</pattern>
+                      
<shadedPattern>${flink.bundle.shade.prefix}org.apache.commons.lang.</shadedPattern>
+                    </relocation>
+                    <relocation>
+                      <pattern>org.apache.thrift.</pattern>
+                      
<shadedPattern>${flink.bundle.shade.prefix}org.apache.thrift.</shadedPattern>
+                    </relocation>
+                    <relocation>
+                      <pattern>org.apache.orc.</pattern>
+                      
<shadedPattern>${flink.bundle.shade.prefix}org.apache.orc.</shadedPattern>
+                    </relocation>
+                    <relocation>
+                      <pattern>org.json.</pattern>
+                      
<shadedPattern>${flink.bundle.shade.prefix}org.json.</shadedPattern>
+                    </relocation>
+                    <relocation>
+                      <pattern>io.airlift.compress.</pattern>
+                      
<shadedPattern>${flink.bundle.shade.prefix}io.airlift.compress.</shadedPattern>
+                    </relocation>
+                    <!-- Relocate parquet-format-structures embedded in 
hive-exec, but keep
+                         org.apache.parquet.format.converter.** (provided by 
parquet-hadoop) at
+                         its original name: it is used with the un-relocated
+                         ParquetFileReader.readFooter, so relocating it causes 
a NoSuchMethodError. -->
+                    <relocation>
+                      <pattern>org.apache.parquet.format.</pattern>
+                      
<shadedPattern>${flink.bundle.shade.prefix}org.apache.parquet.format.</shadedPattern>
+                      <excludes>
+                        
<exclude>org.apache.parquet.format.converter.**</exclude>
+                      </excludes>
+                    </relocation>
+                    <relocation>
+                      <pattern>org.codehaus.jackson.</pattern>
+                      
<shadedPattern>${flink.bundle.shade.prefix}org.codehaus.jackson.</shadedPattern>
+                    </relocation>
+                    <relocation>
+                      <pattern>com.facebook.fb303.</pattern>
+                      
<shadedPattern>${flink.bundle.shade.prefix}com.facebook.fb303.</shadedPattern>
+                    </relocation>
+                    <relocation>
+                      <pattern>org.iq80.snappy.</pattern>
+                      
<shadedPattern>${flink.bundle.shade.prefix}org.iq80.snappy.</shadedPattern>
+                    </relocation>
+                    <relocation>
+                      <pattern>au.com.bytecode.opencsv.</pattern>
+                      
<shadedPattern>${flink.bundle.shade.prefix}au.com.bytecode.opencsv.</shadedPattern>
+                    </relocation>
+                    <relocation>
+                      <pattern>javaewah.</pattern>
+                      
<shadedPattern>${flink.bundle.shade.prefix}javaewah.</shadedPattern>
+                    </relocation>
+                    <relocation>
+                      <pattern>javolution.</pattern>
+                      
<shadedPattern>${flink.bundle.shade.prefix}javolution.</shadedPattern>
+                    </relocation>
+                    <relocation>
+                      <pattern>jodd.</pattern>
+                      
<shadedPattern>${flink.bundle.shade.prefix}jodd.</shadedPattern>
+                    </relocation>
+                  </relocations>
+                  <!-- Strip hive-exec's stale embedded Avro / ORC / Parquet 
so the declared
+                       modern avro, orc-core and parquet-* artifacts are the 
only source for
+                       those namespaces (relocated for 
avro/orc/parquet.format, canonical for
+                       parquet core). Without this we rely on shade's artifact 
ordering to make
+                       the modern copy win; stripping makes it explicit and 
version-safe. -->
+                  <filters combine.children="append">
+                    <filter>
+                      <artifact>org.apache.hive:hive-exec</artifact>

Review Comment:
   Excluded protobuf and airlift as well



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