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


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

Review Comment:
   Great point, fixed



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