Skip to content

[SPARK-36683][SQL] Add new built-in SQL functions: SEC and CSC - #33988

Closed
yutoacts wants to merge 18 commits into
apache:masterfrom
yutoacts:SPARK-36683
Closed

[SPARK-36683][SQL] Add new built-in SQL functions: SEC and CSC#33988
yutoacts wants to merge 18 commits into
apache:masterfrom
yutoacts:SPARK-36683

Conversation

@yutoacts

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Add new built-in SQL functions: secant and cosecant, and add them as Scala and Python functions.

Why are the changes needed?

Cotangent has been supported in Spark SQL but Secant and Cosecant are missing though I believe they can be used as much as cot.
Related Links: SPARK-20751SPARK-36660

Does this PR introduce any user-facing change?

Yes, users can now use these functions.

How was this patch tested?

Unit tests

@sarutaksarutak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yutoacts Than you for adding these new built-in functions.
Could you add tests to MathFunctionsSuite and test_functions.py?

Comment threadsql/core/src/test/resources/sql-tests/inputs/operators.sql Outdated
Comment threadsql/core/src/test/resources/sql-tests/results/operators.sql.out Outdated
@sarutak

Copy link
Copy Markdown
Member

Jenkins, add to whitelist.

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/47745/

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/47745/

@sarutak

sarutak commented Sep 14, 2021

Copy link
Copy Markdown
Member

For the Python code, it's better to follow @HyukjinKwon 's comments in #33992

@SparkQA

Copy link
Copy Markdown

Test build #143242 has finished for PR 33988 at commit 9ce80cb.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@yutoacts

Copy link
Copy Markdown
ContributorAuthor

For the Python code, it's better to follow @HyukjinKwon 's comments in #33992

OK, and seems like #33992 could conflict with this PR. I'll wait for it to be merged before pushing test_functions.py.

@SparkQA

Copy link
Copy Markdown

Test build #143292 has finished for PR 33988 at commit 105631e.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test unable to build dist.

exiting with code: 1
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/47795/

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/47798/

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/47798/

@SparkQA

Copy link
Copy Markdown

Test build #143295 has finished for PR 33988 at commit abc64b6.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/47899/

@SparkQA

Copy link
Copy Markdown

Test build #143400 has finished for PR 33988 at commit f0b0887.

  • This patch fails Python style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@sarutak

Copy link
Copy Markdown
Member

@yutoacts you can use dev/lint-python to check style for Python code.

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/47906/

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/47906/

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/47907/

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/47907/

@yutoacts

Copy link
Copy Markdown
ContributorAuthor

@yutoacts you can use dev/lint-python to check style for Python code.

Thank you. It should be fixed now.

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/47910/

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/47910/

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/47912/

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/47915/

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/47915/

@SparkQA

Copy link
Copy Markdown

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/47912/

@SparkQA

Copy link
Copy Markdown

Test build #143402 has finished for PR 33988 at commit bf2179a.

  • This patch fails PySpark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA

Copy link
Copy Markdown

Test build #143404 has finished for PR 33988 at commit a67b93f.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA

Copy link
Copy Markdown

Test build #143407 has finished for PR 33988 at commit 0578140.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@sarutak

Copy link
Copy Markdown
Member

Merged to master. Thanks @yutoacts .

@yutoacts
yutoacts deleted the SPARK-36683 branch September 22, 2021 06:12
HyukjinKwon pushed a commit that referenced this pull request Sep 23, 2021
### What changes were proposed in this pull request?
Add secant and cosecant as R functions.
### Why are the changes needed?
[SEC and CSC have been added](#33988) thus these functions need R support.
### Does this PR introduce _any_ user-facing change?
Yes, users can now call those functions as R functions.
### How was this patch tested?
unit tests added.
Closes#34067 from yutoacts/SPARK-36824.
Authored-by: Yuto Akutsu <yuto.akutsu@oss.nttdata.com>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@yutoacts@sarutak@SparkQA@HyukjinKwon