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

[GitHub] spark pull request: [SPARK-12256] [SQL] Code refactoring: naming b...

GitHub user gatorsmile opened a pull request:

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

    [SPARK-12256] [SQL] Code refactoring: naming boolean variables

    Hard to read the source codes sometimes if the boolean parameter values are unnamed.
    
    Not sure if this is desirable to the others. If this does not make sense, feel free to close it. 
    
    Thank you! @marmbrus @rxin @cloud-fan 

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

    $ git pull https://github.com/gatorsmile/spark namingBool

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

    https://github.com/apache/spark/pull/10243.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 #10243
    
----
commit 01f60013cfc542423ba0743b357f5dd39a8b6a5e
Author: gatorsmile <ga...@gmail.com>
Date:   2015-12-09T22:33:48Z

    Merge remote-tracking branch 'upstream/master' into withMultiColumns

commit a71d5b1d9df7c26c8287ffbdf1024589e8f665a4
Author: gatorsmile <ga...@gmail.com>
Date:   2015-12-10T03:37:59Z

    naming boolean parameters.

----


---
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-12256] [SQL] Code refactoring: naming b...

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

    https://github.com/apache/spark/pull/10243#issuecomment-163488623
  
    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 pull request: [SPARK-12256] [SQL] Code refactoring: naming b...

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

    https://github.com/apache/spark/pull/10243#issuecomment-163527615
  
    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: [SPARK-12256] [SQL] Code refactoring: naming b...

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

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


---
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-12256] [SQL] Code refactoring: naming b...

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

    https://github.com/apache/spark/pull/10243#issuecomment-163761609
  
    Uh, I see. Thanks again! 


---
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-12256] [SQL] Code refactoring: naming b...

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

    https://github.com/apache/spark/pull/10243#discussion_r47230018
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/JavaTypeInference.scala ---
    @@ -172,7 +172,8 @@ object JavaTypeInference {
           .getOrElse(UnresolvedAttribute(part))
     
         /** Returns the current path or `BoundReference`. */
    -    def getPath: Expression = path.getOrElse(BoundReference(0, inferDataType(typeToken)._1, true))
    +    def getPath: Expression = path.getOrElse(BoundReference(0, inferDataType(typeToken)._1,
    +      nullable = true))
    --- End diff --
    
    i wouldn't wrap this here ... i'd just put the entire body of the function on its own line


---
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-12256] [SQL] Code refactoring: naming b...

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

    https://github.com/apache/spark/pull/10243#issuecomment-163514427
  
    **[Test build #47489 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/47489/consoleFull)** for PR 10243 at commit [`a71d5b1`](https://github.com/apache/spark/commit/a71d5b1d9df7c26c8287ffbdf1024589e8f665a4).


---
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-12256] [SQL] Code refactoring: naming b...

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

    https://github.com/apache/spark/pull/10243#issuecomment-163479444
  
    **[Test build #47481 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/47481/consoleFull)** for PR 10243 at commit [`a71d5b1`](https://github.com/apache/spark/commit/a71d5b1d9df7c26c8287ffbdf1024589e8f665a4).


---
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-12256] [SQL] Code refactoring: naming b...

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

    https://github.com/apache/spark/pull/10243#issuecomment-163488595
  
    **[Test build #47481 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/47481/consoleFull)** for PR 10243 at commit [`a71d5b1`](https://github.com/apache/spark/commit/a71d5b1d9df7c26c8287ffbdf1024589e8f665a4).
     * This patch **fails Spark unit 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 pull request: [SPARK-12256] [SQL] Code refactoring: naming b...

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

    https://github.com/apache/spark/pull/10243#issuecomment-163488624
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/47481/
    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: [SPARK-12256] [SQL] Code refactoring: naming b...

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

    https://github.com/apache/spark/pull/10243#issuecomment-163527520
  
    **[Test build #47489 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/47489/consoleFull)** for PR 10243 at commit [`a71d5b1`](https://github.com/apache/spark/commit/a71d5b1d9df7c26c8287ffbdf1024589e8f665a4).
     * 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 pull request: [SPARK-12256] [SQL] Code refactoring: naming b...

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

    https://github.com/apache/spark/pull/10243#issuecomment-163510257
  
    retest this please


---
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-12256] [SQL] Code refactoring: naming b...

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

    https://github.com/apache/spark/pull/10243#issuecomment-163761077
  
    We allow each parameter to be on its own line (though only if they are long enough to warrant that).  However we prefer to keep the code closer to the left margin.
    ```scala
    def getPath: Expression = 
      path.getOrElse(
        BoundReference(
          0, 
          inferDataType(typeToken)._1, 
          nullable = true))
    ```


---
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-12256] [SQL] Code refactoring: naming b...

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

    https://github.com/apache/spark/pull/10243#issuecomment-163631509
  
    @gatorsmile  can you close this pull request? Knowing when to wrap is pretty important. I think most wrappings you have done are suboptimal here.



---
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-12256] [SQL] Code refactoring: naming b...

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

    https://github.com/apache/spark/pull/10243#issuecomment-163527616
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/47489/
    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: [SPARK-12256] [SQL] Code refactoring: naming b...

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

    https://github.com/apache/spark/pull/10243#issuecomment-163756633
  
    @rxin Sure, let me close it. 
    @marmbrus Thank you for explaining the desired Scala wrapping style! Sorry for spending time on it. 
    
    In the product code I am working on is completely different, each parameter is always in different lines. For example, 
    ```scala
    def getPath: Expression = 
      path.getOrElse(BoundReference(0, 
                                    inferDataType(typeToken)._1, 
                                    nullable = true))
    ```


---
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-12256] [SQL] Code refactoring: naming b...

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

    https://github.com/apache/spark/pull/10243#issuecomment-163720242
  
    +1 to @rxin concerns on wrapping.  A good rule of thumb is to always break at the highest syntatic level (not in the middle of some construct like a list of arguments).  Otherwise you break things up that are actually the same and create an artificial separation.
    
    ```scala
    // No
    def getPath: Expression = path.getOrElse(BoundReference(0, inferDataType(typeToken)._1,
      nullable = true))
    
    // Yes
    def getPath: Expression = 
      path.getOrElse(BoundReference(0, inferDataType(typeToken)._1, nullable = true))
    ```


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