You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by davies <gi...@git.apache.org> on 2015/04/02 01:59:10 UTC

[GitHub] spark pull request: use Literal.create instread of constructor

GitHub user davies opened a pull request:

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

    use Literal.create instread of constructor

    In order to do inbound checking and type conversion, we should use Literal.create() instead of  constructor.

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

    $ git pull https://github.com/davies/spark literal

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

    https://github.com/apache/spark/pull/5320.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 #5320
    
----
commit 5f8c0fdac895ff2d49b53f2c31bfd3b7536b561e
Author: Davies Liu <da...@databricks.com>
Date:   2015-04-01T23:57:14Z

    use Literal.create instread of constructor

----


---
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: [SPARK-6663] [SQL] use Literal.create instread...

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

    https://github.com/apache/spark/pull/5320#issuecomment-88758764
  
    Thanks. Merging in 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 pull request: [SPARK-6663] [SQL] use Literal.create instread...

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

    https://github.com/apache/spark/pull/5320#issuecomment-88750863
  
      [Test build #633 has finished](https://amplab.cs.berkeley.edu/jenkins/job/NewSparkPullRequestBuilder/633/consoleFull) for   PR 5320 at commit [`1667604`](https://github.com/apache/spark/commit/16676049bce59f9f842e2d2b9d59e51ceaf3d170).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.
     * This patch does not change any dependencies.


---
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: use Literal.create instread of constructor

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

    https://github.com/apache/spark/pull/5320#issuecomment-88673311
  
      [Test build #29578 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/29578/consoleFull) for   PR 5320 at commit [`1667604`](https://github.com/apache/spark/commit/16676049bce59f9f842e2d2b9d59e51ceaf3d170).


---
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: use Literal.create instread of constructor

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

    https://github.com/apache/spark/pull/5320#discussion_r27624015
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregates.scala ---
    @@ -505,7 +505,7 @@ case class AverageFunction(expr: Expression, base: AggregateExpression)
       private var count: Long = _
       private val sum = MutableLiteral(zero.eval(null), calcType)
     
    -  private def addFunction(value: Any) = Add(sum, Cast(Literal(value, expr.dataType), calcType))
    +  private def addFunction(value: Any) = Add(sum, Cast(Literal.create(value, expr.dataType), calcType))
    --- End diff --
    
    i think this line is now over 100 chars


---
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: [SPARK-6663] [SQL] use Literal.create instread...

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

    https://github.com/apache/spark/pull/5320#issuecomment-88725778
  
      [Test build #633 has started](https://amplab.cs.berkeley.edu/jenkins/job/NewSparkPullRequestBuilder/633/consoleFull) for   PR 5320 at commit [`1667604`](https://github.com/apache/spark/commit/16676049bce59f9f842e2d2b9d59e51ceaf3d170).


---
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: use Literal.create instread of constructor

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

    https://github.com/apache/spark/pull/5320#issuecomment-88672236
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/29577/
    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 pull request: use Literal.create instread of constructor

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

    https://github.com/apache/spark/pull/5320#issuecomment-88670537
  
      [Test build #29577 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/29577/consoleFull) for   PR 5320 at commit [`5f8c0fd`](https://github.com/apache/spark/commit/5f8c0fdac895ff2d49b53f2c31bfd3b7536b561e).


---
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: use Literal.create instread of constructor

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

    https://github.com/apache/spark/pull/5320#issuecomment-88671724
  
    LGTM as soon as you fix the style issues and jenkins pass.


---
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: [SPARK-6663] [SQL] use Literal.create instread...

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

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


---
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: use Literal.create instread of constructor

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

    https://github.com/apache/spark/pull/5320#discussion_r27624032
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/literals.scala ---
    @@ -62,7 +64,7 @@ object IntegerLiteral {
       }
     }
     
    -case class Literal(value: Any, dataType: DataType) extends LeafExpression {
    +case class Literal protected (value: Any, dataType: DataType) extends LeafExpression {
    --- End diff --
    
    maybe add a comment explaining why this is protected?


---
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: use Literal.create instread of constructor

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

    https://github.com/apache/spark/pull/5320#issuecomment-88672233
  
      [Test build #29577 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/29577/consoleFull) for   PR 5320 at commit [`5f8c0fd`](https://github.com/apache/spark/commit/5f8c0fdac895ff2d49b53f2c31bfd3b7536b561e).
     * This patch **fails Scala style tests**.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `    case class Data(`
      * `    case class Data(`
      * `        s" but class priors vector pi had $`
      * `        s" but class conditionals array theta had $`
      * `    case class Data(word: String, vector: Array[Float])`
      * `class MessageWithHeader extends AbstractReferenceCounted implements FileRegion `
      * `class LinearClassificationModel(LinearModel):`
      * `class LogisticRegressionModel(LinearClassificationModel):`
      * `class SVMModel(LinearClassificationModel):`
      * `class UDFRegistration(object):`
      * `class Analyzer(`
      * `trait CheckAnalysis `
      * `case class CreateStruct(children: Seq[NamedExpression]) extends Expression `
      * `case class Literal protected (value: Any, dataType: DataType) extends LeafExpression `
    
     * This patch does not change any dependencies.


---
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: [SPARK-6663] [SQL] use Literal.create instread...

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

    https://github.com/apache/spark/pull/5320#issuecomment-88703996
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/29578/
    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