You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by wangyum <gi...@git.apache.org> on 2017/05/16 10:47:22 UTC

[GitHub] spark pull request #17999: [SPARK-20751][SQL] Add built-in SQL Function - CO...

GitHub user wangyum opened a pull request:

    https://github.com/apache/spark/pull/17999

    [SPARK-20751][SQL] Add built-in SQL Function - COT

    ## What changes were proposed in this pull request?
    
    Add built-in SQL Function - COT.
    
    ## How was this patch tested?
    
    unit tests


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/wangyum/spark SPARK-20751

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/17999.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #17999
    
----
commit d30484c4012cfee52f2abb6c8254461c86ff371f
Author: Yuming Wang <wg...@gmail.com>
Date:   2017-05-16T10:40:18Z

    Add cotangent function.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17999: [SPARK-20751][SQL] Add built-in SQL Function - COT

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17999
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17999: [SPARK-20751][SQL] Add built-in SQL Function - CO...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17999#discussion_r116811946
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala ---
    @@ -544,6 +544,28 @@ case class Sqrt(child: Expression) extends UnaryMathExpression(math.sqrt, "SQRT"
     case class Tan(child: Expression) extends UnaryMathExpression(math.tan, "TAN")
     
     @ExpressionDescription(
    +  usage = "_FUNC_(expr) - Returns the cotangent of `expr`.",
    +  extended = """
    +    Examples:
    +      > SELECT _FUNC_(1);
    +       0.6420926159343306
    +  """)
    +case class Cot(child: Expression)
    +  extends UnaryMathExpression((x: Double) => 1 / math.tan(x), "COT") {
    +  override def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = {
    +    nullSafeCodeGen(ctx, ev, c =>
    --- End diff --
    
    Please use `defineCodeGen`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17999: [SPARK-20751][SQL] Add built-in SQL Function - COT

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17999
  
    **[Test build #76959 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/76959/testReport)** for PR 17999 at commit [`d30484c`](https://github.com/apache/spark/commit/d30484c4012cfee52f2abb6c8254461c86ff371f).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17999: [SPARK-20751][SQL] Add built-in SQL Function - CO...

Posted by maropu <gi...@git.apache.org>.
Github user maropu commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17999#discussion_r116842254
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/functions.scala ---
    @@ -1991,6 +1991,22 @@ object functions {
       def tan(columnName: String): Column = tan(Column(columnName))
     
       /**
    +   * Computes the cotangent of the given column.
    +   *
    +   * @group math_funcs
    +   * @since 2.2.0
    --- End diff --
    
    nit: `2.3.0`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17999: [SPARK-20751][SQL] Add built-in SQL Function - COT

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17999
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17999: [SPARK-20751][SQL] Add built-in SQL Function - CO...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17999#discussion_r117300361
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala ---
    @@ -544,6 +544,24 @@ case class Sqrt(child: Expression) extends UnaryMathExpression(math.sqrt, "SQRT"
     case class Tan(child: Expression) extends UnaryMathExpression(math.tan, "TAN")
     
     @ExpressionDescription(
    +  usage = "_FUNC_(expr) - Returns the cotangent of `expr`.",
    +  extended = """
    +    Examples:
    +      > SELECT _FUNC_(1);
    +       0.6420926159343306
    +  """)
    +case class Cot(child: Expression)
    +  extends UnaryMathExpression((x: Double) => 1 / math.tan(x), "COT") {
    +  override def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = {
    +    defineCodeGen(ctx, ev, c =>
    +      s"""
    +        ${ev.value} = 1 / java.lang.Math.tan($c);
    +      """
    +    )
    --- End diff --
    
    Since it fits one line, could you change it to?
    ```Scala
    defineCodeGen(ctx, ev, c => s"${ev.value} = 1 / java.lang.Math.tan($c);")
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17999: [SPARK-20751][SQL] Add built-in SQL Function - COT

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17999
  
    **[Test build #77041 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77041/testReport)** for PR 17999 at commit [`c80c184`](https://github.com/apache/spark/commit/c80c184d5a9f85e2bff740e8cf96bd9a97d0f8a7).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17999: [SPARK-20751][SQL] Add built-in SQL Function - COT

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17999
  
    **[Test build #77057 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77057/testReport)** for PR 17999 at commit [`3bd1e1e`](https://github.com/apache/spark/commit/3bd1e1e04ba56b9a0f8c30a65993a76142e411f3).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17999: [SPARK-20751][SQL] Add built-in SQL Function - COT

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17999
  
    **[Test build #77025 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77025/testReport)** for PR 17999 at commit [`3782512`](https://github.com/apache/spark/commit/3782512c9d1ff083fb2016e1fabefeee11e8f7bd).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17999: [SPARK-20751][SQL] Add built-in SQL Function - COT

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17999
  
    Merged build finished. Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17999: [SPARK-20751][SQL] Add built-in SQL Function - COT

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/17999
  
    Thanks! Merging to master.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17999: [SPARK-20751][SQL] Add built-in SQL Function - COT

Posted by maropu <gi...@git.apache.org>.
Github user maropu commented on the issue:

    https://github.com/apache/spark/pull/17999
  
    As @gatorsmile said, you need to add tests in `operators.sql` (https://github.com/apache/spark/blob/master/sql/core/src/test/resources/sql-tests/inputs/operators.sql). See `SQLQueryTestSuite` for these test cases.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17999: [SPARK-20751][SQL] Add built-in SQL Function - CO...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17999#discussion_r116860631
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/functions.scala ---
    @@ -1991,6 +1991,22 @@ object functions {
       def tan(columnName: String): Column = tan(Column(columnName))
     
       /**
    +   * Computes the cotangent of the given column.
    +   *
    +   * @group math_funcs
    +   * @since 2.2.0
    +   */
    +  def cot(e: Column): Column = withExpr { Cot(e.expr) }
    +
    +  /**
    +   * Computes the cotangent of the given column name.
    +   *
    +   * @group math_funcs
    +   * @since 2.2.0
    +   */
    +  def cot(colName: String): Column = cot(Column(colName))
    +
    +  /**
    --- End diff --
    
    Sure. Let us keep this file untouched in this PR. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17999: [SPARK-20751][SQL] Add built-in SQL Function - COT

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17999
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/77025/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17999: [SPARK-20751][SQL] Add built-in SQL Function - CO...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17999#discussion_r117298560
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/functions.scala ---
    @@ -1991,6 +1991,14 @@ object functions {
       def tan(columnName: String): Column = tan(Column(columnName))
     
       /**
    +   * Computes the cotangent of the given column.
    +   *
    +   * @group math_funcs
    +   * @since 2.3.0
    +   */
    +  def cot(e: Column): Column = withExpr { Cot(e.expr) }
    --- End diff --
    
    Let us remove this too. Thanks!



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17999: [SPARK-20751][SQL] Add built-in SQL Function - COT

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17999
  
    **[Test build #77025 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77025/testReport)** for PR 17999 at commit [`3782512`](https://github.com/apache/spark/commit/3782512c9d1ff083fb2016e1fabefeee11e8f7bd).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17999: [SPARK-20751][SQL] Add built-in SQL Function - COT

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/17999
  
    Thanks for working on it! 
    
    LGTM except a few minor comments.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17999: [SPARK-20751][SQL] Add built-in SQL Function - COT

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/17999
  
    Thanks for working on it. You need to add it to `FunctionRegistry` and add the SQL-related test cases to `operators.sql`. Also covers all the edge cases. For example, `0` that should trigger infinity, `null`, and so on. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17999: [SPARK-20751][SQL] Add built-in SQL Function - CO...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17999#discussion_r116812132
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala ---
    @@ -544,6 +544,28 @@ case class Sqrt(child: Expression) extends UnaryMathExpression(math.sqrt, "SQRT"
     case class Tan(child: Expression) extends UnaryMathExpression(math.tan, "TAN")
     
     @ExpressionDescription(
    +  usage = "_FUNC_(expr) - Returns the cotangent of `expr`.",
    +  extended = """
    +    Examples:
    +      > SELECT _FUNC_(1);
    +       0.6420926159343306
    +  """)
    +case class Cot(child: Expression)
    +  extends UnaryMathExpression((x: Double) => 1 / math.tan(x), "COT") {
    +  override def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = {
    +    nullSafeCodeGen(ctx, ev, c =>
    +      s"""
    +        if (${ev.value} == null) {
    +          ${ev.isNull} = true;
    --- End diff --
    
    Internally, it is already `nullSafeCodeGen`, and thus, this is not needed. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17999: [SPARK-20751][SQL] Add built-in SQL Function - CO...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17999#discussion_r117298713
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/MathFunctionsSuite.scala ---
    @@ -274,6 +274,13 @@ class MathFunctionsSuite extends QueryTest with SharedSQLContext {
           Row(1, -1))
       }
     
    +  test("cot") {
    +    testOneToOneMathFunction(cot, (d: Double) => 1 / math.tan(d))
    +    checkAnswer(
    +      sql(s"SELECT cot(null), cot(0), cot(-1), cot(${Double.MaxValue})"),
    --- End diff --
    
    Could you move these tests to `operators.sql`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17999: [SPARK-20751][SQL] Add built-in SQL Function - COT

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17999
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/76959/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17999: [SPARK-20751][SQL] Add built-in SQL Function - CO...

Posted by maropu <gi...@git.apache.org>.
Github user maropu commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17999#discussion_r117278957
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/functions.scala ---
    @@ -1991,6 +1991,22 @@ object functions {
       def tan(columnName: String): Column = tan(Column(columnName))
     
       /**
    +   * Computes the cotangent of the given column.
    +   *
    +   * @group math_funcs
    +   * @since 2.3.0
    +   */
    +  def cot(e: Column): Column = withExpr { Cot(e.expr) }
    +
    +  /**
    +   * Computes the cotangent of the given column name.
    +   *
    +   * @group math_funcs
    +   * @since 2.3.0
    +   */
    +  def cot(colName: String): Column = cot(Column(colName))
    +
    +  /**
    --- End diff --
    
    We do not add these functions here in this pr. See: https://github.com/apache/spark/pull/17999#discussion-diff-116842201R2007


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17999: [SPARK-20751][SQL] Add built-in SQL Function - CO...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/17999


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17999: [SPARK-20751][SQL] Add built-in SQL Function - COT

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17999
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/77067/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17999: [SPARK-20751][SQL] Add built-in SQL Function - CO...

Posted by maropu <gi...@git.apache.org>.
Github user maropu commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17999#discussion_r116842201
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/functions.scala ---
    @@ -1991,6 +1991,22 @@ object functions {
       def tan(columnName: String): Column = tan(Column(columnName))
     
       /**
    +   * Computes the cotangent of the given column.
    +   *
    +   * @group math_funcs
    +   * @since 2.2.0
    +   */
    +  def cot(e: Column): Column = withExpr { Cot(e.expr) }
    +
    +  /**
    +   * Computes the cotangent of the given column name.
    +   *
    +   * @group math_funcs
    +   * @since 2.2.0
    +   */
    +  def cot(colName: String): Column = cot(Column(colName))
    +
    +  /**
    --- End diff --
    
    I'm not sure though, do we strictly need to add this function in this file? If we add this in `FunctionRegistry`, you know we can use this thru `selectExpr`. ISTM this file seems to include frequently-used functions only. cc: @gatorsmile 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17999: [SPARK-20751][SQL] Add built-in SQL Function - COT

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17999
  
    **[Test build #77067 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77067/testReport)** for PR 17999 at commit [`ea10dee`](https://github.com/apache/spark/commit/ea10dee343671e3d9c79eb0bcddc55a2ee3d1d71).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17999: [SPARK-20751][SQL] Add built-in SQL Function - COT

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17999
  
    **[Test build #76959 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/76959/testReport)** for PR 17999 at commit [`d30484c`](https://github.com/apache/spark/commit/d30484c4012cfee52f2abb6c8254461c86ff371f).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `case class Cot(child: Expression)`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17999: [SPARK-20751][SQL] Add built-in SQL Function - COT

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17999
  
    **[Test build #77067 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77067/testReport)** for PR 17999 at commit [`ea10dee`](https://github.com/apache/spark/commit/ea10dee343671e3d9c79eb0bcddc55a2ee3d1d71).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17999: [SPARK-20751][SQL] Add built-in SQL Function - COT

Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on the issue:

    https://github.com/apache/spark/pull/17999
  
    hmnmm
    
    seems like we should be following how we test tan, cos, etc in MathExpressionsSuite?
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17999: [SPARK-20751][SQL] Add built-in SQL Function - COT

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17999
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17999: [SPARK-20751][SQL] Add built-in SQL Function - CO...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17999#discussion_r117298871
  
    --- Diff: sql/core/src/test/resources/sql-tests/inputs/operators.sql ---
    @@ -32,6 +32,7 @@ select 1 - 2;
     select 2 * 5;
     select 5 % 3;
     select pmod(-7, 3);
    +select cot(1);
    --- End diff --
    
    Could you move this to the end of this .sql file? It can reduce the line of code changes. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org