[07/12] phoenix git commit: PHOENIX-2138 Non equality comparisons don't work for ARRAY type columns that are DESC in row key (Dumindu Buddhika)

2015-08-11 Thread jamestaylor
PHOENIX-2138 Non equality comparisons don't work for ARRAY type columns
that are DESC in row key (Dumindu Buddhika)


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

Branch: refs/heads/4.5-HBase-0.98
Commit: aa68b5568483f801bc0fc71ad94bfb3d452b4625
Parents: b1ad90f
Author: ramkrishna ramkrishna.s.vasude...@gmail.com
Authored: Sun Jul 26 12:06:11 2015 +0530
Committer: James Taylor jtay...@salesforce.com
Committed: Tue Aug 11 18:36:52 2015 -0700

--
 .../org/apache/phoenix/end2end/ArrayIT.java | 201 ++-
 .../apache/phoenix/iterate/ExplainTable.java|   4 +-
 .../phoenix/schema/types/PArrayDataType.java|   9 +-
 .../phoenix/schema/types/PhoenixArray.java  |   4 -
 4 files changed, 209 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/aa68b556/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArrayIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArrayIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArrayIT.java
index 89997f4..800a7b4 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArrayIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArrayIT.java
@@ -2038,5 +2038,204 @@ public class ArrayIT extends BaseClientManagedTimeIT {
 assertFalse(rs.next());
 conn.close();
 }
-
+
+@Test
+public void testComparisonOperatorsForDesc1()throws Exception{
+long ts = nextTimestamp();
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 10));
+Connection conn = DriverManager.getConnection(getUrl(), props);
+String ddl = create table a (k varchar array primary key desc);
+conn.createStatement().execute(ddl);
+conn.close();
+
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 30));
+conn = DriverManager.getConnection(getUrl(), props);
+PreparedStatement stmt = conn.prepareStatement(upsert into a values 
(array['a', 'c']));
+stmt.execute();
+conn.commit();
+conn.close();
+
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 40));
+conn = DriverManager.getConnection(getUrl(), props);
+ResultSet rs;
+stmt = conn.prepareStatement(select * from a where k = array['a', 
'b']);
+rs = stmt.executeQuery();
+assertTrue(rs.next());
+}
+
+@Test
+public void testComparisonOperatorsForDesc2()throws Exception{
+long ts = nextTimestamp();
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 10));
+Connection conn = DriverManager.getConnection(getUrl(), props);
+String ddl = create table a (k varchar array primary key desc);
+conn.createStatement().execute(ddl);
+conn.close();
+
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 30));
+conn = DriverManager.getConnection(getUrl(), props);
+PreparedStatement stmt = conn.prepareStatement(upsert into a values 
(array['a', 'c']));
+stmt.execute();
+conn.commit();
+conn.close();
+
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 40));
+conn = DriverManager.getConnection(getUrl(), props);
+ResultSet rs;
+stmt = conn.prepareStatement(select * from a where k = array['a', 
'c']);
+rs = stmt.executeQuery();
+assertTrue(rs.next());
+}
+
+@Test
+public void testComparisonOperatorsForDesc3()throws Exception{
+long ts = nextTimestamp();
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 10));
+Connection conn = DriverManager.getConnection(getUrl(), props);
+String ddl = create table a (k varchar array primary key desc);
+conn.createStatement().execute(ddl);
+conn.close();
+
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 30));
+conn = DriverManager.getConnection(getUrl(), props);
+PreparedStatement stmt = conn.prepareStatement(upsert into a values 
(array['a', 'c']));
+stmt.execute();
+conn.commit();
+conn.close();
+
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 40));
+conn = 

[07/12] phoenix git commit: PHOENIX-2138 Non equality comparisons don't work for ARRAY type columns that are DESC in row key (Dumindu Buddhika)

2015-08-11 Thread jamestaylor
PHOENIX-2138 Non equality comparisons don't work for ARRAY type columns
that are DESC in row key (Dumindu Buddhika)


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

Branch: refs/heads/4.5-HBase-1.1
Commit: 7c8e5f0b91f50bdee27360843079ef3f0d0ed20f
Parents: 9a4f9d8
Author: ramkrishna ramkrishna.s.vasude...@gmail.com
Authored: Sun Jul 26 12:06:11 2015 +0530
Committer: James Taylor jtay...@salesforce.com
Committed: Tue Aug 11 18:44:51 2015 -0700

