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

2017-05-17 Thread Apache Jenkins Server
4.x-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.x-HBase-0.98

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

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

Changes
[jamestaylor] PHOENIX-3864 PhoenixConsumerIT is timing out frequently in



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-3864 PhoenixConsumerIT is timing out frequently in 4.x-HBase-0.98

2017-05-17 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 0f95d3403 -> b16cb265a


PHOENIX-3864 PhoenixConsumerIT is timing out frequently in 4.x-HBase-0.98


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

Branch: refs/heads/4.x-HBase-0.98
Commit: b16cb265a617d23fc510862da27acdccc3944ad4
Parents: 0f95d34
Author: James Taylor 
Authored: Wed May 17 16:00:21 2017 -0700
Committer: James Taylor 
Committed: Wed May 17 16:00:21 2017 -0700

--
 .../apache/phoenix/kafka/PhoenixConsumerIT.java | 24 +++-
 1 file changed, 13 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/b16cb265/phoenix-kafka/src/it/java/org/apache/phoenix/kafka/PhoenixConsumerIT.java
--
diff --git 
a/phoenix-kafka/src/it/java/org/apache/phoenix/kafka/PhoenixConsumerIT.java 
b/phoenix-kafka/src/it/java/org/apache/phoenix/kafka/PhoenixConsumerIT.java
index cfec391..5965696 100644
--- a/phoenix-kafka/src/it/java/org/apache/phoenix/kafka/PhoenixConsumerIT.java
+++ b/phoenix-kafka/src/it/java/org/apache/phoenix/kafka/PhoenixConsumerIT.java
@@ -29,6 +29,16 @@ import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.Properties;
 
+import kafka.admin.AdminUtils;
+import kafka.server.KafkaConfig;
+import kafka.server.KafkaServer;
+import kafka.utils.MockTime;
+import kafka.utils.TestUtils;
+import kafka.utils.Time;
+import kafka.utils.ZKStringSerializer$;
+import kafka.utils.ZkUtils;
+import kafka.zk.EmbeddedZookeeper;
+
 import org.I0Itec.zkclient.ZkClient;
 import org.apache.flume.Context;
 import org.apache.kafka.clients.producer.KafkaProducer;
@@ -41,21 +51,13 @@ import org.apache.phoenix.kafka.consumer.PhoenixConsumer;
 import org.apache.phoenix.util.PropertiesUtil;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 
 import com.google.common.io.Resources;
 
