IMPALA-14559: Ship calcite-planner jar in Impala packages

This adds the java/impala-package Maven project to make it easier
to ship / test the Calcite planner. impala-package has a dependency
on impala-frontend and calcite-planner, so its classpath requires
no extra work when constructing the classpath.

An additional cleanup is that this no longer puts the
impala-frontend-*-tests.jar on the classpath by default. This requires
updating the query event hooks test, as it relies on that jar being
present.

This does not change the default value for the use_calcite_planner
query option, so there is no change in behavior.

Testing:
 - Ran a core job
 - Built docker images and OS packages locally

Change-Id: I81dec2a5b59e279229a735c8bb1a23c77111a793
Reviewed-on: http://gerrit.cloudera.org:8080/23497
Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
This commit is contained in:
Joe McDonnell
2025-10-06 16:36:24 -07:00
committed by Impala Public Jenkins
parent 5ea4dc342e
commit 5eea4f6f79
6 changed files with 119 additions and 40 deletions

View File

@@ -18,17 +18,31 @@
# Client tests for Query Event Hooks
from __future__ import absolute_import, division, print_function
import os
import pytest
from tests.common.custom_cluster_test_suite import CustomClusterTestSuite
def add_frontend_test_jar_to_classpath():
"""Put the impala-frontend-*-tests.jar on the classpath"""
os.environ["CUSTOM_CLASSPATH"] = os.path.join(os.getenv("IMPALA_HOME"), "fe",
"target", "impala-frontend-{0}-tests.jar".format(os.getenv("IMPALA_VERSION")))
class TestHooks(CustomClusterTestSuite):
"""
Tests for FE QueryEventHook invocations.
"""
DUMMY_HOOK = "org.apache.impala.testutil.DummyQueryEventHook"
@classmethod
def setup_class(cls):
super(TestHooks, cls).setup_class()
# This needs the impala-frontend-*-tests.jar on the classpath to make the test query
# hooks available.
add_frontend_test_jar_to_classpath()
@pytest.mark.execute_serially
@CustomClusterTestSuite.with_args(
impala_log_dir="{query_event_hooks_log}",
@@ -65,6 +79,9 @@ class TestHooksStartupFail(CustomClusterTestSuite):
if cls.exploration_strategy() != 'exhaustive':
pytest.skip('runs only in exhaustive')
super(TestHooksStartupFail, cls).setup_class()
# This needs the impala-frontend-*-tests.jar on the classpath to make the test query
# hooks available.
add_frontend_test_jar_to_classpath()
FAILING_HOOK = "org.apache.impala.testutil.AlwaysErrorQueryEventHook"
NONEXIST_HOOK = "captain.hook"