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/21 08:33:12 UTC

[GitHub] [pinot] siddharthteotia commented on a diff in pull request #9826: [multistage][test] add with statement test

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


##########
pinot-query-runtime/src/test/resources/queries/WithStatements.json:
##########
@@ -0,0 +1,81 @@
+{
+  "with_statement_tests": {
+    "psql": "7.8.1",
+    "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": [
+      {
+        "description": "single with with group by",
+        "sql": "WITH w AS ( SELECT strCol, SUM(intCol) AS sumRes FROM {tbl1} GROUP BY strCol ) SELECT strCol, strCol2, sumRes FROM w JOIN {tbl2} ON w.strCol = {tbl2}.strCol1",

Review Comment:
   Can we add an example where the `JOIN` in outer query is done between `WITH` virtual table W and the same table (`tbl1`) used in `WITH` ?



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