--
 .../org/apache/phoenix/end2end/ArrayIT.java | 201 ++-
 .../apache/phoenix/iterate/ExplainTable.java|   4 +-
 .../phoenix/schema/types/PArrayDataType.java|   9 +-
 .../phoenix/schema/types/PhoenixArray.java  |   4 -
 4 files changed, 209 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/7c8e5f0b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArrayIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArrayIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArrayIT.java
index 89997f4..800a7b4 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArrayIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArrayIT.java
@@ -2038,5 +2038,204 @@ public class ArrayIT extends BaseClientManagedTimeIT {
 assertFalse(rs.next());
 conn.close();
 }
-
+
+@Test
+public void testComparisonOperatorsForDesc1()throws Exception{
+long ts = nextTimestamp();
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 10));
+Connection conn = DriverManager.getConnection(getUrl(), props);
+String ddl = create table a (k varchar array primary key desc);
+conn.createStatement().execute(ddl);
+conn.close();
+
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 30));
+conn = DriverManager.getConnection(getUrl(), props);
+PreparedStatement stmt = conn.prepareStatement(upsert into a values 
(array['a', 'c']));
+stmt.execute();
+conn.commit();
+conn.close();
+
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 40));
+conn = DriverManager.getConnection(getUrl(), props);
+ResultSet rs;
+stmt = conn.prepareStatement(select * from a where k = array['a', 
'b']);
+rs = stmt.executeQuery();
+assertTrue(rs.next());
+}
+
+@Test
+public void testComparisonOperatorsForDesc2()throws Exception{
+long ts = nextTimestamp();
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 10));
+Connection conn = DriverManager.getConnection(getUrl(), props);
+String ddl = create table a (k varchar array primary key desc);
+conn.createStatement().execute(ddl);
+conn.close();
+
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 30));
+conn = DriverManager.getConnection(getUrl(), props);
+PreparedStatement stmt = conn.prepareStatement(upsert into a values 
(array['a', 'c']));
+stmt.execute();
+conn.commit();
+conn.close();
+
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 40));
+conn = DriverManager.getConnection(getUrl(), props);
+ResultSet rs;
+stmt = conn.prepareStatement(select * from a where k = array['a', 
'c']);
+rs = stmt.executeQuery();
+assertTrue(rs.next());
+}
+
+@Test
+public void testComparisonOperatorsForDesc3()throws Exception{
+long ts = nextTimestamp();
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 10));
+Connection conn = DriverManager.getConnection(getUrl(), props);
+String ddl = create table a (k varchar array primary key desc);
+conn.createStatement().execute(ddl);
+conn.close();
+
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 30));
+conn = DriverManager.getConnection(getUrl(), props);
+PreparedStatement stmt = conn.prepareStatement(upsert into a values 
(array['a', 'c']));
+stmt.execute();
+conn.commit();
+conn.close();
+
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 40));
+conn = 

phoenix git commit: PHOENIX-2138 Non equality comparisons don't work for ARRAY type columns that are DESC in row key (Dumindu Buddhika)

2015-07-26 Thread ramkrishna
Repository: phoenix
Updated Branches:
  refs/heads/master ce8980553 - 69f22b515


PHOENIX-2138 Non equality comparisons don't work for ARRAY type columns
that are DESC in row key (Dumindu Buddhika)


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

Branch: refs/heads/master
Commit: 69f22b5151e40645b4968a787e55d0155b128855
Parents: ce89805
Author: ramkrishna ramkrishna.s.vasude...@gmail.com
Authored: Sun Jul 26 12:06:11 2015 +0530
Committer: ramkrishna ramkrishna.s.vasude...@gmail.com
Committed: Sun Jul 26 12:08:59 2015 +0530

--
 .../org/apache/phoenix/end2end/ArrayIT.java | 201 ++-
 .../apache/phoenix/iterate/ExplainTable.java|   4 +-
 .../phoenix/schema/types/PArrayDataType.java|   9 +-
 .../phoenix/schema/types/PhoenixArray.java  |   4 -
 4 files changed, 209 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/69f22b51/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArrayIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArrayIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArrayIT.java
index 89997f4..800a7b4 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArrayIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArrayIT.java
@@ -2038,5 +2038,204 @@ public class ArrayIT extends BaseClientManagedTimeIT {
 assertFalse(rs.next());
 conn.close();
 }
