virajjasani commented on code in PR #1978:
URL: https://github.com/apache/phoenix/pull/1978#discussion_r1759638845


##########
phoenix-core/src/it/java/org/apache/phoenix/end2end/index/PartialIndexIT.java:
##########
@@ -1053,4 +1053,35 @@ public void testPartialIndexWithIndexHint() throws 
Exception {
             assertFalse(rs.next());
         }
     }
+
+    @Test
+    public void testPartialIndexOnTableWithCaseSensitiveColumns() throws 
Exception {
+        try(Connection conn = DriverManager.getConnection(getUrl());
+            Statement stmt = conn.createStatement()) {
+            String dataTableName = generateUniqueName();
+            String indexName1 = generateUniqueName();
+            String indexName2 = generateUniqueName();
+            String indexName3 = generateUniqueName();
+
+            stmt.execute("CREATE TABLE " + dataTableName
+                    + " (\"hashKeY\" VARCHAR NOT NULL PRIMARY KEY, v1 VARCHAR, 
\"CoL\" VARCHAR, \"coLUmn3\" VARCHAR)");
+
+            stmt.execute("CREATE INDEX " + indexName1
+                    + " ON " + dataTableName + "(v1) INCLUDE (\"CoL\") WHERE 
\"coLUmn3\" IS NOT NULL");
+            stmt.execute("CREATE INDEX " + indexName2
+                    + " ON " + dataTableName + "(\"CoL\") INCLUDE (v1) WHERE 
\"coLUmn3\" IS NOT NULL");
+            stmt.execute("CREATE INDEX " + indexName3
+                    + " ON " + dataTableName + "(\"coLUmn3\") INCLUDE 
(\"CoL\") WHERE v1 IS NOT NULL");
+
+            stmt.execute("UPSERT INTO " + dataTableName + " VALUES ('a', 'b', 
'c', 'd')");
+            conn.commit();
+
+            ResultSet rs = stmt.executeQuery("SELECT \"CoL\", \"coLUmn3\" FROM 
" + dataTableName + " WHERE v1='b'");
+            Assert.assertTrue(rs.next());
+            rs = stmt.executeQuery("SELECT v1, \"coLUmn3\" FROM " + 
dataTableName + " WHERE \"CoL\"='c'");
+            Assert.assertTrue(rs.next());
+            rs = stmt.executeQuery("SELECT \"CoL\", v1 FROM " + dataTableName 
+ " WHERE \"coLUmn3\"='d'");
+            Assert.assertTrue(rs.next());

Review Comment:
   nit: just one last thing, if you can also validate using ExplainPlanV2 that 
the table being used by the SELECT query is index table, it would be great.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@phoenix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to