-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Keep track of which versions of functions we call. - Add comments for pending tests - Add a TODO list of functions to implement
- Loading branch information
Showing
5 changed files
with
131 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Function tests | ||
|
||
This directory contains tests for BigQuery SQL functions, to see if we can run | ||
them on other platforms. | ||
|
||
## Tests to implement | ||
|
||
Here is a list of functions that are high priorities to implement. You can | ||
generate your own version of this list by running `joinery parse | ||
--count-function-calls queries.csv`. | ||
|
||
- [ ] REGEXP_REPLACE(_,_,_) | ||
- [ ] REGEXP_EXTRACT(_,_) | ||
- [ ] COALESCE(*) | ||
- [ ] LOWER(_) | ||
- [ ] TO_HEX(_) | ||
- [ ] SHA256(_) | ||
- [ ] LENGTH(_) | ||
- [ ] CONCAT(*) | ||
- [ ] TRIM(_) | ||
- [ ] ARRAY_TO_STRING(_,_) | ||
- [ ] SUM(_) | ||
- [ ] FARM_FINGERPRINT(_) | ||
- [ ] ANY_VALUE(_) | ||
- [ ] ROW_NUMBER() OVER(..) | ||
- [ ] COUNTIF(_) | ||
- [ ] UPPER(_) | ||
- [ ] ARRAY_AGG(_) | ||
- [ ] DATE_TRUNC(_,_) (special) | ||
- [ ] MIN(_) | ||
- [ ] FORMAT_DATETIME(_,_) | ||
- [ ] RAND() | ||
- [ ] RANK() OVER(..) | ||
- [ ] ARRAY_LENGTH(_) | ||
- [ ] SUM(_) OVER(..) | ||
- [ ] DATETIME_SUB(_,_) | ||
- [ ] DATE_DIFF(_,_,_) (special) | ||
- [ ] CURRENT_DATETIME() | ||
- [ ] DATE_SUB(_,_) | ||
- [ ] EXP(_) | ||
- [ ] MAX(_) | ||
- [ ] GENERATE_UUID() | ||
- [ ] DATE(_) | ||
- [ ] LEAST(_,_) | ||
- [ ] APPROX_QUANTILES(_,_) | ||
- [ ] GENERATE_DATE_ARRAY(_,_,_) | ||
- [ ] DATE_ADD(_,_) | ||
- [ ] LAG(_) OVER(..) | ||
- [ ] DATETIME_DIFF(_,_,_) (special) | ||
- [ ] DATETIME_TRUNC(_,_) (special) | ||
- [ ] FIRST_VALUE(_) OVER(..) | ||
- [ ] DATETIME(_) | ||
- [ ] LEAST(_) |
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,20 @@ | ||
-- pending: snowflake REGEX_EXTRACT needs to be wrapped with REGEXP_SUBSTR | ||
-- pending: sqlite3 No regex fuctions | ||
-- | ||
-- REGEXP_REPLACE, REGEXP_EXTRACT | ||
-- | ||
-- https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions | ||
-- | ||
-- We should consider testing a larger set of regular expression features, | ||
-- because different databases may support different regex syntax. | ||
|
||
CREATE OR REPLACE TABLE __result1 AS | ||
SELECT | ||
REGEXP_REPLACE('foo', r'oo', 'ee') AS replaced, | ||
REGEXP_EXTRACT('foobar', r'o+') AS extracted; | ||
|
||
CREATE OR REPLACE TABLE __expected1 ( | ||
replaced STRING, | ||
extracted STRING, | ||
); | ||
INSERT INTO __expected1 VALUES ('fee', 'oo'); |