This is an automated email from the ASF dual-hosted git repository.
vjasani pushed a commit to branch 5.2
in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/5.2 by this push:
new f8c7d9cddf PHOENIX-7497 ExplainPlanV2 regionserver location is not
updated for less than max regions (#2050)
f8c7d9cddf is described below
commit f8c7d9cddf61270b48a74e4ade13e5e12279bc95
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 6be33aa920..3b017524bb 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
@@ -374,6 +374,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());