Build failed in Jenkins: Phoenix | Master | Hadoop1 #271

2014-07-14 Thread Apache Jenkins Server
See 

Changes:

[ramkrishna] PHOENIX-933 Local index support to Phoenix (Ram)

--
[...truncated 6525 lines...]
955/1387 KB   
959/1387 KB   
963/1387 KB   
967/1387 KB   
971/1387 KB   
975/1387 KB   
979/1387 KB   
983/1387 KB   
987/1387 KB   
991/1387 KB   
995/1387 KB   
999/1387 KB   
1003/1387 KB   
1007/1387 KB   
1011/1387 KB   
1015/1387 KB   
1019/1387 KB   
1023/1387 KB   
1027/1387 KB   
1031/1387 KB   
1035/1387 KB   
1038/1387 KB   
   
Downloaded: 
http://repo.maven.apache.org/maven2/org/mortbay/jetty/jsp-api-2.1/6.1.14/jsp-api-2.1-6.1.14.jar
 (0 B at 0.0 KB/sec)
1042/1387 KB   
1046/1387 KB   
1050/1387 KB   
1054/1387 KB   
1058/1387 KB   
1062/1387 KB   
1066/1387 KB   
1070/1387 KB   
1074/1387 KB   
1078/1387 KB   
1082/1387 KB   
1086/1387 KB   
1090/1387 KB   
1094/1387 KB   
1098/1387 KB   
1102/1387 KB   
1106/1387 KB   
1110/1387 KB   
1114/1387 KB   
1118/1387 KB   
1122/1387 KB   
1126/1387 KB   
1130/1387 KB   
1134/1387 KB   
1138/1387 KB   
1142/1387 KB   
1146/1387 KB   
1150/1387 KB   
1154/1387 KB   
1158/1387 KB   
1162/1387 KB   
1166/1387 KB   
1170/1387 KB   
1174/1387 KB   
1178/1387 KB   
1182/1387 KB   
1186/1387 KB   
1190/1387 KB   
1194/1387 KB   
1198/1387 KB   
1202/1387 KB   
1206/1387 KB   
1208/1387 KB   
   
Downloaded: 
http://repo.maven.apache.org/maven2/commons-el/commons-el/1.0/commons-el-1.0.jar
 (0 B at 0.0 KB/sec)
1212/1387 KB   
1216/1387 KB   
1216/1387 KB   
1220/1387 KB   
1224/1387 KB   
1228/1387 KB   
1232/1387 KB   
1235/1387 KB   
1239/1387 KB   
1243/1387 KB   
1247/1387 KB   
1251/1387 KB   
1255/1387 KB   
1259/1387 KB   
1260/1387 KB   
1261/1387 KB   
1265/1387 KB   
1269/1387 KB   
1273/1387 KB   
1277/1387 KB   
1281/1387 KB   
1285/1387 KB   
1289/1387 KB   
1293/1387 KB   
1297/1387 KB   
1301/1387 KB   
1305/1387 KB   
1309/1387 KB   
1313/1387 KB   
1317/1387 KB   
1321/1387 KB   
1325/1387 KB   
1329/1387 KB   
1333/1387 KB   
1337/1387 KB   
1341/1387 KB   
1345/1387 KB   
1349/1387 KB   
1353/1387 KB   
1357/1387 KB   
1361/1387 KB   
1365/1387 KB   
1369/1387 KB   
1373/1387 KB   
1377/1387 KB   
1381/1387 KB   
1385/1387 KB   
1387/1387 KB   
   
Downloaded: 
http://repo.maven.apache.org/maven2/org/mockito/mockito-all/1.8.5/mockito-all-1.8.5.jar
 (1387 KB at 2176.8 KB/sec)
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ phoenix-core ---
[INFO] 
[INFO] --- build-helper-maven-plugin:1.7:add-test-source (add-test-source) @ 
phoenix-core ---
[INFO] Test Source directory: 

 added.
