You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/09/26 18:43:11 UTC

[GitHub] [pinot] siddharthteotia commented on a diff in pull request #9456: [multistage][hotfix] fix type cast handling and value literal gen

siddharthteotia commented on code in PR #9456:
URL: https://github.com/apache/pinot/pull/9456#discussion_r980383663


##########
pinot-query-runtime/src/test/java/org/apache/pinot/query/runtime/QueryRunnerTest.java:
##########
@@ -283,14 +290,22 @@ private Object[][] provideTestSql() {
         // Test CAST
         //   - implicit CAST
         new Object[]{"SELECT a.col1, a.col2, AVG(a.col3) FROM a GROUP BY a.col1, a.col2"},
-        new Object[]{"SELECT a.col1, SUM(a.col3) FROM a GROUP BY a.col1 HAVING MIN(a.col3) > 0.5"},
+        new Object[]{"SELECT a.col1 FROM a WHERE a.col3 >= 0.5 AND a.col3 < 0.7 OR a.col3 = 42.0"},
+        new Object[]{"SELECT a.col1, SUM(a.col3) FROM a GROUP BY a.col1 "
+            + " HAVING MIN(a.col3) > 0.5 AND MIN(a.col3) <> 0.7 OR MIN(a.col3) > 30"},
         //   - explicit CAST
         new Object[]{"SELECT a.col1, CAST(SUM(a.col3) AS BIGINT) FROM a GROUP BY a.col1"},
 
         // Test DISTINCT
         //   - distinct value done via GROUP BY with empty expr aggregation list.
         new Object[]{"SELECT a.col2, a.col3 FROM a JOIN b ON a.col1 = b.col1 "
             + " WHERE b.col3 > 0 GROUP BY a.col2, a.col3"},
+
+        // Test optimized constant literal.
+        new Object[]{"SELECT col1 FROM a WHERE col3 > 0 AND col3 < -5"},
+        new Object[]{"SELECT COALESCE(SUM(col3), 0) FROM a WHERE col1 = 'foo' AND col1 = 'bar'"},
+        new Object[]{"SELECT SUM(CAST(col3 AS INTEGER)) FROM a HAVING MIN(col3) BETWEEN 1 AND 0"},

Review Comment:
   For the query at line 307, can we add a test with `CAST to LONG` ?



-- 
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: commits-unsubscribe@pinot.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org