You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@orc.apache.org by do...@apache.org on 2022/12/06 18:14:51 UTC

[orc] branch branch-1.8 updated: ORC-1333: Exclude the proto files from the nohive jar

This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch branch-1.8
in repository https://gitbox.apache.org/repos/asf/orc.git


The following commit(s) were added to refs/heads/branch-1.8 by this push:
     new d49cc2dbf ORC-1333: Exclude the proto files from the nohive jar
d49cc2dbf is described below

commit d49cc2dbfefaa9e2156f6321b2e73ca7b7e1321c
Author: Fokko Driesprong <fo...@tabular.io>
AuthorDate: Tue Dec 6 10:14:33 2022 -0800

    ORC-1333: Exclude the proto files from the nohive jar
    
    ### Why are the changes needed?
    
    We're seeing some conflicts in the proto files when updating Iceberg in Trino: https://github.com/trinodb/trino/pull/15079#discussion_r1025121839
    
    I think we should exclude the proto files from the `nohive` jar.
    
    Before the change:
    ```
    ➜  java git:(main) ✗ rm -rf core/target/
    ➜  java git:(main) ✗ mvn package -DskipTests
    ➜  java git:(main) ✗ cd core/target
    ➜  target git:(main) ✗ unzip orc-core-1.9.0-SNAPSHOT-nohive.jar
    ➜  target git:(main) find . | grep -i "google/protobuf/"
    ./google/protobuf/timestamp.proto
    ./google/protobuf/field_mask.proto
    ./google/protobuf/api.proto
    ./google/protobuf/duration.proto
    ./google/protobuf/struct.proto
    ./google/protobuf/wrappers.proto
    ./google/protobuf/source_context.proto
    ./google/protobuf/any.proto
    ./google/protobuf/type.proto
    ./google/protobuf/empty.proto
    ./google/protobuf/compiler
    ./google/protobuf/compiler/plugin.proto
    ./google/protobuf/descriptor.proto
    ```
    
    After the change:
    ```
    ➜  java git:(main) ✗ rm -rf core/target/
    ➜  java git:(main) ✗ mvn package -DskipTests
    ➜  java git:(main) ✗ cd core/target
    ➜  target git:(main) ✗ unzip orc-core-1.9.0-SNAPSHOT-nohive.jar
    ➜  target git:(main) ✗ find . | grep -i "google/protobuf/"
    ∅
    ```
    
    Interestingly enough, the normal jar doesn't contain these proto files:
    ```
    ➜  java git:(main) ✗ rm -rf core/target/
    ➜  java git:(main) ✗ mvn package -DskipTests
    ➜  java git:(main) ✗ cd core/target
    ➜  target git:(main) unzip orc-core-1.9.0-SNAPSHOT.jar| grep -i proto
    ➜  target git:(main) find . | grep -i "google/protobuf/"
    ∅
    ```
    
    ### What changes were proposed in this pull request?
    
    Exclude the proto files
    
    ### How was this patch tested?
    
    Inspecting the produced jar
    
    Closes https://github.com/apache/orc/issues/1333
    
    Closes #1334 from Fokko/fd-exclude-proto-files.
    
    Authored-by: Fokko Driesprong <fo...@tabular.io>
    Signed-off-by: Dongjoon Hyun <do...@apache.org>
    (cherry picked from commit f6fee0744ed46c741d90dc116f490cefb10efa99)
    Signed-off-by: Dongjoon Hyun <do...@apache.org>
---
 java/pom.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/java/pom.xml b/java/pom.xml
index 066dfa43c..453f97b0e 100644
--- a/java/pom.xml
+++ b/java/pom.xml
@@ -505,6 +505,7 @@
                       <exclude>META-INF/DEPENDENCIES</exclude>
                       <exclude>META-INF/LICENSE</exclude>
                       <exclude>META-INF/NOTICE</exclude>
+                      <exclude>google/protobuf/**</exclude>
                     </excludes>
                   </filter>
                 </filters>