[INFO] 
[INFO] --- build-helper-maven-plugin:1.7:add-test-resource (add-test-resource) 
@ phoenix-core ---
[INFO] 
[INFO] --- build-helper-maven-plugin:1.7:add-source (add-source) @ phoenix-core 
---
[INFO] Source directory: 

 added.
[INFO] Source directory: 

 added.
[INFO] 
[INFO] --- antlr3-maven-plugin:3.5:antlr (default) @ phoenix-core ---
[INFO] ANTLR: Processing source directory 

ANTLR Parser Generator  Version 3.5
Output file 

 does not exist: must build 

PhoenixSQL.g
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.5:process (default) @ phoenix-core 
---
Downloading: 
https://repository.apache.org/content/repositories/releases/xmlenc/xmlenc/0.52/xmlenc-0.52.pom
   
Downloading: http://conjars.org/repo/xmlenc/xmlenc/0.52/xmlenc-0.52.pom
   
Downloading: 
https://repository.apache.org/content/repositories/snapshots/xmlenc/xmlenc/0.52/xmlenc-0.52.pom
   
Downloading: 
http://repo.maven.apache.org/maven2/xmlenc/xmlenc/0.52/xmlenc-0.52.pom
   
Downloaded: 
http://repo.maven.apache.org/maven2/xmlenc/xmlenc/0.52/xmlenc-0.52.pom (0 B at 
0.0 KB/sec)
Downloading: 
https://repository.apache.org/content/repositories/releases/org/mortbay/jetty/jetty/6.1.26/jetty-6.1.26.pom
   
Downloading: 
http://conjars.org/repo/org/mortbay/jetty/jetty/6.1.26/jetty-6.1.26.pom
   
Downloading: 
https://repository.apache.org/content/repositories/snapshots/org/mortbay/jetty/jetty/6.1.26/jetty-6.1.26.pom
   
Downloading: 
http://repo.maven.apache.org/maven2/org/mortbay/jetty/jetty/6.1.26/jetty-6.1.26.pom
   
Downloading: 
https://repository.apache.org/content/repositories/releases/org/mortbay/jetty/jsp-api-2.1/6.1.14/jsp-api-2

Apache-Phoenix | 4.0 | Hadoop1 | Build Successful

2014-07-14 Thread Apache Jenkins Server
4.0 branch build status Successful

Source repository https://git-wip-us.apache.org/repos/asf/incubator-phoenix.git

Compiled Artifacts https://builds.apache.org/job/Phoenix-4.0-hadoop1/lastSuccessfulBuild/artifact/

Test Report https://builds.apache.org/job/Phoenix-4.0-hadoop1/lastCompletedBuild/testReport/

Changes
[anoopsamjohn] PHOENIX-1002 Add support for % operator.(Kyle Buzsaki)



Apache-Phoenix | 3.0 | Hadoop1 | Build Successful

2014-07-14 Thread Apache Jenkins Server
3.0 branch build status Successful
Source repository https://git-wip-us.apache.org/repos/asf/phoenix.git

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

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

Changes
[anoopsamjohn] PHOENIX-1002 Add support for % operator.(Kyle Buzsaki)



Build failed in Jenkins: Phoenix | Master | Hadoop1 #270

2014-07-14 Thread Apache Jenkins Server
See 

Changes:

[anoopsamjohn] PHOENIX-1002 Add support for % operator.(Kyle Buzsaki)

