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

vjasani pushed a commit to branch 5.1
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/5.1 by this push:
     new 5bb22666ab PHOENIX-7497 ExplainPlanV2 regionserver location is not 
updated for less than max regions (#2050)
5bb22666ab is described below

commit 5bb22666ab6168e5ba56c9a2f927e22a03fc8a7f
Author: Viraj Jasani <[email protected]>
AuthorDate: Thu Jan 2 22:20:39 2025 -0800

    PHOENIX-7497 ExplainPlanV2 regionserver location is not updated for less 
than max regions (#2050)
---
 .../src/it/java/org/apache/phoenix/end2end/BaseAggregateIT.java     | 6 ++++++
 .../src/it/java/org/apache/phoenix/end2end/index/BaseIndexIT.java   | 6 ++++++
 .../src/main/java/org/apache/phoenix/iterate/ExplainTable.java      | 4 ++++
 3 files changed, 16 insertions(+)

diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseAggregateIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseAggregateIT.java
index 5b83e3900a..e1ad2bc93d 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseAggregateIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseAggregateIT.java
@@ -439,6 +439,8 @@ public abstract class BaseAggregateIT extends 
ParallelStatsDisabledIT {
             explainPlanAttributes.getServerWhereFilter());
         assertEquals("SERVER AGGREGATE INTO ORDERED DISTINCT ROWS BY [K1]",
             explainPlanAttributes.getServerAggregate());
+        assertFalse("Explain plan regionLocation attribute should not be 
empty",
+            explainPlanAttributes.getRegionLocations().isEmpty());
     }
     
     @Test
@@ -500,6 +502,8 @@ public abstract class BaseAggregateIT extends 
ParallelStatsDisabledIT {
             explainPlanAttributes.getServerWhereFilter());
         assertEquals("SERVER AGGREGATE INTO ORDERED DISTINCT ROWS BY [K1]",
             explainPlanAttributes.getServerAggregate());
+        assertFalse("Explain plan regionLocation attribute should not be 
empty",
+            explainPlanAttributes.getRegionLocations().isEmpty());
     }
 
     @Test
@@ -570,6 +574,8 @@ public abstract class BaseAggregateIT extends 
ParallelStatsDisabledIT {
         TestUtil.analyzeTable(conn, tableName);
         List<KeyRange> splits = TestUtil.getAllSplits(conn, tableName);
         assertEquals(nGuidePosts, splits.size());
+        assertFalse("Explain plan regionLocation attribute should not be 
empty",
+            explainPlanAttributes.getRegionLocations().isEmpty());
     }
     
     @Test
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/BaseIndexIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/BaseIndexIT.java
index ed946eabe4..41039e7278 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/BaseIndexIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/BaseIndexIT.java
@@ -171,6 +171,8 @@ public abstract class BaseIndexIT extends 
ParallelStatsDisabledIT {
                 assertEquals("FULL SCAN ",
                     explainPlanAttributes.getExplainScanType());
             }
+            assertFalse("Explain plan regionLocation attribute should not be 
empty",
+                explainPlanAttributes.getRegionLocations().isEmpty());
 
             ResultSet rs = conn.createStatement().executeQuery(query);
             assertTrue(rs.next());
@@ -588,6 +590,8 @@ public abstract class BaseIndexIT extends 
ParallelStatsDisabledIT {
                     explainPlanAttributes.getTableName());
                 assertNull(explainPlanAttributes.getClientSortAlgo());
             }
+            assertFalse("Explain plan regionLocation attribute should not be 
empty",
+                explainPlanAttributes.getRegionLocations().isEmpty());
 
             ResultSet rs = conn.createStatement().executeQuery(query);
             assertTrue(rs.next());
@@ -690,6 +694,8 @@ public abstract class BaseIndexIT extends 
ParallelStatsDisabledIT {
                     explainPlanAttributes.getTableName());
                 assertNull(explainPlanAttributes.getClientSortAlgo());
             }
+            assertFalse("Explain plan regionLocation attribute should not be 
empty",
+                explainPlanAttributes.getRegionLocations().isEmpty());
 
             rs = conn.createStatement().executeQuery(query);
             assertTrue(rs.next());
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/ExplainTable.java 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/ExplainTable.java
index 5da00365a5..1f42e125fb 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/iterate/ExplainTable.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/iterate/ExplainTable.java
@@ -363,6 +363,10 @@ public abstract class ExplainTable {
                 buf.append(originalSize);
             } else {
                 buf.append(regionLocations);
+                if (explainPlanAttributesBuilder != null) {
+                    explainPlanAttributesBuilder.setRegionLocations(
+                        Collections.unmodifiableList(regionLocations));
+                }
             }
             buf.append(") ");
             return buf.toString();

Reply via email to