-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-36683][SQL] Add new built-in SQL functions: SEC and CSC #33988
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
Changes from all commits
e60f6a1
48b3247
9ce80cb
068432b
105631e
abc64b6
937a3c8
0b808e2
e0e90a1
47f8fe2
90d1f4e
6454b2c
9bc8d5f
f0b0887
2df5825
bf2179a
a67b93f
0578140
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,7 @@ | |
| # | ||
|
|
||
| import datetime | ||
| import math | ||
| import os | ||
| import shutil | ||
| import tempfile | ||
|
|
@@ -243,6 +244,13 @@ def function(self, *functions): | |
| for f in functions: | ||
| self.spark.sql("DROP FUNCTION IF EXISTS %s" % f) | ||
|
|
||
| @staticmethod | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I moved get_values and assert_close and combined them as a static method under SQLTestUtils as I don't see any function on the top-level statement.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah looks good. |
||
| def assert_close(a, b): | ||
| c = [j[0] for j in b] | ||
| diff = [abs(v - c[k]) < 1e-6 if math.isfinite(v) else v == c[k] | ||
| for k, v in enumerate(a)] | ||
| return sum(diff) == len(a) | ||
|
|
||
|
|
||
| class ReusedSQLTestCase(ReusedPySparkTestCase, SQLTestUtils): | ||
| @classmethod | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
Shall we add a short description?
Uh oh!
There was an error while loading. Please reload this page.
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.
Thank you, just added a description to all trig functions that missed it.