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

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


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

commit 91cae2577ca2c1e473995f6b541e1a277628e5b0
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/main/java/org/apache/phoenix/iterate/ExplainTable.java      | 4 ++++
 .../src/it/java/org/apache/phoenix/end2end/BaseAggregateIT.java     | 6 ++++++
 .../src/it/java/org/apache/phoenix/end2end/index/BaseIndexIT.java   | 6 ++++++
 3 files changed, 16 insertions(+)

diff --git 
a/phoenix-core-client/src/main/java/org/apache/phoenix/iterate/ExplainTable.java
 
b/phoenix-core-client/src/main/java/org/apache/phoenix/iterate/ExplainTable.java
index 2cb6cd4b02..851075d973 100644
--- 
a/phoenix-core-client/src/main/java/org/apache/phoenix/iterate/ExplainTable.java
+++ 
b/phoenix-core-client/src/main/java/org/apache/phoenix/iterate/ExplainTable.java
@@ -378,6 +378,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();
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 f612579187..841f2fc4b0 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
@@ -440,6 +440,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
@@ -501,6 +503,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
@@ -572,6 +576,8 @@ public abstract class BaseAggregateIT extends 
ParallelStatsDisabledIT {
         List<KeyRange> splits = TestUtil.getAllSplits(conn, tableName);
         // nGuideposts when stats are enabled, 4 when disabled
         assertEquals(4, 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 429dfbc159..bbfe45580c 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
@@ -184,6 +184,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());
@@ -613,6 +615,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());
@@ -720,6 +724,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());

Reply via email to