phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maryann...@apache.org
Subject git commit: Add test case (ignored) for PHOENIX-63 Can't add null value to a secondary indexed table
Date Thu, 06 Mar 2014 20:37:21 GMT
Repository: incubator-phoenix
Updated Branches:
  refs/heads/master 3931fc90a -> b44ad86aa


Add test case (ignored) for PHOENIX-63 Can't add null value to a secondary indexed table


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

Branch: refs/heads/master
Commit: b44ad86aa88cd620fc19d9746eea6d0272b1345c
Parents: 3931fc9
Author: maryannxue <maryannxue@apache.org>
Authored: Thu Mar 6 15:36:57 2014 -0500
Committer: maryannxue <maryannxue@apache.org>
Committed: Thu Mar 6 15:36:57 2014 -0500

----------------------------------------------------------------------
 .../phoenix/end2end/index/MutableIndexTest.java | 34 ++++++++++++++++++++
 1 file changed, 34 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-phoenix/blob/b44ad86a/phoenix-core/src/test/java/org/apache/phoenix/end2end/index/MutableIndexTest.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/test/java/org/apache/phoenix/end2end/index/MutableIndexTest.java
b/phoenix-core/src/test/java/org/apache/phoenix/end2end/index/MutableIndexTest.java
index b8b0b2f..88d5c63 100644
--- a/phoenix-core/src/test/java/org/apache/phoenix/end2end/index/MutableIndexTest.java
+++ b/phoenix-core/src/test/java/org/apache/phoenix/end2end/index/MutableIndexTest.java
@@ -822,4 +822,38 @@ public class MutableIndexTest extends BaseMutableIndexTest {
             conn.close();
         }
     }
+
+    @Ignore("PHOENIX-63")
+    @Test
+    public void testNullValueIndexKey() throws Exception {
+        Properties props = new Properties(TEST_PROPERTIES);
+        Connection conn = DriverManager.getConnection(getUrl(), props);
+        conn.setAutoCommit(false);
+        try {
+            String ddl = "CREATE TABLE DEMO(R VARCHAR PRIMARY KEY, A DOUBLE, C VARCHAR)";
+            conn.createStatement().execute(ddl);
+            ddl = "CREATE INDEX IDX_DEMO ON DEMO (A) INCLUDE (C)";
+            conn.createStatement().execute(ddl);
+    
+            PreparedStatement stmt = conn.prepareStatement("upsert into DEMO values(?, ?,
?)");
+            stmt.setString(1, "r1");
+            stmt.setString(2, null);
+            stmt.setString(3, "c1");
+            stmt.executeUpdate();
+            conn.commit();
+            
+            String query = "select * from DEMO"; 
+            ResultSet rs = conn.createStatement().executeQuery("EXPLAIN " + query);
+            assertEquals("CLIENT PARALLEL 1-WAY FULL SCAN OVER IDX_DEMO", QueryUtil.getExplainPlan(rs));
+            
+            rs = conn.createStatement().executeQuery(query);
+            assertTrue(rs.next());
+            assertEquals("r1", rs.getString(1));
+            assertNull(rs.getString(2));
+            assertEquals("c1", rs.getString(3));
+            assertFalse(rs.next());
+        } finally {
+            conn.close();
+        }
+    }
 }


Mime
View raw message