MCPcopy Create free account
hub / github.com/apache/impala / test_udf_profile

Method test_udf_profile

tests/query_test/test_udfs.py:636–651  ·  view source on GitHub ↗

Test to validate that explain plans and runtime profiles contain information about any custom UDFs used in an Impala query.

(self, unique_database)

Source from the content-addressed store, hash-verified

634 assert len(results.data) == 9999
635
636 def test_udf_profile(self, unique_database):
637 """Test to validate that explain plans and runtime profiles contain information about
638 any custom UDFs used in an Impala query."""
639 self.client.execute(
640 "create function {0}.hive_substring(string, int) returns string location '{1}' "
641 "symbol='org.apache.hadoop.hive.ql.udf.UDFSubstr'".format(
642 unique_database, get_fs_path('/test-warehouse/hive-exec.jar')))
643 profile = self.execute_query_expect_success(self.client,
644 "select {0}.hive_substring(string_col, 1), {0}.hive_substring(string_col, 2) "
645 "from functional.alltypes limit 10".format(unique_database)).runtime_profile
646
647 assert re.search(r"output exprs.*hive_substring.*/\* JAVA UDF \*/", profile)
648 # Ensure that hive_substring only shows up once in the list of UDFs.
649 assert re.search(
650 r"User Defined Functions \(UDFs\): {0}\.hive_substring\s*[\r\n]".format(
651 unique_database), profile)
652
653 def test_set_fallback_db_for_functions(self, unique_database):
654 """IMPALA-11728: Set fallback database for functions."""

Callers

nothing calls this directly

Calls 5

get_fs_pathFunction · 0.90
executeMethod · 0.45
formatMethod · 0.45
searchMethod · 0.45

Tested by

no test coverage detected