Skip to content

Commit

Permalink
[multistage][hotfix] add special column escape test cases (apache#11737)
Browse files Browse the repository at this point in the history
* test added for table escape
* test added for intermediate tmp table
* mix usages in all select query syntax variances

---------

Co-authored-by: Rong Rong <[email protected]>
  • Loading branch information
walterddr and Rong Rong authored Oct 4, 2023
1 parent fb656c5 commit 7ed9aa3
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions pinot-query-runtime/src/test/resources/queries/SpecialSyntax.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@
["foo", "bob", 3],
["alice", "alice", 4]
]
},
"tbl3" : {
"schema": [
{"name": "dash-column", "type": "STRING"},
{"name": "dot.column", "type": "INT"}
],
"inputs": [
["foo", 1],
["bar", 2]
]
}
},
"queries": [
Expand Down Expand Up @@ -77,6 +87,28 @@
"outputs": [
[3, 1.5, 12.0]
]
},
{
"description": "test explicit escape column name ",
"sql": "SELECT \"dash-column\", \"dot.column\" FROM {tbl3} WHERE \"dot.column\" > 1",
"outputs": [
["bar", 2]
]
},
{
"description": "test explicit escape column name with all possible single-table select syntax",
"sql": "SELECT \"dash-column\", COUNT(*) FROM {tbl3} WHERE \"dash-column\" != 'foo' GROUP BY \"dash-column\" HAVING SUM(\"dot.column\") > 1 ORDER BY 2",
"outputs": [
["bar", 1]
]
},
{
"description": "test explicit escape column name used after the with table and sub query",
"sql": "WITH \"t-a-b-l-e\" AS (SELECT * FROM {tbl3} WHERE \"dash-column\" != 'foo') SELECT \"t-a-b-l-e\".\"dash-column\", COUNT(*) FROM {tbl3} AS tbl LEFT JOIN \"t-a-b-l-e\" ON tbl.\"dot.column\" = \"t-a-b-l-e\".\"dot.column\" GROUP BY 1 ORDER BY SUM(\"t-a-b-l-e\".\"dot.column\")",
"outputs": [
["bar", 1],
[null, 1]
]
}
]
}
Expand Down

0 comments on commit 7ed9aa3

Please sign in to comment.