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

2019-10-10 Thread Apache Jenkins Server
4.x-HBase-1.3 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.3

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

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

Changes
[monani.mihir] PHOENIX-4306 Add more tests for DESC sort order

[monani.mihir] PHOENIX-5493 Remove unnecesary iteration in BaseResultIterator



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-1.3 | Build Successful

2019-10-10 Thread Apache Jenkins Server
4.x-HBase-1.3 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.3

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

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

Changes
[monani.mihir] PHOENIX-4306 Add more tests for DESC sort order

[monani.mihir] PHOENIX-5493 Remove unnecesary iteration in BaseResultIterator



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


Apache-Phoenix | Master | Build Successful

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

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

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

Changes
[monani.mihir] PHOENIX-4306 Add more tests for DESC sort order

[monani.mihir] PHOENIX-5493 Remove unnecesary iteration in BaseResultIterator



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


Apache Phoenix - Timeout crawler - Build https://builds.apache.org/job/Phoenix-master/2531/

2019-10-10 Thread Apache Jenkins Server
[...truncated 59 lines...]

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

2019-10-10 Thread Apache Jenkins Server
4.x-HBase-1.3 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.3

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

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

Changes
[monani.mihir] PHOENIX-4306 Add more tests for DESC sort order

[monani.mihir] PHOENIX-5493 Remove unnecesary iteration in BaseResultIterator



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


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

2019-10-10 Thread Apache Jenkins Server
See 


Changes:


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