--
[...truncated 7307 lines...]
at java.lang.Thread.run(Thread.java:724)
Caused by: org.apache.hadoop.hbase.ipc.RemoteWithExtrasException: 
org.apache.hadoop.hbase.DoNotRetryIOException: ATABLE: Didn't find expected key 
values for table row in metadata row
at 
org.apache.phoenix.util.ServerUtil.createIOException(ServerUtil.java:77)
at 
org.apache.phoenix.coprocessor.MetaDataEndpointImpl.getTable(MetaDataEndpointImpl.java:342)
at 
org.apache.phoenix.coprocessor.generated.MetaDataProtos$MetaDataService.callMethod(MetaDataProtos.java:6555)
at 
org.apache.hadoop.hbase.regionserver.HRegion.execService(HRegion.java:5493)
at 
org.apache.hadoop.hbase.regionserver.HRegionServer.execServiceOnRegion(HRegionServer.java:3300)
at 
org.apache.hadoop.hbase.regionserver.HRegionServer.execService(HRegionServer.java:3282)
at 
org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$2.callBlockingMethod(ClientProtos.java:29501)
at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2012)
at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:98)
at 
org.apache.hadoop.hbase.ipc.SimpleRpcScheduler.consumerLoop(SimpleRpcScheduler.java:160)
at 
org.apache.hadoop.hbase.ipc.SimpleRpcScheduler.access$000(SimpleRpcScheduler.java:38)
at 
org.apache.hadoop.hbase.ipc.SimpleRpcScheduler$1.run(SimpleRpcScheduler.java:110)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.IllegalStateException: Didn't find expected key values for 
table row in metadata row
at 
org.apache.phoenix.coprocessor.MetaDataEndpointImpl.getTable(MetaDataEndpointImpl.java:579)
at 
org.apache.phoenix.coprocessor.MetaDataEndpointImpl.buildTable(MetaDataEndpointImpl.java:415)
at 
org.apache.phoenix.coprocessor.MetaDataEndpointImpl.doGetTable(MetaDataEndpointImpl.java:394)
at 
org.apache.phoenix.coprocessor.MetaDataEndpointImpl.getTable(MetaDataEndpointImpl.java:326)
... 11 more

at org.apache.hadoop.hbase.ipc.RpcClient.call(RpcClient.java:1450)
at 
org.apache.hadoop.hbase.ipc.RpcClient.callBlockingMethod(RpcClient.java:1654)
at 
org.apache.hadoop.hbase.ipc.RpcClient$BlockingRpcChannelImplementation.callBlockingMethod(RpcClient.java:1712)
at 
org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$BlockingStub.execService(ClientProtos.java:29924)
at 
org.apache.hadoop.hbase.protobuf.ProtobufUtil.execService(ProtobufUtil.java:1508)
at 
org.apache.hadoop.hbase.ipc.RegionCoprocessorRpcChannel$1.call(RegionCoprocessorRpcChannel.java:87)
at 
org.apache.hadoop.hbase.ipc.RegionCoprocessorRpcChannel$1.call(RegionCoprocessorRpcChannel.java:84)
at 
org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithRetries(RpcRetryingCaller.java:114)
at 
org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithRetries(RpcRetryingCaller.java:90)
at 
org.apache.hadoop.hbase.ipc.RegionCoprocessorRpcChannel.callExecService(RegionCoprocessorRpcChannel.java:90)
at 
org.apache.hadoop.hbase.ipc.CoprocessorRpcChannel.callMethod(CoprocessorRpcChannel.java:51)
at 
org.apache.phoenix.coprocessor.generated.MetaDataProtos$MetaDataService$Stub.getTable(MetaDataProtos.java:6679)
at 
org.apache.phoenix.query.ConnectionQueryServicesImpl$5.call(ConnectionQueryServicesImpl.java:1142)
at 
org.apache.phoenix.query.ConnectionQueryServicesImpl$5.call(ConnectionQueryServicesImpl.java:1129)
at org.apache.hadoop.hbase.client.HTable$16.call(HTable.java:1527)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)

