-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Case statements for the RANGE type. #415
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Hi @vlulla thanks for your submission ! For the CLA check - please visit https://cla.developers.google.com/. Once you've signed, follow the "New Contributors" link at the bottom of that page to update this check. Do you mind also adding a few test cases in the test_cases file for the new type? It should follow the format for the other types and you can add yours below. When you're finished, the |
Error thrown: Column 1 in UNION ALL has incompatible types: RANGE, RANGE, RANGE at [5:3]. You'll have to separate the test cases out so each RANGE type has its own generate_udf function |
udfs/community/test_cases.js
Outdated
generate_udf_test("typeof", [ | ||
{ | ||
inputs: [`RANGE<DATE> "[null, 2024-04-25)"`], | ||
expected_output: `"RANGE<DATE>"` | ||
}, | ||
{ | ||
inputs: [`RANGE<DATETIME> "[2021-01-01, 2024-04-25)"`], | ||
expected_output: `"RANGE<DATETIME>"` | ||
}, | ||
{ | ||
inputs: [`RANGE(current_timestamp() - interval 5 day, current_timestamp())`], | ||
expected_output: `"RANGE<TIMESTAMP>"` | ||
}, | ||
|
||
]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generate_udf_test("typeof", [ | |
{ | |
inputs: [`RANGE<DATE> "[null, 2024-04-25)"`], | |
expected_output: `"RANGE<DATE>"` | |
}, | |
{ | |
inputs: [`RANGE<DATETIME> "[2021-01-01, 2024-04-25)"`], | |
expected_output: `"RANGE<DATETIME>"` | |
}, | |
{ | |
inputs: [`RANGE(current_timestamp() - interval 5 day, current_timestamp())`], | |
expected_output: `"RANGE<TIMESTAMP>"` | |
}, | |
]); | |
generate_udf_test("typeof", [ | |
{ | |
inputs: [`RANGE<DATE> "[null, 2024-04-25)"`], | |
expected_output: `"RANGE<DATE>"` | |
}, | |
]); | |
generate_udf_test("typeof", [ | |
{ | |
inputs: [`RANGE<DATETIME> "[2021-01-01, 2024-04-25)"`], | |
expected_output: `"RANGE<DATETIME>"` | |
}, | |
]); | |
generate_udf_test("typeof", [ | |
{ | |
inputs: [`RANGE(current_timestamp() - interval 5 day, current_timestamp())`], | |
expected_output: `"RANGE<TIMESTAMP>"` | |
}, | |
]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Thank you @danieldeleo! Let's see if this takes...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My tests pass, i think, but now getting another failure. In kruskal_wallis
? What am i doing wrong?
I think my tests pass but the build step still fails. The error I get is |
I'll take a look now |
/gcbrun |
Slight modification for the new RANGE type.