This is an automated email from the ASF dual-hosted git repository.

dbecker pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit c8253cee9175219ab04ceff1400b701ec4c368e8
Author: Riza Suminto <[email protected]>
AuthorDate: Thu Aug 8 10:32:16 2024 -0700

    IMPALA-13280: Speed up test_under_statement_expression_limit
    
    This test spent over 7 minutes doing constant folding in Frontend
    Planner and over 20 minutes doing CodeGen in Coordinator Backend. It was
    holding resources from other concurrent test queries during exhaustive
    test run.
    
    This test was added by IMPALA-4551, which mainly test expression limit
    during query planning. This patch disable codegen and tweak the
    expression a bit to cut codegen and constant folding time.
    
    Testing:
    - Manually run test_under_statement_expression_limit in my local
      machine. After patch, the test can complete in around 4 seconds.
    
    Change-Id: If91b973fef95a89cc24a9172fdf24e2f11a19e6d
    Reviewed-on: http://gerrit.cloudera.org:8080/21652
    Reviewed-by: Michael Smith <[email protected]>
    Reviewed-by: Yida Wu <[email protected]>
    Tested-by: Impala Public Jenkins <[email protected]>
---
 tests/query_test/test_exprs.py | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/tests/query_test/test_exprs.py b/tests/query_test/test_exprs.py
index 9558fb172..572277fed 100644
--- a/tests/query_test/test_exprs.py
+++ b/tests/query_test/test_exprs.py
@@ -138,13 +138,14 @@ class TestExprLimits(ImpalaTestSuite):
   def test_under_statement_expression_limit(self):
     """Generate a huge case statement that barely fits within the statement 
expression
        limit and verify that it runs."""
-    # This takes 20+ minutes, so only run it on exhaustive.
-    # TODO: Determine whether this needs to run serially. It use >5 GB of 
memory.
+    # IMPALA-13280: Disable codegen because it will take 2GB+ of memory
+    # and over 30 minutes for doing codegen.
     if self.exploration_strategy() != 'exhaustive':
-      pytest.skip("Only test limit of codegen on exhaustive")
+      pytest.skip("Only test limit of expression on exhaustive")
     case = self.__gen_huge_case("int_col", 32, 2, "  ")
     query = "select {0} as huge_case from 
functional_parquet.alltypes".format(case)
-    self.__exec_query(query)
+    options = {'disable_codegen': True}
+    self.execute_query_expect_success(self.client, query, options)
 
   def test_max_statement_size(self):
     """Generate a huge case statement that exceeds the default 16MB limit and 
verify
@@ -187,7 +188,9 @@ class TestExprLimits(ImpalaTestSuite):
       divisor = randint(1, 10000000)
       mod = randint(0, divisor)
       # Generate a mathematical expr that can't be easily optimised out.
-      when_expr = "{0} + {1} % {2} = {3}".format(col_name, add, divisor, mod)
+      # IMPALA-13280: The parentheses in when_expr is needed to disable 
constant folding
+      # that can take over 7 minutes to complete by Planner.
+      when_expr = "({0} + {1}) % {2} = {3}".format(col_name, add, divisor, mod)
       if depth == 0:
         then_expr = "{0}".format(i)
       else:

Reply via email to