sanjeet006py commented on code in PR #1851:
URL: https://github.com/apache/phoenix/pull/1851#discussion_r1517375166


##########
phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorOffsetIT.java:
##########
@@ -1221,4 +1222,29 @@ public void rvcOffsetTrailingNullKeyTest() throws 
Exception {
         }
     }
 
+    // Test point lookup over data table with index hint and hinted plan is 
not applicable
+    @Test
+    public void testRVCOffsetWithNotApplicableIndexHint() throws Exception {
+        String sql = String.format("SELECT /*+ INDEX(%s %s)*/ %s FROM %s "
+                        + "WHERE t_id = 'b' AND k1 = 2 AND k2 = 3 OFFSET 
(%s)=('a', 1, 2)",
+                TABLE_NAME, INDEX_NAME, 
TABLE_ROW_KEY,TABLE_NAME,TABLE_ROW_KEY);
+        try (Statement statement = conn.createStatement()){
+            ResultSet rs = statement.executeQuery("EXPLAIN " + sql);
+            String actualQueryPlan = QueryUtil.getExplainPlan(rs);
+            // As hinted plan is not applicable so use data plan which is 
point lookup
+            assertTrue(actualQueryPlan.contains("POINT LOOKUP ON 1 KEY OVER " 
+ TABLE_NAME));
+        }
+    }
+
+    @Test
+    public void testRVCOffsetWithNotApplicableAndPointLookup() throws 
Exception {

Review Comment:
   Yes, I added this test as I am doing changes for point lookup case and 
wanted to assert that I am not breaking the scenario where its point lookup but 
no query plan is applicable. Just wanted to be extra sure.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to