Skip to content

Commit 23a55a5

Browse files
committed
[Pulsar SQL] Add workaround for Presto 332 java.version parsing issue
- Presto 332 cannot parse a version string with more than 2 dots, such as 11.0.14.1 - Add a workaround that overrides the java.version system property with a version with 2 dots in it.
1 parent f84ff57 commit 23a55a5

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

.github/workflows/pulsar-ci.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,11 @@ jobs:
556556
-Pmain,docker -Dmaven.test.skip=true -Ddockerfile.build.squash=true \
557557
-Dspotbugs.skip=true -Dlicense.skip=true -Dcheckstyle.skip=true -Drat.skip=true
558558
559+
# Checks also Presto license files
560+
- name: Check binary licenses
561+
if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
562+
run: src/check-binary-license.sh ./distribution/server/target/apache-pulsar-*-bin.tar.gz
563+
559564
- name: save docker image apachepulsar/pulsar-test-latest-version:latest to Github artifact cache
560565
if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
561566
run: |
@@ -604,9 +609,8 @@ jobs:
604609
- name: Pulsar IO - Oracle
605610
group: PULSAR_IO_ORA
606611

607-
# disable Sql integration tests until https://github.com/apache/pulsar/issues/14951 has been resolved
608-
#- name: Sql
609-
# group: SQL
612+
- name: Sql
613+
group: SQL
610614

611615
steps:
612616
- name: checkout

bin/pulsar

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,14 @@ check_presto_libraries() {
126126
fi
127127
}
128128

129+
presto_java11_workaround() {
130+
# workaround https://github.com/apache/pulsar/issues/14951
131+
local java_version_trimmed=$({ $JAVA -version 2>&1| head -1 | awk -F\" '{ print $2 }' | awk -F. '{ print $1 "." $2 "." $3 }' | grep -v -F ..; } 2>/dev/null)
132+
if [ -n "$java_version_trimmed" ]; then
133+
echo "-Djava.version=${java_version_trimmed}"
134+
fi
135+
}
136+
129137
pulsar_help() {
130138
cat <<EOF
131139
Usage: pulsar <command>
@@ -371,10 +379,10 @@ elif [ $COMMAND == "compact-topic" ]; then
371379
exec $JAVA $OPTS org.apache.pulsar.compaction.CompactorTool --broker-conf $PULSAR_BROKER_CONF $@
372380
elif [ $COMMAND == "sql" ]; then
373381
check_presto_libraries
374-
exec $JAVA -cp "${PRESTO_HOME}/lib/*" io.prestosql.cli.Presto --server localhost:8081 "${@}"
382+
exec $JAVA -cp "${PRESTO_HOME}/lib/*" $(presto_java11_workaround) io.prestosql.cli.Presto --server localhost:8081 "${@}"
375383
elif [ $COMMAND == "sql-worker" ]; then
376384
check_presto_libraries
377-
exec ${PRESTO_HOME}/bin/launcher --etc-dir ${PULSAR_PRESTO_CONF} "${@}"
385+
exec ${PRESTO_HOME}/bin/launcher $(presto_java11_workaround) --etc-dir ${PULSAR_PRESTO_CONF} "${@}"
378386
elif [ $COMMAND == "tokens" ]; then
379387
exec $JAVA $OPTS org.apache.pulsar.utils.auth.tokens.TokensCliUtils $@
380388
elif [ $COMMAND == "version" ]; then

0 commit comments

Comments
 (0)