Skip to content

Commit 40cc57a

Browse files
committed
fix 4.0.1 by relocating jline
1 parent f5530ee commit 40cc57a

File tree

3 files changed

+42
-6
lines changed

3 files changed

+42
-6
lines changed

hive/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ RUN /stackable/patchable --images-repo-root=src checkout hive ${PRODUCT_VERSION}
4747

4848
# Use bash for regex machting, otherwise docker lint is complaining:
4949
# hive/Dockerfile:51 SC3014 warning: In POSIX sh, == in place of = is undefined.
50-
SHELL ["/bin/bash", "-c"]
50+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
5151

5252
# Make expensive maven build a separate layer for better caching
5353
# Cache mounts are owned by root by default

hive/hive-metastore-opa-authorizer/Dockerfile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ COPY --chown=${STACKABLE_USER_UID}:0 --from=hadoop-builder /stackable/patched-li
2525

2626
# Use bash for regex machting, otherwise docker lint is complaining:
2727
# hive/hive-metastore-opa-authorizer/Dockerfile:26 SC3015 warning: In POSIX sh, =~ regex matching is undefined.
28-
SHELL ["/bin/bash", "-c"]
28+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
2929

3030
# Make expensive maven build a separate layer for better caching
3131
# Cache mounts are owned by root by default
@@ -55,10 +55,7 @@ if [[ "${HIVE_VERSION}" =~ "^3" ]]; then
5555
# Hive 4.0.1 only works with the shaded jar
5656
elif [[ "${HIVE_VERSION}" == "4.0.1" ]]; then
5757
mvn clean package -DskipTests -Dhive.version=${HIVE_VERSION} -Dhadoop.version=${HADOOP_VERSION} -f hms-v4/pom.xml
58-
# The renaming from "com.bosch.bdps.hms4-..." to "zhms4-.." is required for 4.0.1 because it is a dependency mess and otherwise loaded before other hive
59-
# libraries. Setting CLASSPATH or HIVE_AUX_JARS_PATH did not reorder the dependency loading up as well.
60-
# This is very very bad and depends on alhpabetically ordering...
61-
mv hms-v4/target/com.bosch.bdps.hms4-${HIVE_VERSION}-${HADOOP_VERSION}-${AUTHORIZER_VERSION}.jar /stackable/opa-authorizer-bin/zhms4-${HIVE_VERSION}-${HADOOP_VERSION}-${AUTHORIZER_VERSION}.jar
58+
mv hms-v4/target/com.bosch.bdps.hms4-${HIVE_VERSION}-${HADOOP_VERSION}-${AUTHORIZER_VERSION}.jar /stackable/opa-authorizer-bin/hms4-${HIVE_VERSION}-${HADOOP_VERSION}-${AUTHORIZER_VERSION}.jar
6259
# Hive 4.1.0 only works with the non shaded jar
6360
else
6461
mvn clean package -DskipTests -Dhive.version=${HIVE_VERSION} -Dhadoop.version=${HADOOP_VERSION} -f hms-v4/pom.xml
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
From 500af58b1022e65ba3b498e210d6f69fa1e3a1d4 Mon Sep 17 00:00:00 2001
2+
From: Malte Sander <malte.sander.it@gmail.com>
3+
Date: Mon, 24 Nov 2025 15:00:03 +0100
4+
Subject: Shade jline explicitly
5+
6+
---
7+
hms-v4/pom.xml | 19 +++++++++++++++++++
8+
1 file changed, 19 insertions(+)
9+
10+
diff --git a/hms-v4/pom.xml b/hms-v4/pom.xml
11+
index 4ebeac4..e1d6fd9 100644
12+
--- a/hms-v4/pom.xml
13+
+++ b/hms-v4/pom.xml
14+
@@ -67,6 +67,25 @@
15+
</excludes>
16+
</filter>
17+
</filters>
18+
+ <!--
19+
+ For Hive 4.0.1 the dependency loading is screwed. We explicitly shade jline to avoid a schematool dependency mess:
20+
+
21+
+ Exception in thread "main" java.lang.NoSuchMethodError: 'void org.jline.reader.impl.completer.StringsCompleter.<init>(org.jline.reader.Candidate[])'
22+
+ at sqlline.SqlLineOpts.setOptionCompleters(SqlLineOpts.java:160)
23+
+ at sqlline.Application.getCommandHandlers(Application.java:294)
24+
+ at sqlline.SqlLine$Config.<init>(SqlLine.java:1946)
25+
+ at sqlline.SqlLine.setAppConfig(SqlLine.java:1875)
26+
+ at sqlline.SqlLine.<init>(SqlLine.java:229)
27+
+ at org.apache.hadoop.hive.metastore.tools.schematool.MetastoreSchemaTool.execSql(MetastoreSchemaTool.java:313)
28+
+
29+
+ This does not affect versions >= 4.1.x since the non shaded jar is used.
30+
+ -->
31+
+ <relocations>
32+
+ <relocation>
33+
+ <pattern>org.jline</pattern>
34+
+ <shadedPattern>com.bosch.bdps.jline</shadedPattern>
35+
+ </relocation>
36+
+ </relocations>
37+
</configuration>
38+
</execution>
39+
</executions>

0 commit comments

Comments
 (0)