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/d1e82d19
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/d1e82d19
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/d1e82d19

Branch: refs/heads/4.x-cdh5.15
Commit: d1e82d19e4a16533372b70c7e20e0408859c100b
Parents: 8119508
Author: James Taylor <jamestay...@apache.org>
Authored: Thu Jul 12 06:01:14 2018 +0100
Committer: Pedro Boado <pbo...@apache.org>
Committed: Wed Oct 17 21:26:23 2018 +0100

----------------------------------------------------------------------
 .../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/d1e82d19/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