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

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

commit 7373ee27d43fe9ce7d89691764b388db7ecf05ac
Author: Riza Suminto <[email protected]>
AuthorDate: Sat Feb 15 18:53:22 2025 -0800

    IMPALA-13752: Remove option value quoting in __restore_query_options
    
    Second run of test_parquet_late_materialization with codegen enabled
    failed because ENABLED_RUNTIME_FILTER_TYPES option failed to restored
    back to its default value, "BLOOM,MINMAX".
    
    The root cause is the new collect_default_query_options() function in
    impala_connection.py, added by IMPALA-13694. It will automatically wrap
    list values in double quote. Consequently,
    ImpalaTestSuite.__restore_query_options() does not need to wrap option
    value with another single quote.
    
    This patch also fix missing handling of optional query option without
    any default value.
    
    Testing:
    Run the test with this command:
    impala-py.test --exploration=exhaustive \
      -k test_parquet_late_materialization \
      query_test/test_parquet_late_materialization.py
    
    Change-Id: I004ca021f64ffcc0c3d4cb2bb4aa550012b1be20
    Reviewed-on: http://gerrit.cloudera.org:8080/22488
    Reviewed-by: Impala Public Jenkins <[email protected]>
    Tested-by: Impala Public Jenkins <[email protected]>
---
 tests/common/impala_connection.py | 3 +++
 tests/common/impala_test_suite.py | 7 ++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/tests/common/impala_connection.py 
b/tests/common/impala_connection.py
index 41f4b48f8..4b643573c 100644
--- a/tests/common/impala_connection.py
+++ b/tests/common/impala_connection.py
@@ -75,6 +75,9 @@ def collect_default_query_options(options, name, val, kind):
   if ',' in val:
     # Value is a list. Wrap it with double quote.
     val = '"{}"'.format(val)
+  if not val:
+    # Value is optional with None as default.
+    val = '""'
   options[name] = val
 
 
diff --git a/tests/common/impala_test_suite.py 
b/tests/common/impala_test_suite.py
index 5dfc97aa1..7c5495f4f 100644
--- a/tests/common/impala_test_suite.py
+++ b/tests/common/impala_test_suite.py
@@ -533,7 +533,12 @@ class ImpalaTestSuite(BaseTestSuite):
       if query_option not in self.default_query_options:
         continue
       default_val = self.default_query_options[query_option]
-      query_str = 'SET ' + query_option + '="' + default_val + '"'
+      # No need to quote default_val because get_default_configuration() 
returns
+      # map values that already contain double quote if needed
+      # (see collect_default_query_options() in impala_connection.py).
+      # The "restore option" comment is there to differentiate between SET 
issued
+      # by test method and SET issued by this method.
+      query_str = "SET {0}={1}; -- restore option".format(query_option, 
default_val)
       try:
         impalad_client.execute(query_str)
       except Exception as e:

Reply via email to