Skip to content

Conversation

@yutoacts
Copy link
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-20751 SPARK-36660

Does this PR introduce any user-facing change?

Yes, users can now use these functions.

How was this patch tested?

Unit tests

Copy link
Member

@sarutak sarutak left a comment

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?

@sarutak
Copy link
Member

sarutak commented Sep 14, 2021

Jenkins, add to whitelist.

@SparkQA
Copy link

SparkQA commented Sep 14, 2021

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

@SparkQA
Copy link

SparkQA commented Sep 14, 2021

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

@sarutak
Copy link
Member

sarutak commented Sep 14, 2021

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

@SparkQA
Copy link

SparkQA commented Sep 14, 2021

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
Contributor Author

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

SparkQA commented Sep 15, 2021

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

SparkQA commented Sep 15, 2021

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

SparkQA commented Sep 15, 2021

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

@SparkQA
Copy link

SparkQA commented Sep 15, 2021

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

@SparkQA
Copy link

SparkQA commented Sep 15, 2021

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

SparkQA commented Sep 17, 2021

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

@SparkQA
Copy link

SparkQA commented Sep 17, 2021

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

@SparkQA
Copy link

SparkQA commented Sep 17, 2021

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
Member

sarutak commented Sep 17, 2021

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

@SparkQA
Copy link

SparkQA commented Sep 17, 2021

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

@SparkQA
Copy link

SparkQA commented Sep 17, 2021

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

@SparkQA
Copy link

SparkQA commented Sep 17, 2021

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

@SparkQA
Copy link

SparkQA commented Sep 17, 2021

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

@yutoacts
Copy link
Contributor Author

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

Thank you. It should be fixed now.

@SparkQA
Copy link

SparkQA commented Sep 17, 2021

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

@SparkQA
Copy link

SparkQA commented Sep 17, 2021

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

@SparkQA
Copy link

SparkQA commented Sep 17, 2021

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

@SparkQA
Copy link

SparkQA commented Sep 17, 2021

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

@SparkQA
Copy link

SparkQA commented Sep 17, 2021

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

@SparkQA
Copy link

SparkQA commented Sep 17, 2021

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

@SparkQA
Copy link

SparkQA commented Sep 17, 2021

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

SparkQA commented Sep 17, 2021

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

SparkQA commented Sep 17, 2021

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 sarutak closed this in 30d17b6 Sep 20, 2021
@sarutak
Copy link
Member

sarutak commented Sep 20, 2021

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 <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
Sign up for free to 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