phoenix git commit: PHOENIX-2206 Math function called with PK column ignores WHERE clause

2015-08-30 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 729a7525b - d38db555d


PHOENIX-2206 Math function called with PK column ignores WHERE clause


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

Branch: refs/heads/4.x-HBase-0.98
Commit: d38db555d25915367227b633d3adc5762a2050a8
Parents: 729a752
Author: James Taylor jtay...@salesforce.com
Authored: Sun Aug 30 18:21:14 2015 -0700
Committer: James Taylor jtay...@salesforce.com
Committed: Sun Aug 30 18:25:32 2015 -0700

--
 .../phoenix/end2end/ExpFunctionEnd2EndIT.java   | 24 
 .../apache/phoenix/compile/WhereOptimizer.java  | 15 
 .../phoenix/compile/WhereOptimizerTest.java | 11 +
 3 files changed, 35 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d38db555/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExpFunctionEnd2EndIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExpFunctionEnd2EndIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExpFunctionEnd2EndIT.java
index 8772400..a723c6b 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExpFunctionEnd2EndIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExpFunctionEnd2EndIT.java
@@ -18,6 +18,8 @@
 package org.apache.phoenix.end2end;
 
 import static org.apache.phoenix.util.TestUtil.closeStmtAndConn;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
 import java.sql.Connection;
@@ -125,4 +127,26 @@ public class ExpFunctionEnd2EndIT extends 
BaseHBaseManagedTimeIT {
 testUnsignedNumberSpec(conn, d);
 }
 }
+
+@Test
+public void testExpForLeadingPK() throws Exception {
+Connection conn = DriverManager.getConnection(getUrl());
+String ddl = create table test (id integer primary key);
+conn.createStatement().execute(ddl);
+String dml = upsert into test values (?);
+PreparedStatement stmt = conn.prepareStatement(dml);
+for (int i = 1; i = 5; i++) {
+stmt.setInt(1, i);
+stmt.execute();
+}
+conn.commit();
+
+ResultSet rs = conn.createStatement().executeQuery(select ID, exp(ID) 
from test where exp(ID)  10);
+assertTrue(rs.next());
+assertEquals(1, rs.getInt(1));
+assertTrue(rs.next());
+assertEquals(2, rs.getInt(1));
+assertFalse(rs.next());
+}
+
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/d38db555/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
index 1caec55..95cea83 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
@@ -829,17 +829,6 @@ public class WhereOptimizer {
 this.table = table;
 }
 