testExecuteStatements(org.apache.phoenix.end2end.ExecuteStatementsIT)  Time 
elapsed: 0.063 sec  <<< ERROR!
org.apache.phoenix.exception.PhoenixIOException: 
org.apache.hadoop.hbase.DoNotRetryIOException: ATABLE: Didn't find expected key 
values for table row in metadata row
at 
org.apache.phoenix.util.ServerUtil.parseServerException(ServerUtil.java:101)
at 
org.apache.phoenix.query.ConnectionQueryServicesImpl.metaDataCoprocessorExec(ConnectionQueryServicesImpl.java:983)
at 
org.apache.phoenix.query.ConnectionQueryServicesImpl.createTable(ConnectionQueryServicesImpl.java:1101)
at 
org.apache.phoenix.query.DelegateConnectionQueryServices.createTable(DelegateConnectionQueryServices.java:114)
at 
org.apache.phoenix.schema.MetaDataClient.createTabl

git commit: PHOENIX-1002 Add support for % operator.(Kyle Buzsaki)

2014-07-14 Thread anoopsamjohn
Repository: phoenix
Updated Branches:
  refs/heads/3.0 fd4a1a5d0 -> 641abacf2


PHOENIX-1002 Add support for % operator.(Kyle Buzsaki)


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

Branch: refs/heads/3.0
Commit: 641abacf2741001d491811cda32283968beea8ee
Parents: fd4a1a5
Author: anoopsjohn 
Authored: Mon Jul 14 23:26:46 2014 +0530
Committer: anoopsjohn 
Committed: Mon Jul 14 23:26:46 2014 +0530

--
 .../phoenix/end2end/ArithmeticQueryIT.java  |  92 +++
 .../phoenix/end2end/ModulusExpressionIT.java| 186 +
 phoenix-core/src/main/antlr3/PhoenixSQL.g   |  15 +-
 .../phoenix/compile/ExpressionCompiler.java | 275 ++-
 .../phoenix/expression/ExpressionType.java  |   5 +-
 .../phoenix/expression/ModulusExpression.java   |  99 +++
 .../apache/phoenix/parse/ModulusParseNode.java  |  47 
 .../apache/phoenix/parse/ParseNodeFactory.java  |   4 +
 .../apache/phoenix/parse/ParseNodeRewriter.java |  10 +
 .../apache/phoenix/parse/ParseNodeVisitor.java  |   4 +
 .../StatelessTraverseAllParseNodeVisitor.java   |   5 +
 .../parse/TraverseAllParseNodeVisitor.java  |   5 +
 .../parse/TraverseNoParseNodeVisitor.java   |  11 +
 .../parse/UnsupportedAllParseNodeVisitor.java   |  10 +
 14 files changed, 637 insertions(+), 131 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/641abacf/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArithmeticQueryIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArithmeticQueryIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArithmeticQueryIT.java
index 62a1639..33545a4 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArithmeticQueryIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArithmeticQueryIT.java
@@ -669,6 +669,29 @@ public class ArithmeticQueryIT extends 
BaseHBaseManagedTimeIT {
 }
 
 @Test
