This is an automated email from the ASF dual-hosted git repository.
larsh pushed a commit to branch 4.x-HBase-1.4
in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/4.x-HBase-1.4 by this push:
new 7c9144d PHOENIX-5116 DistinctPrefixFilterIT fails.
7c9144d is described below
commit 7c9144d2dd538ab778be18f6171794a3ab98b248
Author: Lars Hofhansl <[email protected]>
AuthorDate: Thu Jan 31 09:45:24 2019 -0800
PHOENIX-5116 DistinctPrefixFilterIT fails.
---
.../src/main/java/org/apache/phoenix/compile/ScanRanges.java | 9 ++++++++-
.../main/java/org/apache/phoenix/optimize/QueryOptimizer.java | 4 ++--
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git
a/phoenix-core/src/main/java/org/apache/phoenix/compile/ScanRanges.java
b/phoenix-core/src/main/java/org/apache/phoenix/compile/ScanRanges.java
index 1732fce..2a7dbb4 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/ScanRanges.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/ScanRanges.java
@@ -535,7 +535,14 @@ public class ScanRanges {
public boolean isPointLookup() {
return isPointLookup;
}
-
+
+ /**
+ * @return true if this range is salted - i.e. has a salt range
+ */
+ public boolean isSalted() {
+ return isSalted;
+ }
+
public int getPointLookupCount() {
return getPointLookupCount(isPointLookup, ranges);
}
diff --git
a/phoenix-core/src/main/java/org/apache/phoenix/optimize/QueryOptimizer.java
b/phoenix-core/src/main/java/org/apache/phoenix/optimize/QueryOptimizer.java
index d81ded2..43a5950 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/optimize/QueryOptimizer.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/optimize/QueryOptimizer.java
@@ -516,8 +516,8 @@ public class QueryOptimizer {
boundCount2 += table2.getViewIndexId() == null ? 0 :
(boundRanges - 1);
// Adjust for salting. Salting adds a bound range for each
salt bucket.
// (but the sum of buckets cover the entire table)
- boundCount1 -= table1.getBucketNum() == null ? 0 : 1;
- boundCount2 -= table2.getBucketNum() == null ? 0 : 1;
+ boundCount1 -= plan1.getContext().getScanRanges().isSalted() ?
1 : 0;
+ boundCount2 -= plan2.getContext().getScanRanges().isSalted() ?
1 : 0;
int c = boundCount2 - boundCount1;
if (c != 0) return c;
if (plan1.getGroupBy() != null && plan2.getGroupBy() != null) {