-
+
+@Test
+public void testComparisonOperatorsForDesc1()throws Exception{
+long ts = nextTimestamp();
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 10));
+Connection conn = DriverManager.getConnection(getUrl(), props);
+String ddl = create table a (k varchar array primary key desc);
+conn.createStatement().execute(ddl);
+conn.close();
+
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 30));
+conn = DriverManager.getConnection(getUrl(), props);
+PreparedStatement stmt = conn.prepareStatement(upsert into a values 
(array['a', 'c']));
+stmt.execute();
+conn.commit();
+conn.close();
+
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 40));
+conn = DriverManager.getConnection(getUrl(), props);
+ResultSet rs;
+stmt = conn.prepareStatement(select * from a where k = array['a', 
'b']);
+rs = stmt.executeQuery();
+assertTrue(rs.next());
+}
+
+@Test
+public void testComparisonOperatorsForDesc2()throws Exception{
+long ts = nextTimestamp();
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 10));
+Connection conn = DriverManager.getConnection(getUrl(), props);
+String ddl = create table a (k varchar array primary key desc);
+conn.createStatement().execute(ddl);
+conn.close();
+
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 30));
+conn = DriverManager.getConnection(getUrl(), props);
+PreparedStatement stmt = conn.prepareStatement(upsert into a values 
(array['a', 'c']));
+stmt.execute();
+conn.commit();
+conn.close();
+
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 40));
+conn = DriverManager.getConnection(getUrl(), props);
+ResultSet rs;
+stmt = conn.prepareStatement(select * from a where k = array['a', 
'c']);
+rs = stmt.executeQuery();
+assertTrue(rs.next());
+}
+
+@Test
+public void testComparisonOperatorsForDesc3()throws Exception{
+long ts = nextTimestamp();
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 10));
+Connection conn = DriverManager.getConnection(getUrl(), props);
+String ddl = create table a (k varchar array primary key desc);
+conn.createStatement().execute(ddl);
+conn.close();
+
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 30));
+conn = DriverManager.getConnection(getUrl(), props);
+PreparedStatement stmt = conn.prepareStatement(upsert into a values 
(array['a', 'c']));
+stmt.execute();
+conn.commit();
+conn.close();
+
+

phoenix git commit: PHOENIX-2138 Non equality comparisons don't work for ARRAY type columns that are DESC in row key (Dumindu Buddhika)

2015-07-26 Thread ramkrishna
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.0 19820bd79 - 4e4e2000d


PHOENIX-2138 Non equality comparisons don't work for ARRAY type columns
that are DESC in row key (Dumindu Buddhika)


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

Branch: refs/heads/4.x-HBase-1.0
Commit: 4e4e2000dbbe87cf01fde89800d37b41d6181ab5
Parents: 19820bd
Author: ramkrishna ramkrishna.s.vasude...@gmail.com
Authored: Sun Jul 26 12:06:11 2015 +0530
Committer: ramkrishna ramkrishna.s.vasude...@gmail.com
Committed: Sun Jul 26 12:08:11 2015 +0530

--
 .../org/apache/phoenix/end2end/ArrayIT.java | 201 ++-
 .../apache/phoenix/iterate/ExplainTable.java|   4 +-
 .../phoenix/schema/types/PArrayDataType.java|   9 +-
 .../phoenix/schema/types/PhoenixArray.java  |   4 -
 4 files changed, 209 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/4e4e2000/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArrayIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArrayIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArrayIT.java
index 89997f4..800a7b4 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArrayIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArrayIT.java
@@ -2038,5 +2038,204 @@ public class ArrayIT extends BaseClientManagedTimeIT {
 assertFalse(rs.next());
 conn.close();
 }
-
+
+@Test
+public void testComparisonOperatorsForDesc1()throws Exception{
+long ts = nextTimestamp();
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 10));
+Connection conn = DriverManager.getConnection(getUrl(), props);
+String ddl = create table a (k varchar array primary key desc);
+conn.createStatement().execute(ddl);
+conn.close();
+
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 30));
+conn = DriverManager.getConnection(getUrl(), props);
+PreparedStatement stmt = conn.prepareStatement(upsert into a values 
(array['a', 'c']));
+stmt.execute();
+conn.commit();
+conn.close();
+
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 40));
+conn = DriverManager.getConnection(getUrl(), props);
+ResultSet rs;
+stmt = conn.prepareStatement(select * from a where k = array['a', 
'b']);
+rs = stmt.executeQuery();
+assertTrue(rs.next());
+}
+
+@Test
+public void testComparisonOperatorsForDesc2()throws Exception{
+long ts = nextTimestamp();
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 10));
+Connection conn = DriverManager.getConnection(getUrl(), props);
+String ddl = create table a (k varchar array primary key desc);
+conn.createStatement().execute(ddl);
+conn.close();
+
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 30));
+conn = DriverManager.getConnection(getUrl(), props);
+PreparedStatement stmt = conn.prepareStatement(upsert into a values 
(array['a', 'c']));
+stmt.execute();
+conn.commit();
+conn.close();
+
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 40));
+conn = DriverManager.getConnection(getUrl(), props);
+ResultSet rs;
+stmt = conn.prepareStatement(select * from a where k = array['a', 
'c']);
+rs = stmt.executeQuery();
+assertTrue(rs.next());
+}
+
+@Test
+public void testComparisonOperatorsForDesc3()throws Exception{
+long ts = nextTimestamp();
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 10));
+Connection conn = DriverManager.getConnection(getUrl(), props);
+String ddl = create table a (k varchar array primary key desc);
+conn.createStatement().execute(ddl);
+conn.close();
+
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 30));
+conn = DriverManager.getConnection(getUrl(), props);
+PreparedStatement stmt = conn.prepareStatement(upsert into a values 
(array['a', 'c']));
+stmt.execute();
+conn.commit();
+conn.close();
+
+