+public void testOrderOfOperationsAdditionModulus() throws Exception {
+Connection conn = DriverManager.getConnection(getUrl());
+initIntegerTable(conn);
+ResultSet rs;
+
+// 6 + 4 % 3
+// 6 + 1
+// 7
+rs = conn.createStatement().executeQuery("SELECT six + four % three 
FROM ARITHMETIC_TEST");
+assertTrue(rs.next());
+assertEquals(7, rs.getLong(1));
+assertFalse(rs.next());
+
+// 4 % 3 + 6
+// 1 + 6
+// 7
+rs = conn.createStatement().executeQuery("SELECT four % three + six 
FROM ARITHMETIC_TEST");
+assertTrue(rs.next());
+assertEquals(7, rs.getLong(1));
+assertFalse(rs.next());
+}
+
+@Test
 public void testOrderOfOperationsSubtrationMultiplication() throws 
Exception {
 Connection conn = DriverManager.getConnection(getUrl());
 initIntegerTable(conn);
@@ -715,6 +738,29 @@ public class ArithmeticQueryIT extends 
BaseHBaseManagedTimeIT {
 }
 
 @Test
+public void testOrderOfOperationsSubtractionModulus() throws Exception {
+Connection conn = DriverManager.getConnection(getUrl());
+initIntegerTable(conn);
+ResultSet rs;
+
+// 6 - 4 % 3
+// 6 - 1
+// 5
+rs = conn.createStatement().executeQuery("SELECT six - four % three 
FROM ARITHMETIC_TEST");
+assertTrue(rs.next());
+assertEquals(5, rs.getLong(1));
+assertFalse(rs.next());
+
+// 4 % 3 - 6
+// 1 - 6
+// -5
+rs = conn.createStatement().executeQuery("SELECT four % three - six 
FROM ARITHMETIC_TEST");
+assertTrue(rs.next());
+assertEquals(-5, rs.getLong(1));
+assertFalse(rs.next());
+}
+
+@Test
 public void testOrderOfOperationsMultiplicationDivision() throws Exception 
{
 Connection conn = DriverManager.getConnection(getUrl());
 initIntegerTable(conn);
@@ -736,4 +782,50 @@ public class ArithmeticQueryIT extends 
BaseHBaseManagedTimeIT {
 assertEquals(6, rs.getLong(1));
 assertFalse(rs.next());
 }
+
+@Test
+public void testOrderOfOperationsMultiplicationModulus() throws Exception {
+Connection conn = DriverManager.getConnection(getUrl());
+initIntegerTable(conn);
+ResultSet rs;
+
+// 6 * 4 % 3
+// 24 % 3
+// 0
+rs = conn.createStatement().executeQuery("SELECT six * four % three 
FROM ARITHMETIC_TEST");
+assertTrue(rs.next());
+assertEquals(0, rs.getLong(1));
+assertFalse(

git commit: PHOENIX-1002 Add support for % operator.(Kyle Buzsaki)

2014-07-14 Thread anoopsamjohn
Repository: phoenix
Updated Branches:
  refs/heads/4.0 22d6478b7 -> cbe800afe


PHOENIX-1002 Add support for % operator.(Kyle Buzsaki)


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

Branch: refs/heads/4.0
Commit: cbe800afe67287afabe95195c694bf37ba0250d9
Parents: 22d6478
Author: anoopsjohn 
Authored: Mon Jul 14 23:24:31 2014 +0530
Committer: anoopsjohn 
Committed: Mon Jul 14 23:24:31 2014 +0530

--
 .../phoenix/end2end/ArithmeticQueryIT.java  |  92 +++
 .../phoenix/end2end/ModulusExpressionIT.java| 186 +
 phoenix-core/src/main/antlr3/PhoenixSQL.g   |  15 +-
 .../phoenix/compile/ExpressionCompiler.java | 275 ++-
 .../phoenix/expression/ExpressionType.java  |   4 +-
 .../phoenix/expression/ModulusExpression.java   |  99 +++
 .../apache/phoenix/parse/ModulusParseNode.java  |  47 
 .../apache/phoenix/parse/ParseNodeFactory.java  |   4 +
 .../apache/phoenix/parse/ParseNodeRewriter.java |  10 +
 .../apache/phoenix/parse/ParseNodeVisitor.java  |   4 +
 .../StatelessTraverseAllParseNodeVisitor.java   |   5 +
 .../parse/TraverseAllParseNodeVisitor.java  |   5 +
 .../parse/TraverseNoParseNodeVisitor.java   |  11 +
 .../parse/UnsupportedAllParseNodeVisitor.java   |  10 +
 14 files changed, 637 insertions(+), 130 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/cbe800af/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArithmeticQueryIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArithmeticQueryIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArithmeticQueryIT.java
index 62a1639..33545a4 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArithmeticQueryIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArithmeticQueryIT.java
@@ -669,6 +669,29 @@ public class ArithmeticQueryIT extends 
BaseHBaseManagedTimeIT {
 }
 
 @Test
+public void testOrderOfOperationsAdditionModulus() throws Exception {
+Connection conn = DriverManager.getConnection(getUrl());
+initIntegerTable(conn);
+ResultSet rs;
+
+// 6 + 4 % 3
+// 6 + 1
+// 7
+rs = conn.createStatement().executeQuery("SELECT six + four % three 
FROM ARITHMETIC_TEST");
+assertTrue(rs.next());
+assertEquals(7, rs.getLong(1));
+assertFalse(rs.next());
+
+// 4 % 3 + 6
+// 1 + 6
+// 7
+rs = conn.createStatement().executeQuery("SELECT four % three + six 
FROM ARITHMETIC_TEST");
+assertTrue(rs.next());
+assertEquals(7, rs.getLong(1));
+assertFalse(rs.next());
+}
+
+@Test
 public void testOrderOfOperationsSubtrationMultiplication() throws 
Exception {
 Connection conn = DriverManager.getConnection(getUrl());
 initIntegerTable(conn);
@@ -715,6 +738,29 @@ public class ArithmeticQueryIT extends 
BaseHBaseManagedTimeIT {
 }
 
 @Test
+public void testOrderOfOperationsSubtractionModulus() throws Exception {
+Connection conn = DriverManager.getConnection(getUrl());
+initIntegerTable(conn);
+ResultSet rs;
+
+// 6 - 4 % 3
+// 6 - 1
+// 5
+rs = conn.createStatement().executeQuery("SELECT six - four % three 
FROM ARITHMETIC_TEST");
+assertTrue(rs.next());
+assertEquals(5, rs.getLong(1));
+assertFalse(rs.next());
+
+// 4 % 3 - 6
+// 1 - 6
+// -5
+rs = conn.createStatement().executeQuery("SELECT four % three - six 
FROM ARITHMETIC_TEST");
+assertTrue(rs.next());
+assertEquals(-5, rs.getLong(1));
+assertFalse(rs.next());
+}
+
+@Test
 public void testOrderOfOperationsMultiplicationDivision() throws Exception 
{
 Connection conn = DriverManager.getConnection(getUrl());
 initIntegerTable(conn);
@@ -736,4 +782,50 @@ public class ArithmeticQueryIT extends 
BaseHBaseManagedTimeIT {
 assertEquals(6, rs.getLong(1));
 assertFalse(rs.next());
 }
+
+@Test
+public void testOrderOfOperationsMultiplicationModulus() throws Exception {
+Connection conn = DriverManager.getConnection(getUrl());
+initIntegerTable(conn);
+ResultSet rs;
+
+// 6 * 4 % 3
+// 24 % 3
+// 0
+rs = conn.createStatement().executeQuery("SELECT six * four % three 
FROM ARITHMETIC_TEST");
+assertTrue(rs.next());
+assertEquals(0, rs.getLong(1));
+assertFalse(

git commit: PHOENIX-1002 Add support for % operator.(Kyle Buzsaki)

2014-07-14 Thread anoopsamjohn
Repository: phoenix
Updated Branches:
  refs/heads/master 7b3135260 -> b12ba69b3


PHOENIX-1002 Add support for % operator.(Kyle Buzsaki)


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

Branch: refs/heads/master
Commit: b12ba69b300c84a692584935640cd984e2501f9b
Parents: 7b31352
Author: anoopsjohn 
Authored: Mon Jul 14 23:12:39 2014 +0530
Committer: anoopsjohn 
Committed: Mon Jul 14 23:12:39 2014 +0530

--
 .../phoenix/end2end/ArithmeticQueryIT.java  |  92 +++
 .../phoenix/end2end/ModulusExpressionIT.java| 186 +
 phoenix-core/src/main/antlr3/PhoenixSQL.g   |  15 +-
 .../phoenix/compile/ExpressionCompiler.java | 275 ++-
 .../phoenix/expression/ExpressionType.java  |   4 +-
 .../phoenix/expression/ModulusExpression.java   |  99 +++
 .../apache/phoenix/parse/ModulusParseNode.java  |  47 
 .../apache/phoenix/parse/ParseNodeFactory.java  |   4 +
 .../apache/phoenix/parse/ParseNodeRewriter.java |  10 +
 .../apache/phoenix/parse/ParseNodeVisitor.java  |   4 +
 .../StatelessTraverseAllParseNodeVisitor.java   |   5 +
 .../parse/TraverseAllParseNodeVisitor.java  |   5 +
 .../parse/TraverseNoParseNodeVisitor.java   |  11 +
 .../parse/UnsupportedAllParseNodeVisitor.java   |  10 +
 14 files changed, 637 insertions(+), 130 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/b12ba69b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArithmeticQueryIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArithmeticQueryIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArithmeticQueryIT.java
index 62a1639..33545a4 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArithmeticQueryIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArithmeticQueryIT.java
@@ -669,6 +669,29 @@ public class ArithmeticQueryIT extends 
BaseHBaseManagedTimeIT {
 }
 
 @Test
+public void testOrderOfOperationsAdditionModulus() throws Exception {
+Connection conn = DriverManager.getConnection(getUrl());
+initIntegerTable(conn);
+ResultSet rs;
+
+// 6 + 4 % 3
+// 6 + 1
+// 7
+rs = conn.createStatement().executeQuery("SELECT six + four % three 
FROM ARITHMETIC_TEST");
+assertTrue(rs.next());
+assertEquals(7, rs.getLong(1));
+assertFalse(rs.next());
+
+// 4 % 3 + 6
+// 1 + 6
+// 7
+rs = conn.createStatement().executeQuery("SELECT four % three + six 
FROM ARITHMETIC_TEST");
+assertTrue(rs.next());
+assertEquals(7, rs.getLong(1));
+assertFalse(rs.next());
+}
+
+@Test
 public void testOrderOfOperationsSubtrationMultiplication() throws 
Exception {
 Connection conn = DriverManager.getConnection(getUrl());
 initIntegerTable(conn);
@@ -715,6 +738,29 @@ public class ArithmeticQueryIT extends 
BaseHBaseManagedTimeIT {
 }
 
 @Test
+public void testOrderOfOperationsSubtractionModulus() throws Exception {
+Connection conn = DriverManager.getConnection(getUrl());
+initIntegerTable(conn);
+ResultSet rs;
+
+// 6 - 4 % 3
+// 6 - 1
+// 5
+rs = conn.createStatement().executeQuery("SELECT six - four % three 
FROM ARITHMETIC_TEST");
+assertTrue(rs.next());
+assertEquals(5, rs.getLong(1));
+assertFalse(rs.next());
+
+// 4 % 3 - 6
+// 1 - 6
+// -5
+rs = conn.createStatement().executeQuery("SELECT four % three - six 
FROM ARITHMETIC_TEST");
+assertTrue(rs.next());
+assertEquals(-5, rs.getLong(1));
+assertFalse(rs.next());
+}
+
+@Test
 public void testOrderOfOperationsMultiplicationDivision() throws Exception 
{
 Connection conn = DriverManager.getConnection(getUrl());
 initIntegerTable(conn);
@@ -736,4 +782,50 @@ public class ArithmeticQueryIT extends 
BaseHBaseManagedTimeIT {
 assertEquals(6, rs.getLong(1));
 assertFalse(rs.next());
 }
+
+@Test
+public void testOrderOfOperationsMultiplicationModulus() throws Exception {
+Connection conn = DriverManager.getConnection(getUrl());
+initIntegerTable(conn);
+ResultSet rs;
+
+// 6 * 4 % 3
+// 24 % 3
+// 0
+rs = conn.createStatement().executeQuery("SELECT six * four % three 
FROM ARITHMETIC_TEST");
+assertTrue(rs.next());
+assertEquals(0, rs.getLong(1));
+assert