Test to validate that explain plans and runtime profiles contain information about any custom UDFs used in an Impala query.
(self, unique_database)
| 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.""" |
nothing calls this directly
no test coverage detected