Skip to content

Hive 29869 beeline size reduce - #6748

Open
illiabarbashov-sketch wants to merge 3 commits into
apache:masterfrom
illiabarbashov-sketch:HIVE-29869_beeline_size_reduce
Open

Hive 29869 beeline size reduce#6748
illiabarbashov-sketch wants to merge 3 commits into
apache:masterfrom
illiabarbashov-sketch:HIVE-29869_beeline_size_reduce

Conversation

@illiabarbashov-sketch

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Why are the changes needed?

Does this PR introduce any user-facing change?

How was this patch tested?

@Aggarwal-Raghav Aggarwal-Raghav left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I can still see the kerby and curator classes in beeline-standalone.jar !! Is this expected?

jar tvf beeline-standalone.jar | grep -i "curator" | head -n 10
     0 Fri Feb 01 00:00:00 IST 1980 META-INF/maven/org.apache.curator/
     0 Fri Feb 01 00:00:00 IST 1980 META-INF/maven/org.apache.curator/curator-recipes/
    68 Fri Feb 01 00:00:00 IST 1980 META-INF/maven/org.apache.curator/curator-recipes/pom.properties
  3783 Fri Feb 01 00:00:00 IST 1980 META-INF/maven/org.apache.curator/curator-recipes/pom.xml
     0 Fri Feb 01 00:00:00 IST 1980 org/apache/curator/
     0 Fri Feb 01 00:00:00 IST 1980 org/apache/curator/framework/
     0 Fri Feb 01 00:00:00 IST 1980 org/apache/curator/framework/recipes/
  1770 Fri Feb 01 00:00:00 IST 1980 org/apache/curator/framework/recipes/AfterConnectionEstablished$1.class
  1817 Fri Feb 01 00:00:00 IST 1980 org/apache/curator/framework/recipes/AfterConnectionEstablished.class
     0 Fri Feb 01 00:00:00 IST 1980 org/apache/curator/framework/recipes/atomic/


jar tvf beeline-standalone.jar | grep -i "kerby" | head -n 10
     0 Sun Dec 11 19:18:10 IST 2022 org/apache/hadoop/shaded/org/apache/kerby/
     0 Sun Dec 11 19:18:10 IST 2022 org/apache/hadoop/shaded/org/apache/kerby/kerberos/
     0 Sun Dec 11 19:18:10 IST 2022 org/apache/hadoop/shaded/org/apache/kerby/kerberos/kerb/
  2987 Sun Dec 11 19:18:10 IST 2022 org/apache/hadoop/shaded/org/apache/kerby/kerberos/kerb/KrbInputStream.class
  1971 Sun Dec 11 19:18:10 IST 2022 org/apache/hadoop/shaded/org/apache/kerby/kerberos/kerb/KrbOutputStream.class
     0 Sun Dec 11 19:18:10 IST 2022 org/apache/hadoop/shaded/org/apache/kerby/kerberos/kerb/ccache/
  7645 Sun Dec 11 19:18:10 IST 2022 org/apache/hadoop/shaded/org/apache/kerby/kerberos/kerb/ccache/CredCacheInputStream.class
  6456 Sun Dec 11 19:18:10 IST 2022 org/apache/hadoop/shaded/org/apache/kerby/kerberos/kerb/ccache/CredCacheOutputStream.class
  8287 Sun Dec 11 19:18:10 IST 2022 org/apache/hadoop/shaded/org/apache/kerby/kerberos/kerb/ccache/Credential.class
 12508 Sun Dec 11 19:18:10 IST 2022 org/apache/hadoop/shaded/org/apache/kerby/kerberos/kerb/ccache/CredentialCache.class

Comment thread beeline/pom.xml
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.thrift</groupId>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this is excluded? there is direct dependency in beeline module

import org.apache.thrift.transport.TTransportException;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's true, but that's just a clean up as thrift is pulled transitively.

Comment thread beeline/pom.xml Outdated
</exclusion>
<exclusion>
<groupId>org.apache.kerby</groupId>
<artifactId>kerb-util</artifactId>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe

<exclusion>
  <groupId>org.apache.kerby</groupId>
  <artifactId>*</artifactId>
</exclusion>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@sonarqubecloud

sonarqubecloud Bot commented Sep 4, 2026

Copy link
Copy Markdown

Comment thread beeline/pom.xml
<groupId>org.apache.hive</groupId>
<artifactId>hive-standalone-metastore-server</artifactId>
<version>${standalone-metastore.version}</version>
<scope>provided</scope>

@deniskuzZ deniskuzZ Sep 5, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why provided? isn't it only needed for tests?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not exactly. It's needed for SchemaTool. And that's is the part of open questions. Do we want native beeline installer to contain the SchemaTool in it? It can't be used anyways but it's the part of beeline module as of now. So I suggested to remove that dependency from compile time if the SchemaTool distribution remains the same and native beeline can go on its own.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SchemaTool?? Could you please check if it's even possible to trigger schema-tool from beeline?? beeline is an HS2 client and not supposed to init/recreate DB schema

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To what I see no. SchemaTool has it's own main method entry point and Beeline doesn't reference SchemaTool at any place. Also cli client only refers to beeline. For some reason SchemaTool is just inside beeline module. However they don't have anything in common to what I can judge.

Comment thread beeline/pom.xml
</exclusion>
<!-- kerby/kerberos auth chain pulled in transitively via hadoop-auth; beeline
does not exercise hadoop-common's Kerberos/UGI code paths -->
<exclusion>

@deniskuzZ deniskuzZ Sep 5, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we package optional deps?

<artifactId>hadoop-common</artifactId>
<optional>true</optional>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes they are packaged.

Comment thread beeline/pom.xml
<arg value="${project.build.directory}/apache-hive-beeline-${project.version}/${installer.arch}"/>
<!-- Reduces the size of the output artifact -->
<arg value="--add-modules"/>
<arg value="java.base,java.compiler,java.desktop,java.instrument,java.prefs,java.rmi,java.scripting,java.security.jgss,java.security.sasl,java.sql.rowset,jdk.httpserver,jdk.jfr,jdk.management,jdk.security.auth,jdk.unsupported"/>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this list come from

jdeps \
  --multi-release 21 \
  --ignore-missing-deps \
  --print-module-deps \
  beeline-standalone.jar

?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this command is the source for the list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants