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

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


The following commit(s) were added to refs/heads/master by this push:
     new 9220b9699 IMPALA-14710: Fixed flaky test in TestReduceExprShuttle
9220b9699 is described below

commit 9220b9699fabbcf06b134a023807ce328e43a2ea
Author: Steve Carlin <[email protected]>
AuthorDate: Thu Jan 29 10:53:35 2026 -0800

    IMPALA-14710: Fixed flaky test in TestReduceExprShuttle
    
    The charset system property is being set in CalciteCompilerFactory.
    It seems that if this test is run via
    
    mvn clean install test
    
    ...it runs fine, but if it is called via
    
    mvn clean install -Dtest=TestReduceExprShuttle#testFoldConcatString
    
    ... the static initializer isn't called.
    
    This could either be fixed by importing CalciteCompilerFactory or
    explicitly setting the static initializer in this class. The latter
    was chosen because it would be awkward to have a java class only
    imported due to a static initializer.  However, the downside is that
    this is duplicate code.
    
    Change-Id: Iecb124f43bd7090411bdf1bb8203c15d75158154
    Reviewed-on: http://gerrit.cloudera.org:8080/23919
    Reviewed-by: Joe McDonnell <[email protected]>
    Reviewed-by: Michael Smith <[email protected]>
    Tested-by: Michael Smith <[email protected]>
---
 .../test/java/org/apache/impala/planner/TestReduceExprShuttle.java | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git 
a/java/calcite-planner/src/test/java/org/apache/impala/planner/TestReduceExprShuttle.java
 
b/java/calcite-planner/src/test/java/org/apache/impala/planner/TestReduceExprShuttle.java
index 5b09a19c5..a60eb40f5 100644
--- 
a/java/calcite-planner/src/test/java/org/apache/impala/planner/TestReduceExprShuttle.java
+++ 
b/java/calcite-planner/src/test/java/org/apache/impala/planner/TestReduceExprShuttle.java
@@ -63,6 +63,13 @@ import com.google.common.collect.ImmutableMap;
 import static org.junit.Assert.*;
 
 public class TestReduceExprShuttle extends PlannerTestBase {
+
+  // This code is duplicated in CalciteCompilerFactory, but it is needed
+  // here because that class is not imported in this test.
+  static {
+    System.setProperty("calcite.default.charset", "UTF8");
+  }
+
   // Query option to run each planner test.
   private static TQueryOptions options =
       tpcdsParquetQueryOptions();

Reply via email to