IMPALA-8931: Fix fe trigger for lineage events

Currently, fe generates lineage objects only when --lineage_event_log_dir
is configured. This is a legacy startup param. Lineages should also be
generated when event hooks are configured since they can potentially
consume them.

Added a test that confirms that the hook is invoked when a lineage is
created.

Change-Id: I2d8deb05883cc3ecab27fe4afd031a1e7ccb0829
Reviewed-on: http://gerrit.cloudera.org:8080/14194
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:
Bharath Vissapragada
2019-09-07 15:46:15 -07:00
committed by Impala Public Jenkins
parent fe54ebdc90
commit 4327cc3513
2 changed files with 13 additions and 4 deletions

View File

@@ -35,7 +35,7 @@ class TestHooks(CustomClusterTestSuite):
@CustomClusterTestSuite.with_args(
impala_log_dir=tempfile.mkdtemp(prefix="test_hooks_", dir=os.getenv("LOG_DIR")),
impalad_args="--query_event_hook_classes={0} "
"--minidump_path={1} "
"--minidump_path={1} -logbuflevel=-1"
.format(DUMMY_HOOK, MINIDUMP_PATH),
catalogd_args="--minidump_path={0}".format(MINIDUMP_PATH))
def test_query_event_hooks_execute(self, unique_database):
@@ -45,8 +45,13 @@ class TestHooks(CustomClusterTestSuite):
"""
# Dummy hook should log something (See org.apache.impala.testutil.DummyQueryEventHook)
self.assert_impalad_log_contains("INFO",
"{0}.onImpalaStartup".format(self.DUMMY_HOOK),
expected_count=-1)
"{0}.onImpalaStartup".format(self.DUMMY_HOOK), expected_count=-1)
# Run a test query that triggers a lineage event.
self.execute_query_expect_success(
self.client, "select count(*) from functional.alltypes")
# onQueryComplete() is invoked by the lineage logger.
self.assert_impalad_log_contains("INFO",
"{0}.onQueryComplete".format(self.DUMMY_HOOK), expected_count=-1)
class TestHooksStartupFail(CustomClusterTestSuite):