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/11/17 03:37:26 UTC

[GitHub] [pinot] walterddr commented on a diff in pull request #9817: [multistage][test] add table expression tests

walterddr commented on code in PR #9817:
URL: https://github.com/apache/pinot/pull/9817#discussion_r1024721308


##########
pinot-query-runtime/src/test/resources/queries/TableExpressions.json:
##########
@@ -0,0 +1,111 @@
+{
+  "where_clause_tests": {
+    "psql": "7.2.2",
+    "tables": {
+      "tbl": {
+        "schema": [
+          {"name": "strCol", "type": "STRING"},
+          {"name": "intCol", "type": "INT"}
+        ],
+        "inputs": [
+          ["foo", 1],
+          ["bar", 2],
+          ["alice", 42],
+          ["bob", 196883]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "sql": "SELECT * FROM {tbl} WHERE intCol > 5"
+      },
+      {
+        "sql": "SELECT * FROM {tbl} WHERE strCol IN ('foo', 'bar')"
+      },
+      {
+        "sql": "SELECT * FROM {tbl} WHERE intCol IN (196883, 42)"
+      },
+      {
+        "sql": "SELECT * FROM {tbl} WHERE strCol IN (SELECT strCol FROM {tbl} WHERE intCol > 100)"
+      },
+      {
+        "sql": "SELECT * FROM {tbl} WHERE intCol < (SELECT SUM(intCol) FROM {tbl} AS b WHERE strCol BETWEEN 'bar' AND 'foo')"
+      },
+      {
+        "sql": "SELECT * FROM {tbl} WHERE intCol BETWEEN 0 AND 100 AND strCol BETWEEN 'bar' AND 'foo'"
+      },
+      {
+        "ignored": true,
+        "comments": "Relation Decorrelator not supported",
+        "sql": "SELECT * FROM {tbl} AS a WHERE a.strCol IN (SELECT b.strCol FROM {tbl} AS b WHERE b.intCol = a.intCol + 1)"
+      },
+      {
+        "ignored": true,
+        "comments": "BETWEEN with a non-deterministic single-value result from sub-query is not supported",
+        "sql": "SELECT * FROM {tbl} AS a WHERE a.intCol BETWEEN (SELECT b.intCol FROM {tbl} AS b WHERE b.intCol = a.intCol + 1) AND 100"
+      },
+      {
+        "ignored": true,
+        "comments": "Relation Decorrelator not supported",
+        "sql": "SELECT * FROM {tbl} AS a WHERE a.intCol BETWEEN (SELECT MIN(b.intCol) FROM {tbl} AS b WHERE b.intCol = a.intCol + 1) AND 100"
+      },
+      {
+        "ignored": true,
+        "comments": "EXISTS not supported",
+        "sql": "SELECT * FROM {tbl} AS a WHERE EXISTS (SELECT strCol FROM {tbl} AS b WHERE b.intCol = a.intCol + 1)"
+      },
+      {
+        "ignored": true,
+        "comments": "Relation Decorrelator not supported",
+        "sql": "SELECT * FROM {tbl} AS a WHERE (SELECT count(*) FROM {tbl} AS b WHERE b.intCol = a.intCol + 1) > 0"
+      }
+    ]
+  },
+  "group_by_and_having_tests": {
+    "psql": "7.2.3",
+    "tables": {
+      "tbl1": {
+        "schema": [
+          {"name": "strCol", "type": "STRING"},
+          {"name": "intCol", "type": "INT"}
+        ],
+        "inputs": [
+          ["a", 3],
+          ["b", 2],
+          ["c", 5],
+          ["a", 1]
+        ]
+      },
+      "tbl2": {
+        "schema": [
+          {"name": "strCol1", "type": "STRING"},
+          {"name": "strCol2", "type": "STRING"},
+          {"name": "intCol", "type": "INT"}
+        ],
+        "inputs": [
+          ["a", "foo", 1],
+          ["a", "bar", 2],
+          ["b", "alice", 42],
+          ["b", "bob", 196883]
+        ]
+      }
+    },
+    "queries": [
+      {
+        "sql": "SELECT strCol FROM {tbl1} GROUP BY strCol"

Review Comment:
   - there's already a multi column group by but i added more
   - also added group by without agg with single/multi columns (distinct basically) 
   - added function call on group by too. (alias will not be covered as they will be in the alias test cases)
   



-- 
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