-//private boolean isFullyQualified(int pkSpan) {
-//int nPKColumns = table.getPKColumns().size();
-//return table.getBucketNum() == null ? pkSpan == nPKColumns : 
pkSpan == nPKColumns-1;
-//}
-@Override
-public KeySlots defaultReturn(Expression node, ListKeySlots l) {
-// Passes the CompositeKeyExpression up the tree
-return l.size() == 1 ? l.get(0) : null;
-}
-
-
 @Override
 public IteratorExpression visitEnter(CoerceExpression node) {
 return node.getChildren().iterator();
@@ -873,10 +862,6 @@ public class WhereOptimizer {
 public KeySlots visitLeave(OrExpression node, ListKeySlots l) {
 KeySlots keySlots = orKeySlots(node, l);
 if (keySlots == null) {
-// If we don't clear the child list, we end up passing some of
-// the child expressions of the OR up the tree, causing only
-// those expressions to form the scan start/stop key.
-l.clear();
 return null;
 }
 return keySlots;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/d38db555/phoenix-core/src/test/java/org/apache/phoenix/compile/WhereOptimizerTest.java
--
diff --git 

Apache-Phoenix | Master | Build Successful

2015-08-30 Thread Apache Jenkins Server
Master branch build status Successful
Source repository https://git-wip-us.apache.org/repos/asf?p=phoenix.git;a=shortlog;h=refs/heads/master

Last Successful Compiled Artifacts https://builds.apache.org/job/Phoenix-master/lastSuccessfulBuild/artifact/

Last Complete Test Report https://builds.apache.org/job/Phoenix-master/lastCompletedBuild/testReport/

Changes
[jtaylor] PHOENIX-2206 Math function called with PK column ignores WHERE clause



Build times for last couple of runsLatest build time is the right most | Legend blue: normal, red: test failure, gray: timeout


phoenix git commit: PHOENIX-2206 Math function called with PK column ignores WHERE clause

2015-08-30 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.0 a88051b4e - 2611a9c3c


PHOENIX-2206 Math function called with PK column ignores WHERE clause


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

Branch: refs/heads/4.x-HBase-1.0
Commit: 2611a9c3c52cad8c9e551bd131a121a3f71a63c1
Parents: a88051b
Author: James Taylor jtay...@salesforce.com
Authored: Sun Aug 30 18:21:14 2015 -0700
Committer: James Taylor jtay...@salesforce.com
Committed: Sun Aug 30 18:29:08 2015 -0700

--
 .../phoenix/end2end/ExpFunctionEnd2EndIT.java   | 24 
 .../apache/phoenix/compile/WhereOptimizer.java  | 15 
 .../phoenix/compile/WhereOptimizerTest.java | 11 +
 3 files changed, 35 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/2611a9c3/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExpFunctionEnd2EndIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExpFunctionEnd2EndIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExpFunctionEnd2EndIT.java
index 8772400..a723c6b 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExpFunctionEnd2EndIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExpFunctionEnd2EndIT.java
@@ -18,6 +18,8 @@
 package org.apache.phoenix.end2end;
 
 import static org.apache.phoenix.util.TestUtil.closeStmtAndConn;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
 import java.sql.Connection;
@@ -125,4 +127,26 @@ public class ExpFunctionEnd2EndIT extends 
BaseHBaseManagedTimeIT {
 testUnsignedNumberSpec(conn, d);
 }
 }
+
+@Test
+public void testExpForLeadingPK() throws Exception {
+Connection conn = DriverManager.getConnection(getUrl());
+String ddl = create table test (id integer primary key);
+conn.createStatement().execute(ddl);
+String dml = upsert into test values (?);
+PreparedStatement stmt = conn.prepareStatement(dml);
+for (int i = 1; i = 5; i++) {
+stmt.setInt(1, i);
+stmt.execute();
+}
+conn.commit();
+
+ResultSet rs = conn.createStatement().executeQuery(select ID, exp(ID) 
from test where exp(ID)  10);
+assertTrue(rs.next());
+assertEquals(1, rs.getInt(1));
+assertTrue(rs.next());
+assertEquals(2, rs.getInt(1));
+assertFalse(rs.next());
+}
+
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/2611a9c3/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
index 1caec55..95cea83 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
@@ -829,17 +829,6 @@ public class WhereOptimizer {
 this.table = table;
 }
 
-//private boolean isFullyQualified(int pkSpan) {
-//int nPKColumns = table.getPKColumns().size();
-//return table.getBucketNum() == null ? pkSpan == nPKColumns : 
pkSpan == nPKColumns-1;
-//}
-@Override
-public KeySlots defaultReturn(Expression node, ListKeySlots l) {
-// Passes the CompositeKeyExpression up the tree
-return l.size() == 1 ? l.get(0) : null;
-}
-
-
 @Override
 public IteratorExpression visitEnter(CoerceExpression node) {
 return node.getChildren().iterator();
@@ -873,10 +862,6 @@ public class WhereOptimizer {
 public KeySlots visitLeave(OrExpression node, ListKeySlots l) {
 KeySlots keySlots = orKeySlots(node, l);
 if (keySlots == null) {
-// If we don't clear the child list, we end up passing some of
-// the child expressions of the OR up the tree, causing only
-// those expressions to form the scan start/stop key.
-l.clear();
 return null;
 }
 return keySlots;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/2611a9c3/phoenix-core/src/test/java/org/apache/phoenix/compile/WhereOptimizerTest.java
--
diff --git 

phoenix git commit: PHOENIX-2206 Math function called with PK column ignores WHERE clause

2015-08-30 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.5-HBase-0.98 0f44f3cc6 - 45615304b


PHOENIX-2206 Math function called with PK column ignores WHERE clause


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

Branch: refs/heads/4.5-HBase-0.98
Commit: 45615304bd352bdd0c9f0b1851991787921994c6
Parents: 0f44f3c
Author: James Taylor jtay...@salesforce.com
Authored: Sun Aug 30 18:21:14 2015 -0700
Committer: James Taylor jtay...@salesforce.com
Committed: Sun Aug 30 18:34:28 2015 -0700

--
 .../phoenix/end2end/ExpFunctionEnd2EndIT.java   | 24 
 .../apache/phoenix/compile/WhereOptimizer.java  | 15 
 .../phoenix/compile/WhereOptimizerTest.java | 11 +
 3 files changed, 35 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/45615304/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExpFunctionEnd2EndIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExpFunctionEnd2EndIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExpFunctionEnd2EndIT.java
index 8772400..a723c6b 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExpFunctionEnd2EndIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExpFunctionEnd2EndIT.java
@@ -18,6 +18,8 @@
 package org.apache.phoenix.end2end;
 
 import static org.apache.phoenix.util.TestUtil.closeStmtAndConn;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
 import java.sql.Connection;
@@ -125,4 +127,26 @@ public class ExpFunctionEnd2EndIT extends 
BaseHBaseManagedTimeIT {
 testUnsignedNumberSpec(conn, d);
 }
 }
+
+@Test
+public void testExpForLeadingPK() throws Exception {
+Connection conn = DriverManager.getConnection(getUrl());
+String ddl = create table test (id integer primary key);
+conn.createStatement().execute(ddl);
+String dml = upsert into test values (?);
+PreparedStatement stmt = conn.prepareStatement(dml);
+for (int i = 1; i = 5; i++) {
+stmt.setInt(1, i);
+stmt.execute();
+}
+conn.commit();
+
+ResultSet rs = conn.createStatement().executeQuery(select ID, exp(ID) 
from test where exp(ID)  10);
+assertTrue(rs.next());
+assertEquals(1, rs.getInt(1));
+assertTrue(rs.next());
+assertEquals(2, rs.getInt(1));
+assertFalse(rs.next());
+}
+
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/45615304/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
index 01ec1bd..9dc7fb2 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
@@ -828,17 +828,6 @@ public class WhereOptimizer {
 this.table = table;
 }
 
-//private boolean isFullyQualified(int pkSpan) {
-//int nPKColumns = table.getPKColumns().size();
-//return table.getBucketNum() == null ? pkSpan == nPKColumns : 
pkSpan == nPKColumns-1;
-//}
-@Override
-public KeySlots defaultReturn(Expression node, ListKeySlots l) {
-// Passes the CompositeKeyExpression up the tree
-return l.size() == 1 ? l.get(0) : null;
-}
-
-
 @Override
 public IteratorExpression visitEnter(CoerceExpression node) {
 return node.getChildren().iterator();
@@ -872,10 +861,6 @@ public class WhereOptimizer {
 public KeySlots visitLeave(OrExpression node, ListKeySlots l) {
 KeySlots keySlots = orKeySlots(node, l);
 if (keySlots == null) {
-// If we don't clear the child list, we end up passing some of
-// the child expressions of the OR up the tree, causing only
-// those expressions to form the scan start/stop key.
-l.clear();
 return null;
 }
 return keySlots;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/45615304/phoenix-core/src/test/java/org/apache/phoenix/compile/WhereOptimizerTest.java
--
diff --git 

Apache-Phoenix | 4.5-HBase-0.98 | Build Successful

2015-08-30 Thread Apache Jenkins Server
4.5-HBase-0.98 branch build status Successful

Source repository https://git-wip-us.apache.org/repos/asf?p=phoenix.git;a=shortlog;h=refs/heads/4.5-HBase-0.98

Compiled Artifacts https://builds.apache.org/job/Phoenix-4.5-HBase-0.98/lastSuccessfulBuild/artifact/

Test Report https://builds.apache.org/job/Phoenix-4.5-HBase-0.98/lastCompletedBuild/testReport/

Changes
[jtaylor] PHOENIX-2206 Math function called with PK column ignores WHERE clause



Build times for last couple of runsLatest build time is the right most | Legend blue: normal, red: test failure, gray: timeout


Apache-Phoenix | 4.5-HBase-1.1 | Build Successful

2015-08-30 Thread Apache Jenkins Server
4.5-HBase-1.1 branch build status Successful

Source repository https://git-wip-us.apache.org/repos/asf?p=phoenix.git;a=shortlog;h=refs/heads/4.5-HBase-1.1

Compiled Artifacts https://builds.apache.org/job/Phoenix-4.5-HBase-1.1/lastSuccessfulBuild/artifact/

Test Report https://builds.apache.org/job/Phoenix-4.5-HBase-1.1/lastCompletedBuild/testReport/

Changes
[jtaylor] PHOENIX-2206 Math function called with PK column ignores WHERE clause



Build times for last couple of runsLatest build time is the right most | Legend blue: normal, red: test failure, gray: timeout


phoenix git commit: PHOENIX-2206 Math function called with PK column ignores WHERE clause

2015-08-30 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.5-HBase-1.0 7d1685045 - 7bc632b33


PHOENIX-2206 Math function called with PK column ignores WHERE clause


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

Branch: refs/heads/4.5-HBase-1.0
Commit: 7bc632b33e2f5820c42c7ff5089d6179af45d421
Parents: 7d16850
Author: James Taylor jtay...@salesforce.com
Authored: Sun Aug 30 18:21:14 2015 -0700
Committer: James Taylor jtay...@salesforce.com
Committed: Sun Aug 30 18:38:42 2015 -0700

--
 .../phoenix/end2end/ExpFunctionEnd2EndIT.java   | 24 
 .../apache/phoenix/compile/WhereOptimizer.java  | 15 
 .../phoenix/compile/WhereOptimizerTest.java | 11 +
 3 files changed, 35 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/7bc632b3/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExpFunctionEnd2EndIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExpFunctionEnd2EndIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExpFunctionEnd2EndIT.java
index 8772400..a723c6b 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExpFunctionEnd2EndIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ExpFunctionEnd2EndIT.java
@@ -18,6 +18,8 @@
 package org.apache.phoenix.end2end;
 
 import static org.apache.phoenix.util.TestUtil.closeStmtAndConn;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
 import java.sql.Connection;
@@ -125,4 +127,26 @@ public class ExpFunctionEnd2EndIT extends 
BaseHBaseManagedTimeIT {
 testUnsignedNumberSpec(conn, d);
 }
 }
+
+@Test
+public void testExpForLeadingPK() throws Exception {
+Connection conn = DriverManager.getConnection(getUrl());
+String ddl = create table test (id integer primary key);
+conn.createStatement().execute(ddl);
+String dml = upsert into test values (?);
+PreparedStatement stmt = conn.prepareStatement(dml);
+for (int i = 1; i = 5; i++) {
+stmt.setInt(1, i);
+stmt.execute();
+}
+conn.commit();
+
+ResultSet rs = conn.createStatement().executeQuery(select ID, exp(ID) 
from test where exp(ID)  10);
+assertTrue(rs.next());
+assertEquals(1, rs.getInt(1));
+assertTrue(rs.next());
+assertEquals(2, rs.getInt(1));
+assertFalse(rs.next());
+}
+
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/7bc632b3/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
index 01ec1bd..9dc7fb2 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
@@ -828,17 +828,6 @@ public class WhereOptimizer {
 this.table = table;
 }
 
-//private boolean isFullyQualified(int pkSpan) {
-//int nPKColumns = table.getPKColumns().size();
-//return table.getBucketNum() == null ? pkSpan == nPKColumns : 
pkSpan == nPKColumns-1;
-//}
-@Override
-public KeySlots defaultReturn(Expression node, ListKeySlots l) {
-// Passes the CompositeKeyExpression up the tree
-return l.size() == 1 ? l.get(0) : null;
-}
-
-
 @Override
 public IteratorExpression visitEnter(CoerceExpression node) {
 return node.getChildren().iterator();
@@ -872,10 +861,6 @@ public class WhereOptimizer {
 public KeySlots visitLeave(OrExpression node, ListKeySlots l) {
 KeySlots keySlots = orKeySlots(node, l);
 if (keySlots == null) {
-// If we don't clear the child list, we end up passing some of
-// the child expressions of the OR up the tree, causing only
-// those expressions to form the scan start/stop key.
-l.clear();
 return null;
 }
 return keySlots;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/7bc632b3/phoenix-core/src/test/java/org/apache/phoenix/compile/WhereOptimizerTest.java
--
diff --git 

Apache-Phoenix | 4.x-HBase-1.0 | Build Successful

2015-08-30 Thread Apache Jenkins Server
4.x-HBase-1.0 branch build status Successful

Source repository https://git-wip-us.apache.org/repos/asf?p=phoenix.git;a=shortlog;h=refs/heads/4.x-HBase-1.0

Compiled Artifacts https://builds.apache.org/job/Phoenix-4.x-HBase-1.0/lastSuccessfulBuild/artifact/

Test Report https://builds.apache.org/job/Phoenix-4.x-HBase-1.0/lastCompletedBuild/testReport/

Changes
[jtaylor] PHOENIX-2206 Math function called with PK column ignores WHERE clause



Build times for last couple of runsLatest build time is the right most | Legend blue: normal, red: test failure, gray: timeout