-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[multistage] m0ar tests! (binary, boolean, char, time) (#9818)
* [multistage] m0ar tests! (binary, boolean, char, time) Co-authored-by: Rong Rong <[email protected]>
- Loading branch information
Showing
9 changed files
with
324 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
pinot-query-runtime/src/test/resources/queries/BinaryTypes.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"bytea": { | ||
"tables": { | ||
"bytea": { | ||
"schema": [ | ||
{"name": "data", "type": "BYTES"} | ||
], | ||
"inputs": [ | ||
["DEADBEEF"] | ||
] | ||
} | ||
}, | ||
"queries": [ | ||
{ | ||
"psql": "8.4.1", | ||
"description": "should select binary data", | ||
"sql": "SELECT * FROM {bytea}" | ||
}, | ||
{ | ||
"psql": "8.4.1", | ||
"ignored": true, | ||
"comments": [ | ||
"looks like we don't support constants, this is treated as a normal string", | ||
"we also require using calcite syntax for byte strings to parse, which is x'deadbeef' instead", | ||
"of postgres syntax which is '\\xdeadbeaf'" | ||
], | ||
"description": "bytea hex constants", | ||
"sql": "SELECT x'DEADBEEF', data from {bytea}" | ||
}, | ||
{ | ||
"psql": "8.4.2", | ||
"ignored": true, | ||
"comments": [ | ||
"in order to specify bytea constants using escape syntax, we need type casting", | ||
"which we don't support. also, calcite doesn't support the escape syntax for bytes" | ||
], | ||
"description": "bytea escape constants", | ||
"sql": "SELECT CAST('\\046' AS BINARY), data from {bytea}" | ||
} | ||
] | ||
} | ||
} |
130 changes: 130 additions & 0 deletions
130
pinot-query-runtime/src/test/resources/queries/BooleanLogic.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
{ | ||
"boolean_type": { | ||
"tables": { | ||
"bools": { | ||
"schema": [{"name": "b", "type": "BOOLEAN"}], | ||
"inputs": [[true], [false]] | ||
} | ||
}, | ||
"queries": [ | ||
{ | ||
"description": "should support booleans", | ||
"sql": "select b FROM {bools}" | ||
}, | ||
{ | ||
"description": "should support booleans", | ||
"sql": "select true, false FROM {bools}" | ||
}, | ||
{ | ||
"description": "should support booleans", | ||
"sql": "select b FROM {bools} WHERE b" | ||
}, | ||
{ | ||
"description": "should support booleans", | ||
"sql": "select b FROM {bools} WHERE b = false" | ||
}, | ||
{ | ||
"description": "should support boolean literals", | ||
"sql": "select b = true, b = false FROM {bools}" | ||
}, | ||
{ | ||
"description": "should support boolean inequality ", | ||
"sql": "select b != true, b <> false FROM {bools}" | ||
} | ||
] | ||
}, | ||
"boolean_implicit_casting": { | ||
"tables": { | ||
"tbl": { | ||
"schema": [ | ||
{"name": "b", "type": "BOOLEAN"}, | ||
{"name": "i", "type": "INT"}, | ||
{"name": "d", "type": "DOUBLE"}, | ||
{"name": "s", "type": "STRING"}, | ||
{"name": "n", "type": "BIG_DECIMAL"}, | ||
{"name": "t", "type": "TIMESTAMP"}, | ||
{"name": "by", "type": "BYTES"} | ||
], | ||
"inputs": [ | ||
[true, 1, 1.2, "foo", "1.234", "2022-01-02 03:45:00", "DEADBEEF"], | ||
[true, 0, 0.0, "", "0.0", "2022-01-02 03:45:00", "00"], | ||
[false, 1, 1.2, "foo", "1.234", "2022-01-02 03:45:00", "DEADBEEF"], | ||
[false, 0, 0.0, "", "0.0", "2022-01-02 03:45:00", "00"] | ||
] | ||
} | ||
}, | ||
"queries": [ | ||
{ | ||
"note": "to be postgres compatible, this should throw an exception - but various other systems (like H2 and MySQL) support this", | ||
"description": "check implicit cast between boolean and int", | ||
"sql": "select b = i FROM {tbl}" | ||
}, | ||
{ | ||
"description": "check implicit cast between boolean and double", | ||
"sql": "select b = d FROM {tbl}" | ||
}, | ||
{ | ||
"ignored": true, | ||
"comment": "H2 doesn't support this, and behavior is somewhat unclear", | ||
"description": "check implicit cast between boolean and string", | ||
"sql": "select b = s FROM {tbl}" | ||
}, | ||
{ | ||
"description": "check implicit cast between boolean and numeric", | ||
"sql": "select b = n FROM {tbl}" | ||
}, | ||
{ | ||
"description": "implicit cast should fail between boolean and timestamp", | ||
"sql": "select b = t FROM {tbl}", | ||
"expectedException": ".*Cannot apply '=' to arguments.*" | ||
}, | ||
{ | ||
"description": "implicit should fail between boolean and bytes", | ||
"sql": "select b = by FROM {tbl}", | ||
"expectedException": ".*Cannot apply '=' to arguments.*" | ||
} | ||
] | ||
}, | ||
"boolean_logic": { | ||
"tables": { | ||
"bools": { | ||
"schema": [ | ||
{"name": "b1", "type": "BOOLEAN"}, | ||
{"name": "b2", "type": "BOOLEAN"} | ||
], | ||
"inputs": [ | ||
[true, true], | ||
[true, false], | ||
[false, false], | ||
[false, true] | ||
] | ||
} | ||
}, | ||
"queries": [ | ||
{ | ||
"description": "should support AND", | ||
"sql": "select b1 AND b2 FROM {bools}" | ||
}, | ||
{ | ||
"description": "should support OR", | ||
"sql": "select b1 OR b2 FROM {bools}" | ||
}, | ||
{ | ||
"description": "should support NOT", | ||
"sql": "select NOT b1, NOT b2 FROM {bools}" | ||
}, | ||
{ | ||
"description": "should support NOT with order of precedence", | ||
"sql": "select NOT b1 AND b2, NOT b1 OR b2 FROM {bools}" | ||
}, | ||
{ | ||
"description": "should support cascade", | ||
"sql": "select (b1 AND b2) = true FROM {bools}" | ||
}, | ||
{ | ||
"description": "should support combine", | ||
"sql": "select (b1 AND b2) OR (b1 AND b1) FROM {bools}" | ||
} | ||
] | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
pinot-query-runtime/src/test/resources/queries/CharacterTypes.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"fixed_char": { | ||
"ignored": true, | ||
"comment": "we don't support fixed length string types", | ||
"psql": "8.3" | ||
}, | ||
"varchar": { | ||
"tables": { | ||
"varchar": { | ||
"schema": [ | ||
{"name": "str", "type": "STRING"} | ||
], | ||
"inputs": [ | ||
["foo"], | ||
["value with spaces"], | ||
["Οὐχὶ (greek)"], | ||
["แสน (thai)"], | ||
["верстке (russian)"], | ||
["∀x∈ℝ (mathematics)"] | ||
] | ||
} | ||
}, | ||
"queries": [ | ||
{ | ||
"psql": "8.3", | ||
"description": "test different UTF8 string values", | ||
"sql": "SELECT * FROM {varchar}" | ||
}, | ||
{ | ||
"psql": "8.3", | ||
"description": "test inline constants", | ||
"sql": "SELECT 'value with spaces' FROM {varchar}" | ||
}, | ||
{ | ||
"ignored": true, | ||
"comment": "calcite doesn't support parsing non ISO-8859-1 characters as constants", | ||
"psql": "8.3", | ||
"description": "test inline UTF8 constants", | ||
"sql": "SELECT 'Οὐχὶ (greek)' FROM {varchar}" | ||
} | ||
] | ||
} | ||
} |
Oops, something went wrong.