Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Rong Rong committed Nov 17, 2022
1 parent cd42e43 commit 73ed469
Showing 1 changed file with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
{ "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 intCol NOT IN (196883, 42) AND strCol IN ('alice')" },
{ "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'" },
{ "sql": "SELECT * FROM {tbl} WHERE intCol IN (SELECT a.intCol FROM {tbl} AS a JOIN {tbl} AS b ON a.strCol = b.strCol WHERE MOD(a.intCol, 2) = MOD(b.intCol, 2))" },
{
"ignored": true,
"comments": "Relation Decorrelator not supported",
Expand All @@ -39,9 +41,14 @@
},
{
"ignored": true,
"comments": "EXISTS not supported",
"comments": "Relation Decorrelator 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 NOT EXISTS (SELECT strCol FROM {tbl} AS b WHERE b.intCol = a.intCol + 1)"
},
{
"ignored": true,
"comments": "Relation Decorrelator not supported",
Expand Down Expand Up @@ -87,7 +94,17 @@
{ "sql": "SELECT MOD(b.intCol, 2), sum(a.intCol) AS colAlias FROM {tbl1} a INNER JOIN {tbl2} b ON a.strCol = b.strCol1 GROUP BY MOD(b.intCol, 2)" },
{ "sql": "SELECT strCol, SUM(intCol) FROM {tbl1} GROUP BY strCol HAVING SUM(intCol) > 3" },
{ "sql": "SELECT strCol, SUM(intCol) FROM {tbl1} GROUP BY strCol HAVING AVG(intCol) > 1 AND MIN(intCol) < 10" },
{ "sql": "SELECT strCol, b.strCol2, (sum(a.intCol) * b.intCol) AS colAlias FROM {tbl1} a INNER JOIN {tbl2} b ON a.strCol = b.strCol1 GROUP BY strCol, b.strCol2, b.intCol HAVING avg(a.intCol) < 100" }
{ "sql": "SELECT strCol, b.strCol2, (sum(a.intCol) * b.intCol) AS colAlias FROM {tbl1} a INNER JOIN {tbl2} b ON a.strCol = b.strCol1 GROUP BY strCol, b.strCol2, b.intCol HAVING avg(a.intCol) < 100" },
{
"ignored": true,
"comment": "correlation is not supported. ALL is only supported if expand = false",
"sql": "SELECT strCol, SUM(intCol) FROM {tbl1} GROUP BY strCol HAVING AVG(intCol) >= ALL (SELECT AVG(intCol) FROM {tbl1} GROUP BY strCol)"
},
{
"ignored": true,
"comment": "correlation is not supported. SOME is only supported if expand = false",
"sql": "SELECT strCol, SUM(intCol) FROM {tbl1} GROUP BY strCol HAVING AVG(intCol) >= ANY (SELECT AVG(intCol) FROM {tbl1} GROUP BY strCol)"
}
]
}
}

0 comments on commit 73ed469

Please sign in to comment.