phoenix git commit: PHOENIX-2138 Non equality comparisons don't work for ARRAY type columns that are DESC in row key (Dumindu Buddhika)

2015-07-26 Thread ramkrishna
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 8720caae6 - 10fe8f249


PHOENIX-2138 Non equality comparisons don't work for ARRAY type columns
that are DESC in row key (Dumindu Buddhika)


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 10fe8f2494eb1087931253c06639c1dce69ba5ac
Parents: 8720caa
Author: ramkrishna ramkrishna.s.vasude...@gmail.com
Authored: Sun Jul 26 12:06:11 2015 +0530
Committer: ramkrishna ramkrishna.s.vasude...@gmail.com
Committed: Sun Jul 26 12:06:11 2015 +0530

--
 .../org/apache/phoenix/end2end/ArrayIT.java | 201 ++-
 .../apache/phoenix/iterate/ExplainTable.java|   4 +-
 .../phoenix/schema/types/PArrayDataType.java|   9 +-
 .../phoenix/schema/types/PhoenixArray.java  |   4 -
 4 files changed, 209 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/10fe8f24/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArrayIT.java
--
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArrayIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArrayIT.java
index 89997f4..800a7b4 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArrayIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ArrayIT.java
@@ -2038,5 +2038,204 @@ public class ArrayIT extends BaseClientManagedTimeIT {
 assertFalse(rs.next());
 conn.close();
 }
-
+
+@Test
+public void testComparisonOperatorsForDesc1()throws Exception{
+long ts = nextTimestamp();
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 10));
+Connection conn = DriverManager.getConnection(getUrl(), props);
+String ddl = create table a (k varchar array primary key desc);
+conn.createStatement().execute(ddl);
+conn.close();
+
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 30));
+conn = DriverManager.getConnection(getUrl(), props);
+PreparedStatement stmt = conn.prepareStatement(upsert into a values 
(array['a', 'c']));
+stmt.execute();
+conn.commit();
+conn.close();
+
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 40));
+conn = DriverManager.getConnection(getUrl(), props);
+ResultSet rs;
+stmt = conn.prepareStatement(select * from a where k = array['a', 
'b']);
+rs = stmt.executeQuery();
+assertTrue(rs.next());
+}
+
+@Test
+public void testComparisonOperatorsForDesc2()throws Exception{
+long ts = nextTimestamp();
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 10));
+Connection conn = DriverManager.getConnection(getUrl(), props);
+String ddl = create table a (k varchar array primary key desc);
+conn.createStatement().execute(ddl);
+conn.close();
+
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 30));
+conn = DriverManager.getConnection(getUrl(), props);
+PreparedStatement stmt = conn.prepareStatement(upsert into a values 
(array['a', 'c']));
+stmt.execute();
+conn.commit();
+conn.close();
+
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 40));
+conn = DriverManager.getConnection(getUrl(), props);
+ResultSet rs;
+stmt = conn.prepareStatement(select * from a where k = array['a', 
'c']);
+rs = stmt.executeQuery();
+assertTrue(rs.next());
+}
+
+@Test
+public void testComparisonOperatorsForDesc3()throws Exception{
+long ts = nextTimestamp();
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 10));
+Connection conn = DriverManager.getConnection(getUrl(), props);
+String ddl = create table a (k varchar array primary key desc);
+conn.createStatement().execute(ddl);
+conn.close();
+
+props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts 
+ 30));
+conn = DriverManager.getConnection(getUrl(), props);
+PreparedStatement stmt = conn.prepareStatement(upsert into a values 
(array['a', 'c']));
+stmt.execute();
+conn.commit();
+conn.close();
+
+