You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by GitBox <gi...@apache.org> on 2021/08/05 14:34:22 UTC

[GitHub] [phoenix-connectors] richardantal commented on a change in pull request #60: PHOENIX-6524 Hive Connector returns emtpy AND expression when all chi…

richardantal commented on a change in pull request #60:
URL: https://github.com/apache/phoenix-connectors/pull/60#discussion_r683503104



##########
File path: phoenix-hive-base/src/it/java/org/apache/phoenix/hive/HivePhoenixStoreIT.java
##########
@@ -362,4 +362,60 @@ public void testTimestampPredicate() throws Exception {
         createFile(sb.toString(), fullPath);
         runTest(testName, fullPath);
     }
+
+    @Test
+    //This SHOULD test for PHOENIX-6524 when all children of an AND expression are pushed down,
+    //and we were returning an AND expression without children to Hive.
+    //However, this bug didn't trigger in this test, only on an actual deployment
+    public void testCompletelyEliminateAnd() throws Exception {
+        String testName = "testCompletelyEliminateAnd";
+        utility.getTestFileSystem().createNewFile(new Path(hiveLogDir, testName + ".out"));
+        createFile("1\t1\tc_h\td_h\te_h\t2020-01-30 15:10:10\t2020-01-30\th_h\t2020-01-30\tj_h\tk_h\tl_h\tm_h\tn_h\to_h\tp_h\tq_h\tr_h\ts_h\tt_h\tu_h\n", new Path(hiveOutputDir, testName + ".out").toString());
+        createFile(StringUtil.EMPTY_STRING, new Path(hiveLogDir, testName + ".out").toString());
+        StringBuilder sb = new StringBuilder();
+
+        sb.append("CREATE EXTERNAL TABLE TEST_PHX (\n"
+                + "a_h string,\n"
+                + "b_h string,\n"
+                + "c_h string,\n"
+                + "d_h string,\n"
+                + "e_h string,\n"
+                + "f_h string,\n"
+                + "g_h string,\n"
+                + "h_h string,\n"
+                + "i_h string,\n"
+                + "j_h string,\n"
+                + "k_h string,\n"
+                + "l_h string,\n"
+                + "m_h string,\n"
+                + "n_h string,\n"
+                + "o_h string,\n"
+                + "p_h string,\n"
+                + "q_h string,\n"
+                + "r_h string,\n"
+                + "s_h string,\n"
+                + "t_h string,\n"
+                + "u_h string)"

Review comment:
       Do we need all of these columns?
   Wouldn't it result the same outcome with only  a_h b_h f_h?

##########
File path: phoenix-hive-base/src/it/java/org/apache/phoenix/hive/HivePhoenixStoreIT.java
##########
@@ -362,4 +362,60 @@ public void testTimestampPredicate() throws Exception {
         createFile(sb.toString(), fullPath);
         runTest(testName, fullPath);
     }
+
+    @Test
+    //This SHOULD test for PHOENIX-6524 when all children of an AND expression are pushed down,
+    //and we were returning an AND expression without children to Hive.
+    //However, this bug didn't trigger in this test, only on an actual deployment

Review comment:
       I've ran the newly created test without the other changes and it failed for me, despite this comment.
   With the rest of the changes it passes.




-- 
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-unsubscribe@phoenix.apache.org

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