[Phoenix_Compile_Compat_wHBase] $ /bin/bash /tmp/jenkins4732624567408481467.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) 386349
max locked memory   (kbytes, -l) 16384
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
physical id : 0
physical id : 1
MemTotal:   98949828 kB
MemFree: 8853280 kB
Filesystem  Size  Used Avail Use% Mounted on
udev 48G 0   48G   0% /dev
tmpfs   9.5G  1.6M  9.5G   1% /run
/dev/sda3   3.6T  554G  2.9T  16% /
tmpfs48G 0   48G   0% /dev/shm
tmpfs   5.0M 0  5.0M   0% /run/lock
tmpfs48G 0   48G   0% /sys/fs/cgroup
/dev/sda2   473M  158M  292M  36% /boot
tmpfs   9.5G  4.0K  9.5G   1% /run/user/910
/dev/loop0   90M   90M 0 100% /snap/core/7713
/dev/loop1   58M   58M 0 100% /snap/snapcraft/3440
/dev/loop2   55M   55M 0 100% /snap/lxd/11985
/dev/loop3   55M   55M 0 100% /snap/lxd/12100
/dev/loop4   90M   90M 0 100% /snap/core/7917
apache-maven-2.2.1
apache-maven-3.0.5
apache-maven-3.1.1
apache-maven-3.2.5
apache-maven-3.3.9
apache-maven-3.5.4
apache-maven-3.6.0
apache-maven-3.6.2
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'.
[ERROR] Plugin org.codehaus.mojo:findbugs-maven-plugin:2.5.2 or one of its 
dependencies could not be resolved: Failed to read artifact descriptor for 
org.codehaus.mojo:findbugs-maven-plugin:jar:2.5.2: Could not transfer artifact 
org.codehaus.mojo:findbugs-maven-plugin:pom:2.5.2 from/to central 
(https://repo.maven.apache.org/maven2): Received fatal alert: protocol_version 
-> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e 
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please 
read the following articles:
[ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
Build step 'Execute shell' marked build as failure


[phoenix] branch 4.x-HBase-1.4 updated: PHOENIX-5493 Remove unnecesary iteration in BaseResultIterator

2019-10-10 Thread mihir6692
This is an automated email from the ASF dual-hosted git repository.

mihir6692 pushed a commit to branch 4.x-HBase-1.4
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/4.x-HBase-1.4 by this push:
 new b455791  PHOENIX-5493 Remove unnecesary iteration in BaseResultIterator
b455791 is described below

commit b4557919e08bfaf6963d23eb45c8fd934997ce5f
Author: Aman Poonia 
AuthorDate: Thu Oct 10 14:51:24 2019 +0530

PHOENIX-5493 Remove unnecesary iteration in BaseResultIterator
---
 .../src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java| 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
index 8eeca26..45b4d4d 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
@@ -777,6 +777,7 @@ public abstract class BaseResultIterators extends 
ExplainTable implements Result
 for (KeyRange range : ranges) {
 if (!range.isSingleKey()) {
 hasRange = true;
+break;
 }
 }
 slotSpan[offset] = rangeSpan - 1;



[phoenix] branch 4.x-HBase-1.5 updated: PHOENIX-5493 Remove unnecesary iteration in BaseResultIterator

2019-10-10 Thread mihir6692
This is an automated email from the ASF dual-hosted git repository.

mihir6692 pushed a commit to branch 4.x-HBase-1.5
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/4.x-HBase-1.5 by this push:
 new af39354  PHOENIX-5493 Remove unnecesary iteration in BaseResultIterator
af39354 is described below

commit af39354bef95bda66e937b0bcf2d2fac547a935b
Author: Aman Poonia 
AuthorDate: Thu Oct 10 14:51:26 2019 +0530

PHOENIX-5493 Remove unnecesary iteration in BaseResultIterator
---
 .../src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java| 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
index 8eeca26..45b4d4d 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
@@ -777,6 +777,7 @@ public abstract class BaseResultIterators extends 
ExplainTable implements Result
 for (KeyRange range : ranges) {
 if (!range.isSingleKey()) {
 hasRange = true;
+break;
 }
 }
 slotSpan[offset] = rangeSpan - 1;



[phoenix] branch 4.x-HBase-1.3 updated: PHOENIX-5493 Remove unnecesary iteration in BaseResultIterator

2019-10-10 Thread mihir6692
This is an automated email from the ASF dual-hosted git repository.

mihir6692 pushed a commit to branch 4.x-HBase-1.3
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/4.x-HBase-1.3 by this push:
 new 527217b  PHOENIX-5493 Remove unnecesary iteration in BaseResultIterator
527217b is described below

commit 527217bc06feee06e52344ce61e193b39d73af60
Author: Aman Poonia 
AuthorDate: Thu Oct 10 14:51:21 2019 +0530

PHOENIX-5493 Remove unnecesary iteration in BaseResultIterator
---
 .../src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java| 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
index 8eeca26..45b4d4d 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
@@ -777,6 +777,7 @@ public abstract class BaseResultIterators extends 
ExplainTable implements Result
 for (KeyRange range : ranges) {
 if (!range.isSingleKey()) {
 hasRange = true;
+break;
 }
 }
 slotSpan[offset] = rangeSpan - 1;



[phoenix] branch master updated: PHOENIX-5493 Remove unnecesary iteration in BaseResultIterator

2019-10-10 Thread mihir6692
This is an automated email from the ASF dual-hosted git repository.

mihir6692 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/master by this push:
 new bf30a40  PHOENIX-5493 Remove unnecesary iteration in BaseResultIterator
bf30a40 is described below

commit bf30a40006e15b60eb140c974dc4317e4e83de75
Author: Aman Poonia 
AuthorDate: Thu Oct 10 14:50:33 2019 +0530

PHOENIX-5493 Remove unnecesary iteration in BaseResultIterator
---
 .../src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java| 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
index c9899a9..8fd368a 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
@@ -777,6 +777,7 @@ public abstract class BaseResultIterators extends 
ExplainTable implements Result
 for (KeyRange range : ranges) {
 if (!range.isSingleKey()) {
 hasRange = true;
+break;
 }
 }
 slotSpan[offset] = rangeSpan - 1;



[phoenix] branch 4.x-HBase-1.4 updated: PHOENIX-4306 Add more tests for DESC sort order

2019-10-10 Thread mihir6692
This is an automated email from the ASF dual-hosted git repository.

mihir6692 pushed a commit to branch 4.x-HBase-1.4
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/4.x-HBase-1.4 by this push:
 new 771f2a5  PHOENIX-4306 Add more tests for DESC sort order
771f2a5 is described below

commit 771f2a5b69d397afa3cf64f5d67f2b4a4b94e60f
Author: Viraj Jasani 
AuthorDate: Thu Oct 10 14:45:07 2019 +0530

PHOENIX-4306 Add more tests for DESC sort order
---
 .../apache/phoenix/end2end/DescOrderKeysIT.java| 441 +
 1 file changed, 441 insertions(+)

diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/DescOrderKeysIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/DescOrderKeysIT.java
new file mode 100644
index 000..a6ecfd7
--- /dev/null
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/DescOrderKeysIT.java
@@ -0,0 +1,441 @@
+/*
+ * 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 java.math.BigDecimal;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.Statement;
+
+import org.apache.phoenix.compile.QueryPlan;
+import org.apache.phoenix.jdbc.PhoenixStatement;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class DescOrderKeysIT extends ParallelStatsDisabledIT {
+
+  @Test
+  public void testVarCharDescOrderPKs() throws Exception {
+final String tableName = generateUniqueName();
+
+try (Connection conn = DriverManager.getConnection(getUrl())) {
+  conn.setAutoCommit(true);
+  final Statement stmt = conn.createStatement();
+
+  stmt.execute("CREATE TABLE " + tableName +
+" (COL1 VARCHAR, COL2 VARCHAR CONSTRAINT PK PRIMARY KEY (COL1 DESC, 
COL2)) ");
+
+  stmt.execute("UPSERT INTO " + tableName + " (COL1, COL2) VALUES 
('h1uniq1', 'val1')");
+  stmt.execute("UPSERT INTO " + tableName + " (COL1, COL2) VALUES 
('41efh', 'val2')");
+  stmt.execute("UPSERT INTO " + tableName + " (COL1, COL2) VALUES 
('c49ghd', 'val3')");
+  stmt.execute("UPSERT INTO " + tableName + " (COL1, COL2) VALUES 
('4232jfjg', 'val4')");
+  stmt.execute("UPSERT INTO " + tableName + " (COL1, COL2) VALUES 
('zsw4tg', 'val5')");
+  stmt.execute("UPSERT INTO " + tableName + " (COL1, COL2) VALUES 
('93hgwef', 'val6')");
+  stmt.execute("UPSERT INTO " + tableName + " (COL1, COL2) VALUES 
('3jfytw', 'val7')");
+
+  final String sql = "select COL1, COL2 from " + tableName;
+
+  ResultSet rs = stmt.executeQuery(sql);
+  Assert.assertTrue(rs.next());
+
+  QueryPlan plan = stmt.unwrap(PhoenixStatement.class).getQueryPlan();
+  Assert.assertEquals("Expected a single scan ", 1, 
plan.getScans().size());
+  Assert.assertEquals("Expected a single scan ", 1, 
plan.getScans().get(0).size());
+
+  Assert.assertEquals("zsw4tg", rs.getString(1));
+  Assert.assertEquals("val5", rs.getString(2));
+  Assert.assertTrue(rs.next());
+
+  Assert.assertEquals("h1uniq1", rs.getString(1));
+  Assert.assertEquals("val1", rs.getString(2));
+  Assert.assertTrue(rs.next());
+
+  Assert.assertEquals("c49ghd", rs.getString(1));
+  Assert.assertEquals("val3", rs.getString(2));
+  Assert.assertTrue(rs.next());
+
+  Assert.assertEquals("93hgwef", rs.getString(1));
+  Assert.assertEquals("val6", rs.getString(2));
+  Assert.assertTrue(rs.next());
+
+  Assert.assertEquals("4232jfjg", rs.getString(1));
+  Assert.assertEquals("val4", rs.getString(2));
+  Assert.assertTrue(rs.next());
+
+  Assert.assertEquals("41efh", rs.getString(1));
+  Assert.assertEquals("val2", rs.getString(2));
+  Assert.assertTrue(rs.next());
+
+  Assert.assertEquals("3jfytw", rs.getString(1));
+  Assert.assertEquals("val7", rs.getString(2));
+  Assert.assertFalse(rs.next());
+}
+  }
+
+  @Test
+  public void testVarCharDescOrderMultiplePKs() throws Exception {
+final String tableName = generateUniqueName();
+
+try (Connection conn = DriverManager.getConnection(getUrl())) {
+  conn.setAutoCommit(true);
+  final Statement stmt = 

[phoenix] branch 4.x-HBase-1.5 updated: PHOENIX-4306 Add more tests for DESC sort order

2019-10-10 Thread mihir6692
This is an automated email from the ASF dual-hosted git repository.

mihir6692 pushed a commit to branch 4.x-HBase-1.5
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/4.x-HBase-1.5 by this push:
 new 5973ba6  PHOENIX-4306 Add more tests for DESC sort order
5973ba6 is described below

commit 5973ba68efd2603dfac4781d2331c3b1a56b66db
Author: Viraj Jasani 
AuthorDate: Thu Oct 10 14:45:30 2019 +0530

PHOENIX-4306 Add more tests for DESC sort order
---
 .../apache/phoenix/end2end/DescOrderKeysIT.java| 441 +
 1 file changed, 441 insertions(+)

diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/DescOrderKeysIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/DescOrderKeysIT.java
new file mode 100644
index 000..a6ecfd7
--- /dev/null
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/DescOrderKeysIT.java
@@ -0,0 +1,441 @@
+/*
+ * 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 java.math.BigDecimal;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.Statement;
+
+import org.apache.phoenix.compile.QueryPlan;
+import org.apache.phoenix.jdbc.PhoenixStatement;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class DescOrderKeysIT extends ParallelStatsDisabledIT {
+
+  @Test
+  public void testVarCharDescOrderPKs() throws Exception {
+final String tableName = generateUniqueName();
+
+try (Connection conn = DriverManager.getConnection(getUrl())) {
+  conn.setAutoCommit(true);
+  final Statement stmt = conn.createStatement();
+
+  stmt.execute("CREATE TABLE " + tableName +
+" (COL1 VARCHAR, COL2 VARCHAR CONSTRAINT PK PRIMARY KEY (COL1 DESC, 
COL2)) ");
+
+  stmt.execute("UPSERT INTO " + tableName + " (COL1, COL2) VALUES 
('h1uniq1', 'val1')");
+  stmt.execute("UPSERT INTO " + tableName + " (COL1, COL2) VALUES 
('41efh', 'val2')");
+  stmt.execute("UPSERT INTO " + tableName + " (COL1, COL2) VALUES 
('c49ghd', 'val3')");
+  stmt.execute("UPSERT INTO " + tableName + " (COL1, COL2) VALUES 
('4232jfjg', 'val4')");
+  stmt.execute("UPSERT INTO " + tableName + " (COL1, COL2) VALUES 
('zsw4tg', 'val5')");
+  stmt.execute("UPSERT INTO " + tableName + " (COL1, COL2) VALUES 
('93hgwef', 'val6')");
+  stmt.execute("UPSERT INTO " + tableName + " (COL1, COL2) VALUES 
('3jfytw', 'val7')");
+
+  final String sql = "select COL1, COL2 from " + tableName;
+
+  ResultSet rs = stmt.executeQuery(sql);
+  Assert.assertTrue(rs.next());
+
+  QueryPlan plan = stmt.unwrap(PhoenixStatement.class).getQueryPlan();
+  Assert.assertEquals("Expected a single scan ", 1, 
plan.getScans().size());
+  Assert.assertEquals("Expected a single scan ", 1, 
plan.getScans().get(0).size());
+
+  Assert.assertEquals("zsw4tg", rs.getString(1));
+  Assert.assertEquals("val5", rs.getString(2));
+  Assert.assertTrue(rs.next());
+
+  Assert.assertEquals("h1uniq1", rs.getString(1));
+  Assert.assertEquals("val1", rs.getString(2));
+  Assert.assertTrue(rs.next());
+
+  Assert.assertEquals("c49ghd", rs.getString(1));
+  Assert.assertEquals("val3", rs.getString(2));
+  Assert.assertTrue(rs.next());
+
+  Assert.assertEquals("93hgwef", rs.getString(1));
+  Assert.assertEquals("val6", rs.getString(2));
+  Assert.assertTrue(rs.next());
+
+  Assert.assertEquals("4232jfjg", rs.getString(1));
+  Assert.assertEquals("val4", rs.getString(2));
+  Assert.assertTrue(rs.next());
+
+  Assert.assertEquals("41efh", rs.getString(1));
+  Assert.assertEquals("val2", rs.getString(2));
+  Assert.assertTrue(rs.next());
+
+  Assert.assertEquals("3jfytw", rs.getString(1));
+  Assert.assertEquals("val7", rs.getString(2));
+  Assert.assertFalse(rs.next());
+}
+  }
+
+  @Test
+  public void testVarCharDescOrderMultiplePKs() throws Exception {
+final String tableName = generateUniqueName();
+
+try (Connection conn = DriverManager.getConnection(getUrl())) {
+  conn.setAutoCommit(true);
+  final Statement stmt = 

[phoenix] branch 4.x-HBase-1.3 updated: PHOENIX-4306 Add more tests for DESC sort order

2019-10-10 Thread mihir6692
This is an automated email from the ASF dual-hosted git repository.

mihir6692 pushed a commit to branch 4.x-HBase-1.3
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/4.x-HBase-1.3 by this push:
 new 775f645  PHOENIX-4306 Add more tests for DESC sort order
775f645 is described below

commit 775f6450cc33e36f53a23b798b7f9edee16ab125
Author: Viraj Jasani 
AuthorDate: Thu Oct 10 14:44:43 2019 +0530

PHOENIX-4306 Add more tests for DESC sort order
---
 .../apache/phoenix/end2end/DescOrderKeysIT.java| 441 +
 1 file changed, 441 insertions(+)

diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/DescOrderKeysIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/DescOrderKeysIT.java
new file mode 100644
index 000..a6ecfd7
--- /dev/null
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/DescOrderKeysIT.java
@@ -0,0 +1,441 @@
+/*
+ * 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 java.math.BigDecimal;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.Statement;
+
+import org.apache.phoenix.compile.QueryPlan;
+import org.apache.phoenix.jdbc.PhoenixStatement;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class DescOrderKeysIT extends ParallelStatsDisabledIT {
+
+  @Test
+  public void testVarCharDescOrderPKs() throws Exception {
+final String tableName = generateUniqueName();
+
+try (Connection conn = DriverManager.getConnection(getUrl())) {
+  conn.setAutoCommit(true);
+  final Statement stmt = conn.createStatement();
+
+  stmt.execute("CREATE TABLE " + tableName +
+" (COL1 VARCHAR, COL2 VARCHAR CONSTRAINT PK PRIMARY KEY (COL1 DESC, 
COL2)) ");
+
+  stmt.execute("UPSERT INTO " + tableName + " (COL1, COL2) VALUES 
('h1uniq1', 'val1')");
+  stmt.execute("UPSERT INTO " + tableName + " (COL1, COL2) VALUES 
('41efh', 'val2')");
+  stmt.execute("UPSERT INTO " + tableName + " (COL1, COL2) VALUES 
('c49ghd', 'val3')");
+  stmt.execute("UPSERT INTO " + tableName + " (COL1, COL2) VALUES 
('4232jfjg', 'val4')");
+  stmt.execute("UPSERT INTO " + tableName + " (COL1, COL2) VALUES 
('zsw4tg', 'val5')");
+  stmt.execute("UPSERT INTO " + tableName + " (COL1, COL2) VALUES 
('93hgwef', 'val6')");
+  stmt.execute("UPSERT INTO " + tableName + " (COL1, COL2) VALUES 
('3jfytw', 'val7')");
+
+  final String sql = "select COL1, COL2 from " + tableName;
+
+  ResultSet rs = stmt.executeQuery(sql);
+  Assert.assertTrue(rs.next());
+
+  QueryPlan plan = stmt.unwrap(PhoenixStatement.class).getQueryPlan();
+  Assert.assertEquals("Expected a single scan ", 1, 
plan.getScans().size());
+  Assert.assertEquals("Expected a single scan ", 1, 
plan.getScans().get(0).size());
+
+  Assert.assertEquals("zsw4tg", rs.getString(1));
+  Assert.assertEquals("val5", rs.getString(2));
+  Assert.assertTrue(rs.next());
+
+  Assert.assertEquals("h1uniq1", rs.getString(1));
+  Assert.assertEquals("val1", rs.getString(2));
+  Assert.assertTrue(rs.next());
+
+  Assert.assertEquals("c49ghd", rs.getString(1));
+  Assert.assertEquals("val3", rs.getString(2));
+  Assert.assertTrue(rs.next());
+
+  Assert.assertEquals("93hgwef", rs.getString(1));
+  Assert.assertEquals("val6", rs.getString(2));
+  Assert.assertTrue(rs.next());
+
+  Assert.assertEquals("4232jfjg", rs.getString(1));
+  Assert.assertEquals("val4", rs.getString(2));
+  Assert.assertTrue(rs.next());
+
+  Assert.assertEquals("41efh", rs.getString(1));
+  Assert.assertEquals("val2", rs.getString(2));
+  Assert.assertTrue(rs.next());
+
+  Assert.assertEquals("3jfytw", rs.getString(1));
+  Assert.assertEquals("val7", rs.getString(2));
+  Assert.assertFalse(rs.next());
+}
+  }
+
+  @Test
+  public void testVarCharDescOrderMultiplePKs() throws Exception {
+final String tableName = generateUniqueName();
+
+try (Connection conn = DriverManager.getConnection(getUrl())) {
+  conn.setAutoCommit(true);
+  final Statement stmt = 

[phoenix] branch master updated: PHOENIX-4306 Add more tests for DESC sort order

2019-10-10 Thread mihir6692
This is an automated email from the ASF dual-hosted git repository.

mihir6692 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/master by this push:
 new 6bb1a0e  PHOENIX-4306 Add more tests for DESC sort order
6bb1a0e is described below

commit 6bb1a0eaae674f95ca0f6c332328958df28ab297
Author: Viraj Jasani 
AuthorDate: Thu Oct 10 14:31:25 2019 +0530

PHOENIX-4306 Add more tests for DESC sort order
---
 .../apache/phoenix/end2end/DescOrderKeysIT.java| 441 +
 1 file changed, 441 insertions(+)

diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/DescOrderKeysIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/DescOrderKeysIT.java
new file mode 100644
index 000..a6ecfd7
--- /dev/null
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/DescOrderKeysIT.java
@@ -0,0 +1,441 @@
+/*
+ * 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 java.math.BigDecimal;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.Statement;
+
+import org.apache.phoenix.compile.QueryPlan;
+import org.apache.phoenix.jdbc.PhoenixStatement;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class DescOrderKeysIT extends ParallelStatsDisabledIT {
+
+  @Test
+  public void testVarCharDescOrderPKs() throws Exception {
+final String tableName = generateUniqueName();
+
+try (Connection conn = DriverManager.getConnection(getUrl())) {
+  conn.setAutoCommit(true);
+  final Statement stmt = conn.createStatement();
+
+  stmt.execute("CREATE TABLE " + tableName +
+" (COL1 VARCHAR, COL2 VARCHAR CONSTRAINT PK PRIMARY KEY (COL1 DESC, 
COL2)) ");
+
+  stmt.execute("UPSERT INTO " + tableName + " (COL1, COL2) VALUES 
('h1uniq1', 'val1')");
+  stmt.execute("UPSERT INTO " + tableName + " (COL1, COL2) VALUES 
('41efh', 'val2')");
+  stmt.execute("UPSERT INTO " + tableName + " (COL1, COL2) VALUES 
('c49ghd', 'val3')");
+  stmt.execute("UPSERT INTO " + tableName + " (COL1, COL2) VALUES 
('4232jfjg', 'val4')");
+  stmt.execute("UPSERT INTO " + tableName + " (COL1, COL2) VALUES 
('zsw4tg', 'val5')");
+  stmt.execute("UPSERT INTO " + tableName + " (COL1, COL2) VALUES 
('93hgwef', 'val6')");
+  stmt.execute("UPSERT INTO " + tableName + " (COL1, COL2) VALUES 
('3jfytw', 'val7')");
+
+  final String sql = "select COL1, COL2 from " + tableName;
+
+  ResultSet rs = stmt.executeQuery(sql);
+  Assert.assertTrue(rs.next());
+
+  QueryPlan plan = stmt.unwrap(PhoenixStatement.class).getQueryPlan();
+  Assert.assertEquals("Expected a single scan ", 1, 
plan.getScans().size());
+  Assert.assertEquals("Expected a single scan ", 1, 
plan.getScans().get(0).size());
+
+  Assert.assertEquals("zsw4tg", rs.getString(1));
+  Assert.assertEquals("val5", rs.getString(2));
+  Assert.assertTrue(rs.next());
+
+  Assert.assertEquals("h1uniq1", rs.getString(1));
+  Assert.assertEquals("val1", rs.getString(2));
+  Assert.assertTrue(rs.next());
+
+  Assert.assertEquals("c49ghd", rs.getString(1));
+  Assert.assertEquals("val3", rs.getString(2));
+  Assert.assertTrue(rs.next());
+
+  Assert.assertEquals("93hgwef", rs.getString(1));
+  Assert.assertEquals("val6", rs.getString(2));
+  Assert.assertTrue(rs.next());
+
+  Assert.assertEquals("4232jfjg", rs.getString(1));
+  Assert.assertEquals("val4", rs.getString(2));
+  Assert.assertTrue(rs.next());
+
+  Assert.assertEquals("41efh", rs.getString(1));
+  Assert.assertEquals("val2", rs.getString(2));
+  Assert.assertTrue(rs.next());
+
+  Assert.assertEquals("3jfytw", rs.getString(1));
+  Assert.assertEquals("val7", rs.getString(2));
+  Assert.assertFalse(rs.next());
+}
+  }
+
+  @Test
+  public void testVarCharDescOrderMultiplePKs() throws Exception {
+final String tableName = generateUniqueName();
+
+try (Connection conn = DriverManager.getConnection(getUrl())) {
+  conn.setAutoCommit(true);
+  final Statement stmt = conn.createStatement();
+
+