-import kafka.admin.AdminUtils;
-import kafka.server.KafkaConfig;
-import kafka.server.KafkaServer;
-import kafka.utils.MockTime;
-import kafka.utils.TestUtils;
-import kafka.utils.Time;
-import kafka.utils.ZKStringSerializer$;
-import kafka.utils.ZkUtils;
-import kafka.zk.EmbeddedZookeeper;
-
-public class PhoenixConsumerIT extends BaseHBaseManagedTimeIT {
+@Ignore("Remove tag and make class concrete again when PHOENIX-3864 is fixed 
and test no longer times out")
+public abstract class PhoenixConsumerIT extends BaseHBaseManagedTimeIT {
 private static final String ZKHOST = "127.0.0.1";
 private static final String BROKERHOST = "127.0.0.1";
 private static final String BROKERPORT = "9092";



Build failed in Jenkins: Phoenix | Master #1614

2017-05-17 Thread Apache Jenkins Server
See 


Changes:

[samarth] PHOENIX-3840 Functions extending FirstLastValueBaseFunction returning

--
[...truncated 102.13 KB...]
org.apache.phoenix.end2end.TimezoneOffsetFunctionIT  Time elapsed: 0 sec  <<< 
ERROR!
java.lang.RuntimeException: java.io.IOException: Shutting down
Caused by: java.io.IOException: Shutting down
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds

Running org.apache.phoenix.end2end.ToCharFunctionIT
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.001 sec <<< 
FAILURE! - in org.apache.phoenix.end2end.ToCharFunctionIT
org.apache.phoenix.end2end.ToCharFunctionIT  Time elapsed: 0.001 sec  <<< ERROR!
java.lang.RuntimeException: java.io.IOException: Shutting down
Caused by: java.io.IOException: Shutting down
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds

Running org.apache.phoenix.end2end.ToDateFunctionIT
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.001 sec <<< 
FAILURE! - in org.apache.phoenix.end2end.ToDateFunctionIT
org.apache.phoenix.end2end.ToDateFunctionIT  Time elapsed: 0.001 sec  <<< ERROR!
java.lang.RuntimeException: java.io.IOException: Shutting down
Caused by: java.io.IOException: Shutting down
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds

Running org.apache.phoenix.end2end.UnionAllIT
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.001 sec <<< 
FAILURE! - in org.apache.phoenix.end2end.UnionAllIT
org.apache.phoenix.end2end.UnionAllIT  Time elapsed: 0.001 sec  <<< ERROR!
java.lang.RuntimeException: java.io.IOException: Shutting down
Caused by: java.io.IOException: Shutting down
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds

Running org.apache.phoenix.end2end.UpgradeIT
Running org.apache.phoenix.end2end.UpperLowerFunctionIT
Running org.apache.phoenix.end2end.UpsertBigValuesIT
Running org.apache.phoenix.end2end.UpsertSelectAutoCommitIT
Running org.apache.phoenix.end2end.UseSchemaIT
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.002 sec <<< 
FAILURE! - in org.apache.phoenix.end2end.UpgradeIT
org.apache.phoenix.end2end.UpgradeIT  Time elapsed: 0.002 sec  <<< ERROR!
java.lang.RuntimeException: java.io.IOException: Shutting down
Caused by: java.io.IOException: Shutting down
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 sec <<< 
FAILURE! - in org.apache.phoenix.end2end.UpperLowerFunctionIT
org.apache.phoenix.end2end.UpperLowerFunctionIT  Time elapsed: 0 sec  <<< ERROR!
java.lang.RuntimeException: java.io.IOException: Shutting down
Caused by: java.io.IOException: Shutting down
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 sec <<< 
FAILURE! - in org.apache.phoenix.end2end.UpsertBigValuesIT
org.apache.phoenix.end2end.UpsertBigValuesIT  Time elapsed: 0 sec  <<< ERROR!
java.lang.RuntimeException: java.io.IOException: Shutting down
Caused by: java.io.IOException: Shutting down
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.001 sec <<< 
FAILURE! - in org.apache.phoenix.end2end.UpsertSelectAutoCommitIT
org.apache.phoenix.end2end.UpsertSelectAutoCommitIT  Time elapsed: 0.001 sec  
<<< ERROR!
java.lang.RuntimeException: java.io.IOException: Shutting down
Caused by: java.io.IOException: Shutting down
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.001 sec <<< 
FAILURE! - in org.apache.phoenix.end2end.UseSchemaIT
org.apache.phoenix.end2end.UseSchemaIT  Time elapsed: 0.001 sec  <<< ERROR!
java.lang.RuntimeException: java.io.IOException: Shutting down
Caused by: java.io.IOException: Shutting down
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds

Running org.apache.phoenix.end2end.index.AsyncIndexDisabledIT
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.002 sec <<< 
FAILURE! - in org.apache.phoenix.end2end.index.AsyncIndexDisabledIT
org.apache.phoenix.end2end.index.AsyncIndexDisabledIT  Time elapsed: 0.002 sec  
<<< ERROR!
java.lang.RuntimeException: java.io.IOException: Shutting down
Caused by: java.io.IOException: Shutting down
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds

Running org.apache.phoenix.end2end.index.ChildViewsUseParentViewIndexIT
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.001 sec <<< 
FAILURE! - in org.apache.phoenix.end2end.index.ChildViewsUseParentViewIndexIT

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

2017-05-17 Thread Apache Jenkins Server
4.x-HBase-1.2 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.2

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

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

Changes
[samarth] PHOENIX-3840 Functions extending FirstLastValueBaseFunction returning



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


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

2017-05-17 Thread Apache Jenkins Server
4.x-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.x-HBase-0.98

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

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

Changes
[samarth] PHOENIX-3840 Functions extending FirstLastValueBaseFunction returning



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


Jenkins build is back to normal : Phoenix | 4.x-HBase-0.98 #1499

2017-05-17 Thread Apache Jenkins Server
See 




Build failed in Jenkins: Phoenix-4.x-HBase-1.1 #393

2017-05-17 Thread Apache Jenkins Server
See 


Changes:

[samarth] PHOENIX-3840 Functions extending FirstLastValueBaseFunction returning

--
[...truncated 53.28 KB...]

testViewAddsClashingPKColumn[transactional = 
true](org.apache.phoenix.end2end.ViewIT)  Time elapsed: 46.117 sec  <<< ERROR!
java.lang.Exception: Unexpected exception, 
expected but 
was
at 
org.apache.phoenix.end2end.ViewIT.testViewAddsClashingPKColumn(ViewIT.java:648)
Caused by: org.apache.thrift.TException: Unable to discover tx service.
at 
org.apache.phoenix.end2end.ViewIT.testViewAddsClashingPKColumn(ViewIT.java:648)

testViewWithCurrentDate[transactional = 
true](org.apache.phoenix.end2end.ViewIT)  Time elapsed: 46.119 sec  <<< ERROR!
java.lang.RuntimeException: org.apache.thrift.TException: Unable to discover tx 
service.
at 
org.apache.phoenix.end2end.ViewIT.testViewWithCurrentDate(ViewIT.java:313)
Caused by: org.apache.thrift.TException: Unable to discover tx service.
at 
org.apache.phoenix.end2end.ViewIT.testViewWithCurrentDate(ViewIT.java:313)

testUpdatableOnUpdatableView[transactional = 
true](org.apache.phoenix.end2end.ViewIT)  Time elapsed: 46.12 sec  <<< ERROR!
java.lang.RuntimeException: org.apache.thrift.TException: Unable to discover tx 
service.
at 
org.apache.phoenix.end2end.ViewIT.testUpdatableOnUpdatableView(ViewIT.java:141)
Caused by: org.apache.thrift.TException: Unable to discover tx service.
at 
org.apache.phoenix.end2end.ViewIT.testUpdatableOnUpdatableView(ViewIT.java:141)

testViewAddsNotNullPKColumn[transactional = 
true](org.apache.phoenix.end2end.ViewIT)  Time elapsed: 46.117 sec  <<< ERROR!
java.lang.RuntimeException: org.apache.thrift.TException: Unable to discover tx 
service.
at 
org.apache.phoenix.end2end.ViewIT.testViewAddsNotNullPKColumn(ViewIT.java:660)
Caused by: org.apache.thrift.TException: Unable to discover tx service.
at 
org.apache.phoenix.end2end.ViewIT.testViewAddsNotNullPKColumn(ViewIT.java:660)

testReadOnlyViewWithCaseSensitiveTableNames[transactional = 
true](org.apache.phoenix.end2end.ViewIT)  Time elapsed: 46.119 sec  <<< ERROR!
java.lang.RuntimeException: org.apache.thrift.TException: Unable to discover tx 
service.
at 
org.apache.phoenix.end2end.ViewIT.testReadOnlyViewWithCaseSensitiveTableNames(ViewIT.java:250)
Caused by: org.apache.thrift.TException: Unable to discover tx service.
at 
org.apache.phoenix.end2end.ViewIT.testReadOnlyViewWithCaseSensitiveTableNames(ViewIT.java:250)

testViewAndTableAndDropCascadeWithIndexes[transactional = 
true](org.apache.phoenix.end2end.ViewIT)  Time elapsed: 46.12 sec  <<< ERROR!
java.lang.RuntimeException: org.apache.thrift.TException: Unable to discover tx 
service.
at 
org.apache.phoenix.end2end.ViewIT.testViewAndTableAndDropCascadeWithIndexes(ViewIT.java:448)
Caused by: org.apache.thrift.TException: Unable to discover tx service.
at 
org.apache.phoenix.end2end.ViewIT.testViewAndTableAndDropCascadeWithIndexes(ViewIT.java:448)

testViewUsesTableLocalIndex[transactional = 
true](org.apache.phoenix.end2end.ViewIT)  Time elapsed: 46.118 sec  <<< ERROR!
java.lang.RuntimeException: org.apache.thrift.TException: Unable to discover tx 
service.
at 
org.apache.phoenix.end2end.ViewIT.testViewUsesTableIndex(ViewIT.java:517)
at 
org.apache.phoenix.end2end.ViewIT.testViewUsesTableLocalIndex(ViewIT.java:506)
Caused by: org.apache.thrift.TException: Unable to discover tx service.
at 
org.apache.phoenix.end2end.ViewIT.testViewUsesTableIndex(ViewIT.java:517)
at 
org.apache.phoenix.end2end.ViewIT.testViewUsesTableLocalIndex(ViewIT.java:506)

testDisallowDropOfColumnOnParentTable[transactional = 
true](org.apache.phoenix.end2end.ViewIT)  Time elapsed: 46.117 sec  <<< ERROR!
java.lang.RuntimeException: org.apache.thrift.TException: Unable to discover tx 
service.
at 
org.apache.phoenix.end2end.ViewIT.testDisallowDropOfColumnOnParentTable(ViewIT.java:400)
Caused by: org.apache.thrift.TException: Unable to discover tx service.
at 
org.apache.phoenix.end2end.ViewIT.testDisallowDropOfColumnOnParentTable(ViewIT.java:400)

testViewUsesTableGlobalIndex[transactional = 
true](org.apache.phoenix.end2end.ViewIT)  Time elapsed: 46.117 sec  <<< ERROR!
java.lang.RuntimeException: org.apache.thrift.TException: Unable to discover tx 
service.
at 
org.apache.phoenix.end2end.ViewIT.testViewUsesTableIndex(ViewIT.java:517)
at 
org.apache.phoenix.end2end.ViewIT.testViewUsesTableGlobalIndex(ViewIT.java:501)
Caused by: org.apache.thrift.TException: Unable to discover tx service.
at 
org.apache.phoenix.end2end.ViewIT.testViewUsesTableIndex(ViewIT.java:517)
at 
org.apache.phoenix.end2end.ViewIT.testViewUsesTableGlobalIndex(ViewIT.java:501)

testNonSaltedUpdatableViewWithLocalIndex[transactional = 

phoenix git commit: PHOENIX-3840 Functions extending FirstLastValueBaseFunction returning NAME as null instead of actual function name ( Loknath Priyatham Teja Singamsetty)

2017-05-17 Thread samarth
Repository: phoenix
Updated Branches:
  refs/heads/4.10-HBase-1.1 61ab04a21 -> 89f64e66c


PHOENIX-3840 Functions extending FirstLastValueBaseFunction returning NAME as 
null instead of actual function name ( Loknath Priyatham Teja Singamsetty)


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

Branch: refs/heads/4.10-HBase-1.1
Commit: 89f64e66c9b176290147f6ad5ce2cabea2c0239f
Parents: 61ab04a
Author: Samarth Jain 
Authored: Wed May 17 12:22:28 2017 -0700
Committer: Samarth Jain 
Committed: Wed May 17 12:22:28 2017 -0700

--
 .../expression/function/FirstLastValueBaseFunction.java   | 10 ++
 .../phoenix/expression/function/FirstValueFunction.java   |  6 ++
 .../phoenix/expression/function/LastValueFunction.java|  6 ++
 .../phoenix/expression/function/NthValueFunction.java |  8 +++-
 4 files changed, 21 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/89f64e66/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
index 5b2c8a1..497122e 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
@@ -18,10 +18,11 @@
 package org.apache.phoenix.expression.function;
 
 import java.util.List;
+
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.phoenix.expression.Expression;
-import org.apache.phoenix.schema.types.PDataType;
 import org.apache.phoenix.schema.tuple.Tuple;
+import org.apache.phoenix.schema.types.PDataType;
 
 /**
  * (FIRST|LAST|NTH)_VALUE build in function interface
@@ -29,8 +30,6 @@ import org.apache.phoenix.schema.tuple.Tuple;
  */
 abstract public class FirstLastValueBaseFunction extends 
DelegateConstantToCountAggregateFunction {
 
-public static String NAME = null;
-
 public FirstLastValueBaseFunction() {
 }
 
@@ -51,11 +50,6 @@ abstract public class FirstLastValueBaseFunction extends 
DelegateConstantToCount
 }
 
 @Override
-public String getName() {
-return NAME;
-}
-
-@Override
 public PDataType getDataType() {
 return children.get(2).getDataType();
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/89f64e66/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
index c19d053..bed3e7a 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
@@ -18,6 +18,7 @@
 package org.apache.phoenix.expression.function;
 
 import java.util.List;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.phoenix.expression.Expression;
 import org.apache.phoenix.expression.LiteralExpression;
@@ -69,4 +70,9 @@ public class FirstValueFunction extends 
FirstLastValueBaseFunction {
 
 return aggregator;
 }
+
+@Override
+public String getName() {
+return NAME;
+}
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/89f64e66/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
index ab6ebe3..fdd6898 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
@@ -18,6 +18,7 @@
 package org.apache.phoenix.expression.function;
 
 import java.util.List;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.phoenix.expression.Expression;
 import org.apache.phoenix.expression.LiteralExpression;
@@ -72,4 +73,9 @@ public class LastValueFunction extends 

phoenix git commit: PHOENIX-3840 Functions extending FirstLastValueBaseFunction returning NAME as null instead of actual function name ( Loknath Priyatham Teja Singamsetty)

2017-05-17 Thread samarth
Repository: phoenix
Updated Branches:
  refs/heads/4.10-HBase-0.98 62978fca9 -> 0e87092d5


PHOENIX-3840 Functions extending FirstLastValueBaseFunction returning NAME as 
null instead of actual function name ( Loknath Priyatham Teja Singamsetty)


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

Branch: refs/heads/4.10-HBase-0.98
Commit: 0e87092d5c520ae75efaf00d342aed1b6a681f1a
Parents: 62978fc
Author: Samarth Jain 
Authored: Wed May 17 12:21:58 2017 -0700
Committer: Samarth Jain 
Committed: Wed May 17 12:21:58 2017 -0700

--
 .../expression/function/FirstLastValueBaseFunction.java   | 10 ++
 .../phoenix/expression/function/FirstValueFunction.java   |  6 ++
 .../phoenix/expression/function/LastValueFunction.java|  6 ++
 .../phoenix/expression/function/NthValueFunction.java |  8 +++-
 4 files changed, 21 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/0e87092d/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
index 5b2c8a1..497122e 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
@@ -18,10 +18,11 @@
 package org.apache.phoenix.expression.function;
 
 import java.util.List;
+
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.phoenix.expression.Expression;
-import org.apache.phoenix.schema.types.PDataType;
 import org.apache.phoenix.schema.tuple.Tuple;
+import org.apache.phoenix.schema.types.PDataType;
 
 /**
  * (FIRST|LAST|NTH)_VALUE build in function interface
@@ -29,8 +30,6 @@ import org.apache.phoenix.schema.tuple.Tuple;
  */
 abstract public class FirstLastValueBaseFunction extends 
DelegateConstantToCountAggregateFunction {
 
-public static String NAME = null;
-
 public FirstLastValueBaseFunction() {
 }
 
@@ -51,11 +50,6 @@ abstract public class FirstLastValueBaseFunction extends 
DelegateConstantToCount
 }
 
 @Override
-public String getName() {
-return NAME;
-}
-
-@Override
 public PDataType getDataType() {
 return children.get(2).getDataType();
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/0e87092d/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
index c19d053..bed3e7a 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
@@ -18,6 +18,7 @@
 package org.apache.phoenix.expression.function;
 
 import java.util.List;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.phoenix.expression.Expression;
 import org.apache.phoenix.expression.LiteralExpression;
@@ -69,4 +70,9 @@ public class FirstValueFunction extends 
FirstLastValueBaseFunction {
 
 return aggregator;
 }
+
+@Override
+public String getName() {
+return NAME;
+}
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/0e87092d/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
index ab6ebe3..fdd6898 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
@@ -18,6 +18,7 @@
 package org.apache.phoenix.expression.function;
 
 import java.util.List;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.phoenix.expression.Expression;
 import org.apache.phoenix.expression.LiteralExpression;
@@ -72,4 +73,9 @@ public class LastValueFunction extends 

phoenix git commit: PHOENIX-3840 Functions extending FirstLastValueBaseFunction returning NAME as null instead of actual function name ( Loknath Priyatham Teja Singamsetty)

2017-05-17 Thread samarth
Repository: phoenix
Updated Branches:
  refs/heads/4.10-HBase-1.2 e4c6a2568 -> 28d7eb1c9


PHOENIX-3840 Functions extending FirstLastValueBaseFunction returning NAME as 
null instead of actual function name ( Loknath Priyatham Teja Singamsetty)


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

Branch: refs/heads/4.10-HBase-1.2
Commit: 28d7eb1c9b0efa00af62932ca0adf47aad9ee504
Parents: e4c6a25
Author: Samarth Jain 
Authored: Wed May 17 12:21:36 2017 -0700
Committer: Samarth Jain 
Committed: Wed May 17 12:21:36 2017 -0700

--
 .../expression/function/FirstLastValueBaseFunction.java   | 10 ++
 .../phoenix/expression/function/FirstValueFunction.java   |  6 ++
 .../phoenix/expression/function/LastValueFunction.java|  6 ++
 .../phoenix/expression/function/NthValueFunction.java |  8 +++-
 4 files changed, 21 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/28d7eb1c/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
index 5b2c8a1..497122e 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
@@ -18,10 +18,11 @@
 package org.apache.phoenix.expression.function;
 
 import java.util.List;
+
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.phoenix.expression.Expression;
-import org.apache.phoenix.schema.types.PDataType;
 import org.apache.phoenix.schema.tuple.Tuple;
+import org.apache.phoenix.schema.types.PDataType;
 
 /**
  * (FIRST|LAST|NTH)_VALUE build in function interface
@@ -29,8 +30,6 @@ import org.apache.phoenix.schema.tuple.Tuple;
  */
 abstract public class FirstLastValueBaseFunction extends 
DelegateConstantToCountAggregateFunction {
 
-public static String NAME = null;
-
 public FirstLastValueBaseFunction() {
 }
 
@@ -51,11 +50,6 @@ abstract public class FirstLastValueBaseFunction extends 
DelegateConstantToCount
 }
 
 @Override
-public String getName() {
-return NAME;
-}
-
-@Override
 public PDataType getDataType() {
 return children.get(2).getDataType();
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/28d7eb1c/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
index c19d053..bed3e7a 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
@@ -18,6 +18,7 @@
 package org.apache.phoenix.expression.function;
 
 import java.util.List;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.phoenix.expression.Expression;
 import org.apache.phoenix.expression.LiteralExpression;
@@ -69,4 +70,9 @@ public class FirstValueFunction extends 
FirstLastValueBaseFunction {
 
 return aggregator;
 }
+
+@Override
+public String getName() {
+return NAME;
+}
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/28d7eb1c/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
index ab6ebe3..fdd6898 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
@@ -18,6 +18,7 @@
 package org.apache.phoenix.expression.function;
 
 import java.util.List;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.phoenix.expression.Expression;
 import org.apache.phoenix.expression.LiteralExpression;
@@ -72,4 +73,9 @@ public class LastValueFunction extends 

phoenix git commit: PHOENIX-3840 Functions extending FirstLastValueBaseFunction returning NAME as null instead of actual function name ( Loknath Priyatham Teja Singamsetty)

2017-05-17 Thread samarth
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.2 4a606860c -> 74281ee51


PHOENIX-3840 Functions extending FirstLastValueBaseFunction returning NAME as 
null instead of actual function name ( Loknath Priyatham Teja Singamsetty)


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

Branch: refs/heads/4.x-HBase-1.2
Commit: 74281ee51491c3ec2d90fccc71d5b69a722d8485
Parents: 4a60686
Author: Samarth Jain 
Authored: Wed May 17 12:20:43 2017 -0700
Committer: Samarth Jain 
Committed: Wed May 17 12:20:43 2017 -0700

--
 .../expression/function/FirstLastValueBaseFunction.java   | 10 ++
 .../phoenix/expression/function/FirstValueFunction.java   |  6 ++
 .../phoenix/expression/function/LastValueFunction.java|  6 ++
 .../phoenix/expression/function/NthValueFunction.java |  8 +++-
 4 files changed, 21 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/74281ee5/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
index 5b2c8a1..497122e 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
@@ -18,10 +18,11 @@
 package org.apache.phoenix.expression.function;
 
 import java.util.List;
+
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.phoenix.expression.Expression;
-import org.apache.phoenix.schema.types.PDataType;
 import org.apache.phoenix.schema.tuple.Tuple;
+import org.apache.phoenix.schema.types.PDataType;
 
 /**
  * (FIRST|LAST|NTH)_VALUE build in function interface
@@ -29,8 +30,6 @@ import org.apache.phoenix.schema.tuple.Tuple;
  */
 abstract public class FirstLastValueBaseFunction extends 
DelegateConstantToCountAggregateFunction {
 
-public static String NAME = null;
-
 public FirstLastValueBaseFunction() {
 }
 
@@ -51,11 +50,6 @@ abstract public class FirstLastValueBaseFunction extends 
DelegateConstantToCount
 }
 
 @Override
-public String getName() {
-return NAME;
-}
-
-@Override
 public PDataType getDataType() {
 return children.get(2).getDataType();
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/74281ee5/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
index c19d053..bed3e7a 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
@@ -18,6 +18,7 @@
 package org.apache.phoenix.expression.function;
 
 import java.util.List;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.phoenix.expression.Expression;
 import org.apache.phoenix.expression.LiteralExpression;
@@ -69,4 +70,9 @@ public class FirstValueFunction extends 
FirstLastValueBaseFunction {
 
 return aggregator;
 }
+
+@Override
+public String getName() {
+return NAME;
+}
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/74281ee5/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
index ab6ebe3..fdd6898 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
@@ -18,6 +18,7 @@
 package org.apache.phoenix.expression.function;
 
 import java.util.List;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.phoenix.expression.Expression;
 import org.apache.phoenix.expression.LiteralExpression;
@@ -72,4 +73,9 @@ public class LastValueFunction extends 

phoenix git commit: PHOENIX-3840 Functions extending FirstLastValueBaseFunction returning NAME as null instead of actual function name ( Loknath Priyatham Teja Singamsetty)

2017-05-17 Thread samarth
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.1 53da5cebe -> d41dd1d4d


PHOENIX-3840 Functions extending FirstLastValueBaseFunction returning NAME as 
null instead of actual function name ( Loknath Priyatham Teja Singamsetty)


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

Branch: refs/heads/4.x-HBase-1.1
Commit: d41dd1d4d712a525cd0b55fae1e284f378c22d3e
Parents: 53da5ce
Author: Samarth Jain 
Authored: Wed May 17 12:20:15 2017 -0700
Committer: Samarth Jain 
Committed: Wed May 17 12:20:15 2017 -0700

--
 .../expression/function/FirstLastValueBaseFunction.java   | 10 ++
 .../phoenix/expression/function/FirstValueFunction.java   |  6 ++
 .../phoenix/expression/function/LastValueFunction.java|  6 ++
 .../phoenix/expression/function/NthValueFunction.java |  8 +++-
 4 files changed, 21 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d41dd1d4/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
index 5b2c8a1..497122e 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
@@ -18,10 +18,11 @@
 package org.apache.phoenix.expression.function;
 
 import java.util.List;
+
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.phoenix.expression.Expression;
-import org.apache.phoenix.schema.types.PDataType;
 import org.apache.phoenix.schema.tuple.Tuple;
+import org.apache.phoenix.schema.types.PDataType;
 
 /**
  * (FIRST|LAST|NTH)_VALUE build in function interface
@@ -29,8 +30,6 @@ import org.apache.phoenix.schema.tuple.Tuple;
  */
 abstract public class FirstLastValueBaseFunction extends 
DelegateConstantToCountAggregateFunction {
 
-public static String NAME = null;
-
 public FirstLastValueBaseFunction() {
 }
 
@@ -51,11 +50,6 @@ abstract public class FirstLastValueBaseFunction extends 
DelegateConstantToCount
 }
 
 @Override
-public String getName() {
-return NAME;
-}
-
-@Override
 public PDataType getDataType() {
 return children.get(2).getDataType();
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/d41dd1d4/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
index c19d053..bed3e7a 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
@@ -18,6 +18,7 @@
 package org.apache.phoenix.expression.function;
 
 import java.util.List;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.phoenix.expression.Expression;
 import org.apache.phoenix.expression.LiteralExpression;
@@ -69,4 +70,9 @@ public class FirstValueFunction extends 
FirstLastValueBaseFunction {
 
 return aggregator;
 }
+
+@Override
+public String getName() {
+return NAME;
+}
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/d41dd1d4/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
index ab6ebe3..fdd6898 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
@@ -18,6 +18,7 @@
 package org.apache.phoenix.expression.function;
 
 import java.util.List;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.phoenix.expression.Expression;
 import org.apache.phoenix.expression.LiteralExpression;
@@ -72,4 +73,9 @@ public class LastValueFunction extends 

phoenix git commit: PHOENIX-3840 Functions extending FirstLastValueBaseFunction returning NAME as null instead of actual function name ( Loknath Priyatham Teja Singamsetty)

2017-05-17 Thread samarth
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 42cc41c94 -> 0f95d3403


PHOENIX-3840 Functions extending FirstLastValueBaseFunction returning NAME as 
null instead of actual function name ( Loknath Priyatham Teja Singamsetty)


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 0f95d340320d9aa38e2ad99c7d5de0de3a191aa9
Parents: 42cc41c
Author: Samarth Jain 
Authored: Wed May 17 12:19:51 2017 -0700
Committer: Samarth Jain 
Committed: Wed May 17 12:19:51 2017 -0700

--
 .../expression/function/FirstLastValueBaseFunction.java   | 10 ++
 .../phoenix/expression/function/FirstValueFunction.java   |  6 ++
 .../phoenix/expression/function/LastValueFunction.java|  6 ++
 .../phoenix/expression/function/NthValueFunction.java |  8 +++-
 4 files changed, 21 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/0f95d340/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
index 5b2c8a1..497122e 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
@@ -18,10 +18,11 @@
 package org.apache.phoenix.expression.function;
 
 import java.util.List;
+
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.phoenix.expression.Expression;
-import org.apache.phoenix.schema.types.PDataType;
 import org.apache.phoenix.schema.tuple.Tuple;
+import org.apache.phoenix.schema.types.PDataType;
 
 /**
  * (FIRST|LAST|NTH)_VALUE build in function interface
@@ -29,8 +30,6 @@ import org.apache.phoenix.schema.tuple.Tuple;
  */
 abstract public class FirstLastValueBaseFunction extends 
DelegateConstantToCountAggregateFunction {
 
-public static String NAME = null;
-
 public FirstLastValueBaseFunction() {
 }
 
@@ -51,11 +50,6 @@ abstract public class FirstLastValueBaseFunction extends 
DelegateConstantToCount
 }
 
 @Override
-public String getName() {
-return NAME;
-}
-
-@Override
 public PDataType getDataType() {
 return children.get(2).getDataType();
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/0f95d340/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
index c19d053..bed3e7a 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
@@ -18,6 +18,7 @@
 package org.apache.phoenix.expression.function;
 
 import java.util.List;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.phoenix.expression.Expression;
 import org.apache.phoenix.expression.LiteralExpression;
@@ -69,4 +70,9 @@ public class FirstValueFunction extends 
FirstLastValueBaseFunction {
 
 return aggregator;
 }
+
+@Override
+public String getName() {
+return NAME;
+}
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/0f95d340/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
index ab6ebe3..fdd6898 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
@@ -18,6 +18,7 @@
 package org.apache.phoenix.expression.function;
 
 import java.util.List;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.phoenix.expression.Expression;
 import org.apache.phoenix.expression.LiteralExpression;
@@ -72,4 +73,9 @@ public class LastValueFunction extends 

phoenix git commit: PHOENIX-3840 Functions extending FirstLastValueBaseFunction returning NAME as null instead of actual function name ( Loknath Priyatham Teja Singamsetty)

2017-05-17 Thread samarth
Repository: phoenix
Updated Branches:
  refs/heads/master 2cb617f35 -> 0e652b6ec


PHOENIX-3840 Functions extending FirstLastValueBaseFunction returning NAME as 
null instead of actual function name ( Loknath Priyatham Teja Singamsetty)


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

Branch: refs/heads/master
Commit: 0e652b6ecd9081ddfddc32854a08fc68684e8958
Parents: 2cb617f
Author: Samarth Jain 
Authored: Wed May 17 12:18:02 2017 -0700
Committer: Samarth Jain 
Committed: Wed May 17 12:18:02 2017 -0700

--
 .../expression/function/FirstLastValueBaseFunction.java   | 10 ++
 .../phoenix/expression/function/FirstValueFunction.java   |  6 ++
 .../phoenix/expression/function/LastValueFunction.java|  6 ++
 .../phoenix/expression/function/NthValueFunction.java |  8 +++-
 4 files changed, 21 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/0e652b6e/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
index 5b2c8a1..497122e 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstLastValueBaseFunction.java
@@ -18,10 +18,11 @@
 package org.apache.phoenix.expression.function;
 
 import java.util.List;
+
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.phoenix.expression.Expression;
-import org.apache.phoenix.schema.types.PDataType;
 import org.apache.phoenix.schema.tuple.Tuple;
+import org.apache.phoenix.schema.types.PDataType;
 
 /**
  * (FIRST|LAST|NTH)_VALUE build in function interface
@@ -29,8 +30,6 @@ import org.apache.phoenix.schema.tuple.Tuple;
  */
 abstract public class FirstLastValueBaseFunction extends 
DelegateConstantToCountAggregateFunction {
 
-public static String NAME = null;
-
 public FirstLastValueBaseFunction() {
 }
 
@@ -51,11 +50,6 @@ abstract public class FirstLastValueBaseFunction extends 
DelegateConstantToCount
 }
 
 @Override
-public String getName() {
-return NAME;
-}
-
-@Override
 public PDataType getDataType() {
 return children.get(2).getDataType();
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/0e652b6e/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
index c19d053..bed3e7a 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/FirstValueFunction.java
@@ -18,6 +18,7 @@
 package org.apache.phoenix.expression.function;
 
 import java.util.List;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.phoenix.expression.Expression;
 import org.apache.phoenix.expression.LiteralExpression;
@@ -69,4 +70,9 @@ public class FirstValueFunction extends 
FirstLastValueBaseFunction {
 
 return aggregator;
 }
+
+@Override
+public String getName() {
+return NAME;
+}
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/0e652b6e/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
index ab6ebe3..fdd6898 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/expression/function/LastValueFunction.java
@@ -18,6 +18,7 @@
 package org.apache.phoenix.expression.function;
 
 import java.util.List;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.phoenix.expression.Expression;
 import org.apache.phoenix.expression.LiteralExpression;
@@ -72,4 +73,9 @@ public class LastValueFunction extends 
FirstLastValueBaseFunction {
 

Build failed in Jenkins: Phoenix | Master #1613

2017-05-17 Thread Apache Jenkins Server
See 


Changes:

[ankitsinghal59] PHOENIX-3572 Support FETCH NEXT| n ROWS from Cursor (Biju Nair)

--
[...truncated 103.72 KB...]
java.lang.RuntimeException: java.io.IOException: Shutting down
Caused by: java.io.IOException: Shutting down
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds

Running org.apache.phoenix.end2end.UpperLowerFunctionIT
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.001 sec <<< 
FAILURE! - in org.apache.phoenix.end2end.UpgradeIT
org.apache.phoenix.end2end.UpgradeIT  Time elapsed: 0.001 sec  <<< ERROR!
java.lang.RuntimeException: java.io.IOException: Shutting down
Caused by: java.io.IOException: Shutting down
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds

Running org.apache.phoenix.end2end.UpsertBigValuesIT
Running org.apache.phoenix.end2end.UseSchemaIT
Running org.apache.phoenix.end2end.UpsertSelectAutoCommitIT
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.001 sec <<< 
FAILURE! - in org.apache.phoenix.end2end.UpperLowerFunctionIT
org.apache.phoenix.end2end.UpperLowerFunctionIT  Time elapsed: 0.001 sec  <<< 
ERROR!
java.lang.RuntimeException: java.io.IOException: Shutting down
Caused by: java.io.IOException: Shutting down
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 sec <<< 
FAILURE! - in org.apache.phoenix.end2end.UpsertBigValuesIT
org.apache.phoenix.end2end.UpsertBigValuesIT  Time elapsed: 0 sec  <<< ERROR!
java.lang.RuntimeException: java.io.IOException: Shutting down
Caused by: java.io.IOException: Shutting down
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 sec <<< 
FAILURE! - in org.apache.phoenix.end2end.UseSchemaIT
org.apache.phoenix.end2end.UseSchemaIT  Time elapsed: 0 sec  <<< ERROR!
java.lang.RuntimeException: java.io.IOException: Shutting down
Caused by: java.io.IOException: Shutting down
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.001 sec <<< 
FAILURE! - in org.apache.phoenix.end2end.UpsertSelectAutoCommitIT
org.apache.phoenix.end2end.UpsertSelectAutoCommitIT  Time elapsed: 0.001 sec  
<<< ERROR!
java.lang.RuntimeException: java.io.IOException: Shutting down
Caused by: java.io.IOException: Shutting down
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds

Running org.apache.phoenix.end2end.index.AsyncIndexDisabledIT
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.001 sec <<< 
FAILURE! - in org.apache.phoenix.end2end.index.AsyncIndexDisabledIT
org.apache.phoenix.end2end.index.AsyncIndexDisabledIT  Time elapsed: 0.001 sec  
<<< ERROR!
java.lang.RuntimeException: java.io.IOException: Shutting down
Caused by: java.io.IOException: Shutting down
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds

Running org.apache.phoenix.end2end.index.ChildViewsUseParentViewIndexIT
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.001 sec <<< 
FAILURE! - in org.apache.phoenix.end2end.index.ChildViewsUseParentViewIndexIT
org.apache.phoenix.end2end.index.ChildViewsUseParentViewIndexIT  Time elapsed: 
0.001 sec  <<< ERROR!
java.lang.RuntimeException: java.io.IOException: Shutting down
Caused by: java.io.IOException: Shutting down
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds

Running org.apache.phoenix.end2end.index.DropColumnIT
Running org.apache.phoenix.end2end.index.DropMetadataIT
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.004 sec <<< 
FAILURE! - in org.apache.phoenix.end2end.index.DropColumnIT
org.apache.phoenix.end2end.index.DropColumnIT  Time elapsed: 0.004 sec  <<< 
ERROR!
java.lang.RuntimeException: java.io.IOException: Shutting down
Caused by: java.io.IOException: Shutting down
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds

Running org.apache.phoenix.end2end.index.GlobalIndexOptimizationIT
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 sec <<< 
FAILURE! - in org.apache.phoenix.end2end.index.DropMetadataIT
org.apache.phoenix.end2end.index.DropMetadataIT  Time elapsed: 0 sec  <<< ERROR!
java.lang.RuntimeException: java.io.IOException: Shutting down
Caused by: java.io.IOException: Shutting down
Caused by: java.lang.RuntimeException: Master not initialized after 20ms 
seconds

Running org.apache.phoenix.end2end.index.IndexExpressionIT
Running org.apache.phoenix.end2end.index.IndexIT
Running org.apache.phoenix.end2end.index.IndexMetadataIT
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.002 sec <<< 

Apache Phoenix - Timeout crawler - Build https://builds.apache.org/job/Phoenix-4.x-HBase-0.98/1498/

2017-05-17 Thread Apache Jenkins Server
[...truncated 22 lines...]
Looking at the log, list of test(s) that timed-out:

Build:
https://builds.apache.org/job/Phoenix-4.x-HBase-0.98/1498/


Affected test class(es):
Set(['org.apache.phoenix.kafka.PhoenixConsumerIT'])


Build step 'Execute shell' marked build as failure
Email was triggered for: Failure - Any
Sending email for trigger: Failure - Any

Jenkins build is back to normal : Phoenix-4.x-HBase-1.1 #392

2017-05-17 Thread Apache Jenkins Server
See 




Jenkins build is back to normal : Phoenix-4.x-HBase-1.2 #4

2017-05-17 Thread Apache Jenkins Server
See 




Build failed in Jenkins: Phoenix Compile Compatibility with HBase #291

2017-05-17 Thread Apache Jenkins Server
See 


--
Started by timer
[EnvInject] - Loading node environment variables.
Building remotely on qnode1 (ubuntu) in workspace 

[Phoenix_Compile_Compat_wHBase] $ /bin/bash /tmp/hudson8907869997634653488.sh
core file size  (blocks, -c) 0
data seg size   (kbytes, -d) unlimited
scheduling priority (-e) 0
file size   (blocks, -f) unlimited
pending signals (-i) 128341
max locked memory   (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files  (-n) 6
pipe size(512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority  (-r) 0
stack size  (kbytes, -s) 8192
cpu time   (seconds, -t) unlimited
max user processes  (-u) 10240
virtual memory  (kbytes, -v) unlimited
file locks  (-x) unlimited
core id : 0
core id : 1
core id : 2
core id : 3
core id : 4
core id : 5
core id : 6
core id : 7
physical id : 0
MemTotal:   32865152 kB
MemFree:13695552 kB
Filesystem  Size  Used Avail Use% Mounted on
none 16G 0   16G   0% /dev
tmpfs   3.2G  358M  2.8G  12% /run
/dev/nbd046G   19G   26G  43% /
tmpfs16G 0   16G   0% /dev/shm
tmpfs   5.0M 0  5.0M   0% /run/lock
tmpfs16G 0   16G   0% /sys/fs/cgroup
/dev/sda1   235G  114G  110G  51% /home
tmpfs   3.2G 0  3.2G   0% /run/user/9997
apache-maven-2.2.1
apache-maven-3.0.4
apache-maven-3.0.5
apache-maven-3.2.1
apache-maven-3.2.5
apache-maven-3.3.3
apache-maven-3.3.9
latest
latest2
latest3


===
Verifying compile level compatibility with HBase 0.98 with Phoenix 
4.x-HBase-0.98
===

Cloning into 'hbase'...
Switched to a new branch '0.98'
Branch 0.98 set up to track remote branch 0.98 from origin.

main:
 [exec] 
~/jenkins-slave/workspace/Phoenix_Compile_Compat_wHBase/hbase/hbase-common 
~/jenkins-slave/workspace/Phoenix_Compile_Compat_wHBase/hbase/hbase-common
 [exec] 
~/jenkins-slave/workspace/Phoenix_Compile_Compat_wHBase/hbase/hbase-common

main:
[mkdir] Created dir: 

 [exec] tar: hadoop-snappy-nativelibs.tar: Cannot open: No such file or 
directory
 [exec] tar: Error is not recoverable: exiting now
 [exec] Result: 2

main:
[mkdir] Created dir: 

 [copy] Copying 20 files to 

[mkdir] Created dir: 

[mkdir] Created dir: 


main:
[mkdir] Created dir: 

 [copy] Copying 17 files to 

[mkdir] Created dir: 


main:
[mkdir] Created dir: 

 [copy] Copying 1 file to 

[mkdir] Created dir: 


HBase pom.xml:

Got HBase version as 0.98.25-SNAPSHOT
Cloning into 'phoenix'...
Switched to a new branch '4.x-HBase-0.98'
Branch 4.x-HBase-0.98 set up to track remote branch 4.x-HBase-0.98 from origin.
ANTLR Parser Generator  Version 3.5.2
Output file 

 does not exist: must build 

PhoenixSQL.g


===
Verifying compile level compatibility with HBase branch-1.3 with Phoenix 

[1/2] phoenix git commit: PHOENIX-3572 Support FETCH NEXT| n ROWS from Cursor (Biju Nair)

2017-05-17 Thread ankit
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 5868d09a0 -> 42cc41c94


http://git-wip-us.apache.org/repos/asf/phoenix/blob/42cc41c9/phoenix-core/src/main/java/org/apache/phoenix/util/CursorUtil.java
--
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/CursorUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/CursorUtil.java
new file mode 100644
index 000..877c436
--- /dev/null
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/CursorUtil.java
@@ -0,0 +1,189 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.phoenix.util;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.hadoop.hbase.client.Scan;
+import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
+import org.apache.phoenix.compile.QueryPlan;
+import org.apache.phoenix.compile.OrderByCompiler.OrderBy;
+import org.apache.phoenix.execute.CursorFetchPlan;
+import org.apache.phoenix.iterate.CursorResultIterator;
+import org.apache.phoenix.parse.CloseStatement;
+import org.apache.phoenix.parse.DeclareCursorStatement;
+import org.apache.phoenix.parse.OpenStatement;
+import org.apache.phoenix.schema.tuple.Tuple;
+
+public final class CursorUtil {
+
+private static class CursorWrapper {
+private final String cursorName;
+private final String selectSQL;
+private boolean isOpen = false;
+QueryPlan queryPlan;
+ImmutableBytesWritable row;
+ImmutableBytesWritable previousRow;
+private Scan scan;
+private boolean moreValues=true;
+private boolean isReversed;
+private boolean islastCallNext;
+private CursorFetchPlan fetchPlan;
+private int offset = -1;
+private boolean isAggregate;
+
+private CursorWrapper(String cursorName, String selectSQL, QueryPlan 
queryPlan){
+this.cursorName = cursorName;
+this.selectSQL = selectSQL;
+this.queryPlan = queryPlan;
+this.islastCallNext = true;
+this.fetchPlan = new CursorFetchPlan(queryPlan,cursorName);
+isAggregate = fetchPlan.isAggregate();
+}
+
+private synchronized void openCursor(Connection conn) throws 
SQLException {
+if(isOpen){
+return;
+}
+this.scan = this.queryPlan.getContext().getScan();
+
isReversed=OrderBy.REV_ROW_KEY_ORDER_BY.equals(this.queryPlan.getOrderBy());
+isOpen = true;
+}
+
+private void closeCursor() throws SQLException {
+isOpen = false;
+((CursorResultIterator) fetchPlan.iterator()).closeCursor();
+//TODO: Determine if the cursor should be removed from the HashMap 
at this point.
+//Semantically it makes sense that something which is 'Closed' one 
should be able to 'Open' again.
+mapCursorIDQuery.remove(this.cursorName);
+}
+
+private QueryPlan getFetchPlan(boolean isNext, int fetchSize) throws 
SQLException {
+if (!isOpen)
+throw new SQLException("Fetch call on closed cursor '" + 
this.cursorName + "'!");
+
((CursorResultIterator)fetchPlan.iterator()).setFetchSize(fetchSize);
+if (!isAggregate) { 
+if (row!=null){
+scan.setStartRow(row.get());
+}
+}
+return this.fetchPlan;
+}
+
+public void updateLastScanRow(Tuple rowValues,Tuple nextRowValues) {
+   
+this.moreValues = !isReversed ? nextRowValues != null : rowValues 
!= null;
+if(!moreValues()){
+   return;
+}
+if (row == null) {
+row = new ImmutableBytesWritable();
+}
+if (previousRow == null) {
+previousRow = new ImmutableBytesWritable();
+}
+if (nextRowValues != null) {
+nextRowValues.getKey(row);
+} 
+if (rowValues != null) {
+

[2/2] phoenix git commit: PHOENIX-3572 Support FETCH NEXT| n ROWS from Cursor (Biju Nair)

2017-05-17 Thread ankit
PHOENIX-3572 Support FETCH NEXT| n ROWS from Cursor (Biju Nair)


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 42cc41c946c16ecb0738d7916fe8454850fd5049
Parents: 5868d09
Author: Ankit Singhal 
Authored: Wed May 17 14:11:29 2017 +0530
Committer: Ankit Singhal 
Committed: Wed May 17 14:11:29 2017 +0530

--
 .../CursorWithRowValueConstructorIT.java| 687 +++
 phoenix-core/src/main/antlr3/PhoenixSQL.g   |  31 +
 .../phoenix/compile/CloseStatementCompiler.java |  57 ++
 .../phoenix/compile/DeclareCursorCompiler.java  |  75 ++
 .../phoenix/compile/OpenStatementCompiler.java  |  57 ++
 .../apache/phoenix/execute/CursorFetchPlan.java |  53 ++
 .../phoenix/iterate/CursorResultIterator.java   |  75 ++
 .../apache/phoenix/jdbc/PhoenixStatement.java   |  91 ++-
 .../apache/phoenix/parse/CloseStatement.java|  40 ++
 .../org/apache/phoenix/parse/CursorName.java|  26 +
 .../phoenix/parse/DeclareCursorStatement.java   |  60 ++
 .../apache/phoenix/parse/FetchStatement.java|  52 ++
 .../org/apache/phoenix/parse/OpenStatement.java |  40 ++
 .../apache/phoenix/parse/ParseNodeFactory.java  |  20 +
 .../org/apache/phoenix/parse/SQLParser.java |  76 ++
 .../apache/phoenix/schema/MetaDataClient.java   |  20 +
 .../org/apache/phoenix/util/CursorUtil.java | 189 +
 .../java/org/apache/phoenix/util/ScanUtil.java  |   6 +-
 .../phoenix/compile/CursorCompilerTest.java |  87 +++
 .../apache/phoenix/parse/CursorParserTest.java  | 367 ++
 20 files changed, 2106 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/42cc41c9/phoenix-core/src/it/java/org/apache/phoenix/end2end/CursorWithRowValueConstructorIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CursorWithRowValueConstructorIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CursorWithRowValueConstructorIT.java
new file mode 100644
index 000..dda4bd1
--- /dev/null
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CursorWithRowValueConstructorIT.java
@@ -0,0 +1,687 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.end2end;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.phoenix.util.*;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.math.BigDecimal;
+import java.sql.*;
+import java.util.Properties;
+import java.util.Random;
+
+import static org.apache.phoenix.util.TestUtil.*;
+import static org.junit.Assert.*;
+
+
+public class CursorWithRowValueConstructorIT extends ParallelStatsDisabledIT {
+private static final String TABLE_NAME = "CursorRVCTestTable";
+protected static final Log LOG = 
LogFactory.getLog(CursorWithRowValueConstructorIT.class);
+
+public void createAndInitializeTestTable() throws SQLException {
+Connection conn = DriverManager.getConnection(getUrl());
+
+PreparedStatement stmt = conn.prepareStatement("CREATE TABLE IF NOT 
EXISTS " + TABLE_NAME +
+"(a_id INTEGER NOT NULL, " +
+"a_data INTEGER, " +
+"CONSTRAINT my_pk PRIMARY KEY (a_id))");
+stmt.execute();
+synchronized (conn){
+conn.commit();
+}
+
+//Upsert test values into the test table
+Random rand = new Random();
+stmt = conn.prepareStatement("UPSERT INTO " + TABLE_NAME +
+"(a_id, a_data) VALUES (?,?)");
+int rowCount = 0;
+while(rowCount < 100){
+stmt.setInt(1, rowCount);
+stmt.setInt(2, rand.nextInt(501));
+stmt.execute();
+

[1/2] phoenix git commit: PHOENIX-3572 Support FETCH NEXT| n ROWS from Cursor (Biju Nair)

2017-05-17 Thread ankit
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.1 ecd5d16e2 -> 53da5cebe


http://git-wip-us.apache.org/repos/asf/phoenix/blob/53da5ceb/phoenix-core/src/main/java/org/apache/phoenix/util/CursorUtil.java
--
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/CursorUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/CursorUtil.java
new file mode 100644
index 000..877c436
--- /dev/null
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/CursorUtil.java
@@ -0,0 +1,189 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.phoenix.util;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.hadoop.hbase.client.Scan;
+import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
+import org.apache.phoenix.compile.QueryPlan;
+import org.apache.phoenix.compile.OrderByCompiler.OrderBy;
+import org.apache.phoenix.execute.CursorFetchPlan;
+import org.apache.phoenix.iterate.CursorResultIterator;
+import org.apache.phoenix.parse.CloseStatement;
+import org.apache.phoenix.parse.DeclareCursorStatement;
+import org.apache.phoenix.parse.OpenStatement;
+import org.apache.phoenix.schema.tuple.Tuple;
+
+public final class CursorUtil {
+
+private static class CursorWrapper {
+private final String cursorName;
+private final String selectSQL;
+private boolean isOpen = false;
+QueryPlan queryPlan;
+ImmutableBytesWritable row;
+ImmutableBytesWritable previousRow;
+private Scan scan;
+private boolean moreValues=true;
+private boolean isReversed;
+private boolean islastCallNext;
+private CursorFetchPlan fetchPlan;
+private int offset = -1;
+private boolean isAggregate;
+
+private CursorWrapper(String cursorName, String selectSQL, QueryPlan 
queryPlan){
+this.cursorName = cursorName;
+this.selectSQL = selectSQL;
+this.queryPlan = queryPlan;
+this.islastCallNext = true;
+this.fetchPlan = new CursorFetchPlan(queryPlan,cursorName);
+isAggregate = fetchPlan.isAggregate();
+}
+
+private synchronized void openCursor(Connection conn) throws 
SQLException {
+if(isOpen){
+return;
+}
+this.scan = this.queryPlan.getContext().getScan();
+
isReversed=OrderBy.REV_ROW_KEY_ORDER_BY.equals(this.queryPlan.getOrderBy());
+isOpen = true;
+}
+
+private void closeCursor() throws SQLException {
+isOpen = false;
+((CursorResultIterator) fetchPlan.iterator()).closeCursor();
+//TODO: Determine if the cursor should be removed from the HashMap 
at this point.
+//Semantically it makes sense that something which is 'Closed' one 
should be able to 'Open' again.
+mapCursorIDQuery.remove(this.cursorName);
+}
+
+private QueryPlan getFetchPlan(boolean isNext, int fetchSize) throws 
SQLException {
+if (!isOpen)
+throw new SQLException("Fetch call on closed cursor '" + 
this.cursorName + "'!");
+
((CursorResultIterator)fetchPlan.iterator()).setFetchSize(fetchSize);
+if (!isAggregate) { 
+if (row!=null){
+scan.setStartRow(row.get());
+}
+}
+return this.fetchPlan;
+}
+
+public void updateLastScanRow(Tuple rowValues,Tuple nextRowValues) {
+   
+this.moreValues = !isReversed ? nextRowValues != null : rowValues 
!= null;
+if(!moreValues()){
+   return;
+}
+if (row == null) {
+row = new ImmutableBytesWritable();
+}
+if (previousRow == null) {
+previousRow = new ImmutableBytesWritable();
+}
+if (nextRowValues != null) {
+nextRowValues.getKey(row);
+} 
+if (rowValues != null) {
+

[2/2] phoenix git commit: PHOENIX-3572 Support FETCH NEXT| n ROWS from Cursor (Biju Nair)

2017-05-17 Thread ankit
PHOENIX-3572 Support FETCH NEXT| n ROWS from Cursor (Biju Nair)


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

Branch: refs/heads/4.x-HBase-1.1
Commit: 53da5cebe5081a3039f4c9fbfc8fdeb9d134552c
Parents: ecd5d16
Author: Ankit Singhal 
Authored: Wed May 17 14:09:18 2017 +0530
Committer: Ankit Singhal 
Committed: Wed May 17 14:09:18 2017 +0530

--
 .../CursorWithRowValueConstructorIT.java| 687 +++
 phoenix-core/src/main/antlr3/PhoenixSQL.g   |  31 +
 .../phoenix/compile/CloseStatementCompiler.java |  57 ++
 .../phoenix/compile/DeclareCursorCompiler.java  |  75 ++
 .../phoenix/compile/OpenStatementCompiler.java  |  57 ++
 .../apache/phoenix/execute/CursorFetchPlan.java |  53 ++
 .../phoenix/iterate/CursorResultIterator.java   |  75 ++
 .../apache/phoenix/jdbc/PhoenixStatement.java   |  91 ++-
 .../apache/phoenix/parse/CloseStatement.java|  40 ++
 .../org/apache/phoenix/parse/CursorName.java|  26 +
 .../phoenix/parse/DeclareCursorStatement.java   |  60 ++
 .../apache/phoenix/parse/FetchStatement.java|  52 ++
 .../org/apache/phoenix/parse/OpenStatement.java |  40 ++
 .../apache/phoenix/parse/ParseNodeFactory.java  |  20 +
 .../org/apache/phoenix/parse/SQLParser.java |  76 ++
 .../apache/phoenix/schema/MetaDataClient.java   |  20 +
 .../org/apache/phoenix/util/CursorUtil.java | 189 +
 .../java/org/apache/phoenix/util/ScanUtil.java  |   6 +-
 .../phoenix/compile/CursorCompilerTest.java |  87 +++
 .../apache/phoenix/parse/CursorParserTest.java  | 367 ++
 20 files changed, 2106 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/53da5ceb/phoenix-core/src/it/java/org/apache/phoenix/end2end/CursorWithRowValueConstructorIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CursorWithRowValueConstructorIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CursorWithRowValueConstructorIT.java
new file mode 100644
index 000..dda4bd1
--- /dev/null
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CursorWithRowValueConstructorIT.java
@@ -0,0 +1,687 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.end2end;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.phoenix.util.*;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.math.BigDecimal;
+import java.sql.*;
+import java.util.Properties;
+import java.util.Random;
+
+import static org.apache.phoenix.util.TestUtil.*;
+import static org.junit.Assert.*;
+
+
+public class CursorWithRowValueConstructorIT extends ParallelStatsDisabledIT {
+private static final String TABLE_NAME = "CursorRVCTestTable";
+protected static final Log LOG = 
LogFactory.getLog(CursorWithRowValueConstructorIT.class);
+
+public void createAndInitializeTestTable() throws SQLException {
+Connection conn = DriverManager.getConnection(getUrl());
+
+PreparedStatement stmt = conn.prepareStatement("CREATE TABLE IF NOT 
EXISTS " + TABLE_NAME +
+"(a_id INTEGER NOT NULL, " +
+"a_data INTEGER, " +
+"CONSTRAINT my_pk PRIMARY KEY (a_id))");
+stmt.execute();
+synchronized (conn){
+conn.commit();
+}
+
+//Upsert test values into the test table
+Random rand = new Random();
+stmt = conn.prepareStatement("UPSERT INTO " + TABLE_NAME +
+"(a_id, a_data) VALUES (?,?)");
+int rowCount = 0;
+while(rowCount < 100){
+stmt.setInt(1, rowCount);
+stmt.setInt(2, rand.nextInt(501));
+stmt.execute();
+

[2/2] phoenix git commit: PHOENIX-3572 Support FETCH NEXT| n ROWS from Cursor (Biju Nair)

2017-05-17 Thread ankit
PHOENIX-3572 Support FETCH NEXT| n ROWS from Cursor (Biju Nair)


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

Branch: refs/heads/4.x-HBase-1.2
Commit: 4a606860cb17d4c0487f0c312112a9e90aa8df25
Parents: bdca9aa
Author: Ankit Singhal 
Authored: Wed May 17 14:08:08 2017 +0530
Committer: Ankit Singhal 
Committed: Wed May 17 14:08:08 2017 +0530

--
 .../CursorWithRowValueConstructorIT.java| 687 +++
 phoenix-core/src/main/antlr3/PhoenixSQL.g   |  31 +
 .../phoenix/compile/CloseStatementCompiler.java |  57 ++
 .../phoenix/compile/DeclareCursorCompiler.java  |  75 ++
 .../phoenix/compile/OpenStatementCompiler.java  |  57 ++
 .../apache/phoenix/execute/CursorFetchPlan.java |  53 ++
 .../phoenix/iterate/CursorResultIterator.java   |  75 ++
 .../apache/phoenix/jdbc/PhoenixStatement.java   |  91 ++-
 .../apache/phoenix/parse/CloseStatement.java|  40 ++
 .../org/apache/phoenix/parse/CursorName.java|  26 +
 .../phoenix/parse/DeclareCursorStatement.java   |  60 ++
 .../apache/phoenix/parse/FetchStatement.java|  52 ++
 .../org/apache/phoenix/parse/OpenStatement.java |  40 ++
 .../apache/phoenix/parse/ParseNodeFactory.java  |  20 +
 .../org/apache/phoenix/parse/SQLParser.java |  76 ++
 .../apache/phoenix/schema/MetaDataClient.java   |  20 +
 .../org/apache/phoenix/util/CursorUtil.java | 189 +
 .../java/org/apache/phoenix/util/ScanUtil.java  |   6 +-
 .../phoenix/compile/CursorCompilerTest.java |  87 +++
 .../apache/phoenix/parse/CursorParserTest.java  | 367 ++
 20 files changed, 2106 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/4a606860/phoenix-core/src/it/java/org/apache/phoenix/end2end/CursorWithRowValueConstructorIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CursorWithRowValueConstructorIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CursorWithRowValueConstructorIT.java
new file mode 100644
index 000..dda4bd1
--- /dev/null
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CursorWithRowValueConstructorIT.java
@@ -0,0 +1,687 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.end2end;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.phoenix.util.*;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.math.BigDecimal;
+import java.sql.*;
+import java.util.Properties;
+import java.util.Random;
+
+import static org.apache.phoenix.util.TestUtil.*;
+import static org.junit.Assert.*;
+
+
+public class CursorWithRowValueConstructorIT extends ParallelStatsDisabledIT {
+private static final String TABLE_NAME = "CursorRVCTestTable";
+protected static final Log LOG = 
LogFactory.getLog(CursorWithRowValueConstructorIT.class);
+
+public void createAndInitializeTestTable() throws SQLException {
+Connection conn = DriverManager.getConnection(getUrl());
+
+PreparedStatement stmt = conn.prepareStatement("CREATE TABLE IF NOT 
EXISTS " + TABLE_NAME +
+"(a_id INTEGER NOT NULL, " +
+"a_data INTEGER, " +
+"CONSTRAINT my_pk PRIMARY KEY (a_id))");
+stmt.execute();
+synchronized (conn){
+conn.commit();
+}
+
+//Upsert test values into the test table
+Random rand = new Random();
+stmt = conn.prepareStatement("UPSERT INTO " + TABLE_NAME +
+"(a_id, a_data) VALUES (?,?)");
+int rowCount = 0;
+while(rowCount < 100){
+stmt.setInt(1, rowCount);
+stmt.setInt(2, rand.nextInt(501));
+stmt.execute();
+

[1/2] phoenix git commit: PHOENIX-3572 Support FETCH NEXT| n ROWS from Cursor (Biju Nair)

2017-05-17 Thread ankit
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.2 bdca9aaec -> 4a606860c


http://git-wip-us.apache.org/repos/asf/phoenix/blob/4a606860/phoenix-core/src/main/java/org/apache/phoenix/util/CursorUtil.java
--
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/CursorUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/CursorUtil.java
new file mode 100644
index 000..877c436
--- /dev/null
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/CursorUtil.java
@@ -0,0 +1,189 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.phoenix.util;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.hadoop.hbase.client.Scan;
+import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
+import org.apache.phoenix.compile.QueryPlan;
+import org.apache.phoenix.compile.OrderByCompiler.OrderBy;
+import org.apache.phoenix.execute.CursorFetchPlan;
+import org.apache.phoenix.iterate.CursorResultIterator;
+import org.apache.phoenix.parse.CloseStatement;
+import org.apache.phoenix.parse.DeclareCursorStatement;
+import org.apache.phoenix.parse.OpenStatement;
+import org.apache.phoenix.schema.tuple.Tuple;
+
+public final class CursorUtil {
+
+private static class CursorWrapper {
+private final String cursorName;
+private final String selectSQL;
+private boolean isOpen = false;
+QueryPlan queryPlan;
+ImmutableBytesWritable row;
+ImmutableBytesWritable previousRow;
+private Scan scan;
+private boolean moreValues=true;
+private boolean isReversed;
+private boolean islastCallNext;
+private CursorFetchPlan fetchPlan;
+private int offset = -1;
+private boolean isAggregate;
+
+private CursorWrapper(String cursorName, String selectSQL, QueryPlan 
queryPlan){
+this.cursorName = cursorName;
+this.selectSQL = selectSQL;
+this.queryPlan = queryPlan;
+this.islastCallNext = true;
+this.fetchPlan = new CursorFetchPlan(queryPlan,cursorName);
+isAggregate = fetchPlan.isAggregate();
+}
+
+private synchronized void openCursor(Connection conn) throws 
SQLException {
+if(isOpen){
+return;
+}
+this.scan = this.queryPlan.getContext().getScan();
+
isReversed=OrderBy.REV_ROW_KEY_ORDER_BY.equals(this.queryPlan.getOrderBy());
+isOpen = true;
+}
+
+private void closeCursor() throws SQLException {
+isOpen = false;
+((CursorResultIterator) fetchPlan.iterator()).closeCursor();
+//TODO: Determine if the cursor should be removed from the HashMap 
at this point.
+//Semantically it makes sense that something which is 'Closed' one 
should be able to 'Open' again.
+mapCursorIDQuery.remove(this.cursorName);
+}
+
+private QueryPlan getFetchPlan(boolean isNext, int fetchSize) throws 
SQLException {
+if (!isOpen)
+throw new SQLException("Fetch call on closed cursor '" + 
this.cursorName + "'!");
+
((CursorResultIterator)fetchPlan.iterator()).setFetchSize(fetchSize);
+if (!isAggregate) { 
+if (row!=null){
+scan.setStartRow(row.get());
+}
+}
+return this.fetchPlan;
+}
+
+public void updateLastScanRow(Tuple rowValues,Tuple nextRowValues) {
+   
+this.moreValues = !isReversed ? nextRowValues != null : rowValues 
!= null;
+if(!moreValues()){
+   return;
+}
+if (row == null) {
+row = new ImmutableBytesWritable();
+}
+if (previousRow == null) {
+previousRow = new ImmutableBytesWritable();
+}
+if (nextRowValues != null) {
+nextRowValues.getKey(row);
+} 
+if (rowValues != null) {
+

[2/2] phoenix git commit: PHOENIX-3572 Support FETCH NEXT| n ROWS from Cursor (Biju Nair)

2017-05-17 Thread ankit
PHOENIX-3572 Support FETCH NEXT| n ROWS from Cursor (Biju Nair)


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

Branch: refs/heads/master
Commit: 2cb617f352048179439d242d1165a9ffb39ad81c
Parents: 1666e93
Author: Ankit Singhal 
Authored: Wed May 17 12:56:42 2017 +0530
Committer: Ankit Singhal 
Committed: Wed May 17 12:56:42 2017 +0530

--
 .../CursorWithRowValueConstructorIT.java| 687 +++
 phoenix-core/src/main/antlr3/PhoenixSQL.g   |  31 +
 .../phoenix/compile/CloseStatementCompiler.java |  57 ++
 .../phoenix/compile/DeclareCursorCompiler.java  |  75 ++
 .../phoenix/compile/OpenStatementCompiler.java  |  57 ++
 .../apache/phoenix/execute/CursorFetchPlan.java |  53 ++
 .../phoenix/iterate/CursorResultIterator.java   |  75 ++
 .../apache/phoenix/jdbc/PhoenixStatement.java   |  91 ++-
 .../apache/phoenix/parse/CloseStatement.java|  40 ++
 .../org/apache/phoenix/parse/CursorName.java|  26 +
 .../phoenix/parse/DeclareCursorStatement.java   |  60 ++
 .../apache/phoenix/parse/FetchStatement.java|  52 ++
 .../org/apache/phoenix/parse/OpenStatement.java |  40 ++
 .../apache/phoenix/parse/ParseNodeFactory.java  |  20 +
 .../org/apache/phoenix/parse/SQLParser.java |  76 ++
 .../apache/phoenix/schema/MetaDataClient.java   |  20 +
 .../org/apache/phoenix/util/CursorUtil.java | 189 +
 .../java/org/apache/phoenix/util/ScanUtil.java  |   6 +-
 .../phoenix/compile/CursorCompilerTest.java |  87 +++
 .../apache/phoenix/parse/CursorParserTest.java  | 367 ++
 20 files changed, 2106 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/2cb617f3/phoenix-core/src/it/java/org/apache/phoenix/end2end/CursorWithRowValueConstructorIT.java
--
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CursorWithRowValueConstructorIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CursorWithRowValueConstructorIT.java
new file mode 100644
index 000..dda4bd1
--- /dev/null
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CursorWithRowValueConstructorIT.java
@@ -0,0 +1,687 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.end2end;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.phoenix.util.*;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.math.BigDecimal;
+import java.sql.*;
+import java.util.Properties;
+import java.util.Random;
+
+import static org.apache.phoenix.util.TestUtil.*;
+import static org.junit.Assert.*;
+
+
+public class CursorWithRowValueConstructorIT extends ParallelStatsDisabledIT {
+private static final String TABLE_NAME = "CursorRVCTestTable";
+protected static final Log LOG = 
LogFactory.getLog(CursorWithRowValueConstructorIT.class);
+
+public void createAndInitializeTestTable() throws SQLException {
+Connection conn = DriverManager.getConnection(getUrl());
+
+PreparedStatement stmt = conn.prepareStatement("CREATE TABLE IF NOT 
EXISTS " + TABLE_NAME +
+"(a_id INTEGER NOT NULL, " +
+"a_data INTEGER, " +
+"CONSTRAINT my_pk PRIMARY KEY (a_id))");
+stmt.execute();
+synchronized (conn){
+conn.commit();
+}
+
+//Upsert test values into the test table
+Random rand = new Random();
+stmt = conn.prepareStatement("UPSERT INTO " + TABLE_NAME +
+"(a_id, a_data) VALUES (?,?)");
+int rowCount = 0;
+while(rowCount < 100){
+stmt.setInt(1, rowCount);
+stmt.setInt(2, rand.nextInt(501));
+stmt.execute();
+++rowCount;

[1/2] phoenix git commit: PHOENIX-3572 Support FETCH NEXT| n ROWS from Cursor (Biju Nair)

2017-05-17 Thread ankit
Repository: phoenix
Updated Branches:
  refs/heads/master 1666e932d -> 2cb617f35


http://git-wip-us.apache.org/repos/asf/phoenix/blob/2cb617f3/phoenix-core/src/main/java/org/apache/phoenix/util/CursorUtil.java
--
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/CursorUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/CursorUtil.java
new file mode 100644
index 000..877c436
--- /dev/null
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/CursorUtil.java
@@ -0,0 +1,189 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.phoenix.util;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.hadoop.hbase.client.Scan;
+import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
+import org.apache.phoenix.compile.QueryPlan;
+import org.apache.phoenix.compile.OrderByCompiler.OrderBy;
+import org.apache.phoenix.execute.CursorFetchPlan;
+import org.apache.phoenix.iterate.CursorResultIterator;
+import org.apache.phoenix.parse.CloseStatement;
+import org.apache.phoenix.parse.DeclareCursorStatement;
+import org.apache.phoenix.parse.OpenStatement;
+import org.apache.phoenix.schema.tuple.Tuple;
+
+public final class CursorUtil {
+
+private static class CursorWrapper {
+private final String cursorName;
+private final String selectSQL;
+private boolean isOpen = false;
+QueryPlan queryPlan;
+ImmutableBytesWritable row;
+ImmutableBytesWritable previousRow;
+private Scan scan;
+private boolean moreValues=true;
+private boolean isReversed;
+private boolean islastCallNext;
+private CursorFetchPlan fetchPlan;
+private int offset = -1;
+private boolean isAggregate;
+
+private CursorWrapper(String cursorName, String selectSQL, QueryPlan 
queryPlan){
+this.cursorName = cursorName;
+this.selectSQL = selectSQL;
+this.queryPlan = queryPlan;
+this.islastCallNext = true;
+this.fetchPlan = new CursorFetchPlan(queryPlan,cursorName);
+isAggregate = fetchPlan.isAggregate();
+}
+
+private synchronized void openCursor(Connection conn) throws 
SQLException {
+if(isOpen){
+return;
+}
+this.scan = this.queryPlan.getContext().getScan();
+
isReversed=OrderBy.REV_ROW_KEY_ORDER_BY.equals(this.queryPlan.getOrderBy());
+isOpen = true;
+}
+
+private void closeCursor() throws SQLException {
+isOpen = false;
+((CursorResultIterator) fetchPlan.iterator()).closeCursor();
+//TODO: Determine if the cursor should be removed from the HashMap 
at this point.
+//Semantically it makes sense that something which is 'Closed' one 
should be able to 'Open' again.
+mapCursorIDQuery.remove(this.cursorName);
+}
+
+private QueryPlan getFetchPlan(boolean isNext, int fetchSize) throws 
SQLException {
+if (!isOpen)
+throw new SQLException("Fetch call on closed cursor '" + 
this.cursorName + "'!");
+
((CursorResultIterator)fetchPlan.iterator()).setFetchSize(fetchSize);
+if (!isAggregate) { 
+if (row!=null){
+scan.setStartRow(row.get());
+}
+}
+return this.fetchPlan;
+}
+
+public void updateLastScanRow(Tuple rowValues,Tuple nextRowValues) {
+   
+this.moreValues = !isReversed ? nextRowValues != null : rowValues 
!= null;
+if(!moreValues()){
+   return;
+}
+if (row == null) {
+row = new ImmutableBytesWritable();
+}
+if (previousRow == null) {
+previousRow = new ImmutableBytesWritable();
+}
+if (nextRowValues != null) {
+nextRowValues.getKey(row);
+} 
+if (rowValues != null) {
+rowValues.getKey(previousRow);
+

Build failed in Jenkins: Phoenix-4.x-HBase-1.1 #391

2017-05-17 Thread Apache Jenkins Server
See 


Changes:

[jamestaylor] PHOENIX-3832 Local Index - Empty resultset for multi-tenant tables

--
[...truncated 43.24 KB...]
Running org.apache.phoenix.expression.function.InstrFunctionTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec - in 
org.apache.phoenix.expression.function.InstrFunctionTest
Running org.apache.phoenix.expression.ArrayFillFunctionTest
Tests run: 14, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.045 sec - in 
org.apache.phoenix.expression.ArrayFillFunctionTest
Running org.apache.phoenix.expression.RegexpReplaceFunctionTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.016 sec - in 
org.apache.phoenix.expression.RegexpReplaceFunctionTest
Running org.apache.phoenix.expression.SqrtFunctionTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.016 sec - in 
org.apache.phoenix.expression.SqrtFunctionTest
Running org.apache.phoenix.expression.CbrtFunctionTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.018 sec - in 
org.apache.phoenix.expression.CbrtFunctionTest
Running org.apache.phoenix.expression.LnLogFunctionTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.054 sec - in 
org.apache.phoenix.expression.LnLogFunctionTest
Running org.apache.phoenix.expression.ColumnExpressionTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.01 sec - in 
org.apache.phoenix.expression.ColumnExpressionTest
Running org.apache.phoenix.expression.AbsFunctionTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.037 sec - in 
org.apache.phoenix.expression.AbsFunctionTest
Running org.apache.phoenix.expression.StringToArrayFunctionTest
Tests run: 35, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.741 sec - in 
org.apache.phoenix.expression.ArrayConcatFunctionTest
Running org.apache.phoenix.query.ConnectionQueryServicesImplTest
Tests run: 20, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.065 sec - in 
org.apache.phoenix.expression.StringToArrayFunctionTest
Running org.apache.phoenix.query.OrderByTest
Tests run: 24, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.402 sec - in 
org.apache.phoenix.index.IndexMaintainerTest
Running org.apache.phoenix.query.ConnectionlessTest
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 21.304 sec - in 
org.apache.phoenix.jdbc.SecureUserConnectionsTest
Running org.apache.phoenix.query.KeyRangeIntersectTest
Tests run: 23, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.078 sec - in 
org.apache.phoenix.expression.RoundFloorCeilExpressionsTest
Running org.apache.phoenix.query.KeyRangeUnionTest
Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.195 sec - in 
org.apache.phoenix.query.KeyRangeIntersectTest
Running org.apache.phoenix.query.HBaseFactoryProviderTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec - in 
org.apache.phoenix.query.HBaseFactoryProviderTest
Running org.apache.phoenix.query.ScannerLeaseRenewalTest
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.102 sec - in 
org.apache.phoenix.query.KeyRangeUnionTest
Running org.apache.phoenix.query.EncodedColumnQualifierCellsListTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.712 sec - in 
org.apache.phoenix.query.ConnectionQueryServicesImplTest
Running org.apache.phoenix.query.KeyRangeMoreTest
Tests run: 22, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.108 sec - in 
org.apache.phoenix.query.EncodedColumnQualifierCellsListTest
Running org.apache.phoenix.query.ParallelIteratorsSplitTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.883 sec - in 
org.apache.phoenix.query.OrderByTest
Running org.apache.phoenix.query.QueryPlanTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.927 sec - in 
org.apache.phoenix.query.ConnectionlessTest
Running org.apache.phoenix.query.PhoenixStatsCacheRemovalListenerTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec - in 
org.apache.phoenix.query.PhoenixStatsCacheRemovalListenerTest
Running org.apache.phoenix.query.KeyRangeCoalesceTest
Tests run: 13, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.095 sec - in 
org.apache.phoenix.query.KeyRangeCoalesceTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.237 sec - in 
org.apache.phoenix.expression.GetSetByteBitFunctionTest
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.925 sec - in 
org.apache.phoenix.query.ParallelIteratorsSplitTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.196 sec - in 
org.apache.phoenix.query.QueryPlanTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.255 sec - in 
org.apache.phoenix.query.KeyRangeMoreTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.782 sec - in