PHOENIX-4790 Addendum to check that query is a point lookup for delete not to 
run query


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/28832267
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/28832267
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/28832267

Branch: refs/heads/4.x-HBase-1.4
Commit: 288322678de7e443f959f55eaab946716ca517d8
Parents: aee568b
Author: James Taylor <jamestay...@apache.org>
Authored: Wed Jul 11 22:01:14 2018 -0700
Committer: James Taylor <jamestay...@apache.org>
Committed: Wed Jul 11 22:01:14 2018 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/phoenix/compile/DeleteCompiler.java  | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/28832267/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java
index 78b2db9..a214c24 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java
@@ -541,6 +541,9 @@ public class DeleteCompiler {
         Iterator<QueryPlan> iterator = queryPlans.iterator();
         while (iterator.hasNext()) {
             QueryPlan plan = iterator.next();
+            // Must be a point lookup in order to not run a query since
+            // we have to have the full key be enumerated.
+            noQueryReqd &= plan.getContext().getScanRanges().isPointLookup();
             if (plan.getTableRef().getTable().getIndexType() == 
IndexType.LOCAL) {
                 if (!plan.getContext().getDataColumns().isEmpty()) {
                     iterator.remove();

Reply via email to