[GitHub] spark pull request #15487: [SPARK-17940][SQL] Fixed a typo in LAST function ...

2016-10-27 Thread lins05
Github user lins05 closed the pull request at:

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


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request #15487: [SPARK-17940][SQL] Fixed a typo in LAST function ...

2016-10-16 Thread HyukjinKwon
Github user HyukjinKwon commented on a diff in the pull request:

https://github.com/apache/spark/pull/15487#discussion_r83565121
  
--- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Last.scala
 ---
@@ -29,15 +29,18 @@ import org.apache.spark.sql.types._
  * a single partition, and we use a single reducer to do the aggregation.).
  */
 @ExpressionDescription(
-  usage = "_FUNC_(expr,isIgnoreNull) - Returns the last value of `child` 
for a group of rows.")
+  usage = """_FUNC_(expr,isIgnoreNull) - Returns the last value of `child` 
for a group of rows.
+_FUNC_(expr,isIgnoreNull=false) - Returns the last value of `child` 
for a group of rows.
--- End diff --

Ah, I thought it should be as below if it dose not affect anything but only 
this:

```sql
spark-sql> DESCRIBE FUNCTION last;
Function: last
Class: org.apache.spark.sql.catalyst.expressions.aggregate.Last
Usage: last(expr,isIgnoreNull) - Returns the last value of `child` for a 
group of rows.
   last(expr,isIgnoreNull=false) - Returns the last value of `child` 
for a group of rows.
 If isIgnoreNull is true, returns only non-null values.
```

This was just my personal opinion.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request #15487: [SPARK-17940][SQL] Fixed a typo in LAST function ...

2016-10-16 Thread lins05
Github user lins05 commented on a diff in the pull request:

https://github.com/apache/spark/pull/15487#discussion_r83551685
  
--- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Last.scala
 ---
@@ -29,15 +29,18 @@ import org.apache.spark.sql.types._
  * a single partition, and we use a single reducer to do the aggregation.).
  */
 @ExpressionDescription(
-  usage = "_FUNC_(expr,isIgnoreNull) - Returns the last value of `child` 
for a group of rows.")
+  usage = """_FUNC_(expr,isIgnoreNull) - Returns the last value of `child` 
for a group of rows.
+_FUNC_(expr,isIgnoreNull=false) - Returns the last value of `child` 
for a group of rows.
--- End diff --

@hvanhovell @HyukjinKwon Thanks for the review. I'm simply following the 
usage string of other functions, e.g:

```
spark-sql> describe function first;
Function: first
Class: org.apache.spark.sql.catalyst.expressions.aggregate.First
Usage: first(expr) - Returns the first value of `child` for a group of rows.
first(expr,isIgnoreNull=false) - Returns the first value of `child` for 
a group of rows.
  If isIgnoreNull is true, returns only non-null values.
   
spark-sql> describe function approx_count_distinct;
Function: approx_count_distinct
Class: 
org.apache.spark.sql.catalyst.expressions.aggregate.HyperLogLogPlusPlus
Usage: approx_count_distinct(expr) - Returns the estimated cardinality by 
HyperLogLog++.
approx_count_distinct(expr, relativeSD=0.05) - Returns the estimated 
cardinality by HyperLogLog++
  with relativeSD, the maximum estimation error allowed.
```

So it seems the current convention is that: the first line is a short 
one-line description, followed by a detail description. Do we have any explicit 
"usage string style" to follow?

@hvanhovell I'll add the note about nondeterministic.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request #15487: [SPARK-17940][SQL] Fixed a typo in LAST function ...

2016-10-14 Thread hvanhovell
Github user hvanhovell commented on a diff in the pull request:

https://github.com/apache/spark/pull/15487#discussion_r83470770
  
--- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Last.scala
 ---
@@ -29,15 +29,18 @@ import org.apache.spark.sql.types._
  * a single partition, and we use a single reducer to do the aggregation.).
  */
 @ExpressionDescription(
-  usage = "_FUNC_(expr,isIgnoreNull) - Returns the last value of `child` 
for a group of rows.")
+  usage = """_FUNC_(expr,isIgnoreNull) - Returns the last value of `child` 
for a group of rows.
+_FUNC_(expr,isIgnoreNull=false) - Returns the last value of `child` 
for a group of rows.
--- End diff --

Why repeat this?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] spark pull request #15487: [SPARK-17940][SQL] Fixed a typo in LAST function ...

2016-10-14 Thread lins05
GitHub user lins05 opened a pull request:

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

[SPARK-17940][SQL] Fixed a typo in LAST function and improved its usage 
string

## What changes were proposed in this pull request?

* Fixed a a typo in the LAST function error message
* Also improved its usage string to match the FIRST function

## How was this patch tested?

Existing tests.


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

$ git pull https://github.com/lins05/spark spark-17940-typo-in-last-func

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

https://github.com/apache/spark/pull/15487.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 #15487


commit 33988d3179edf0f179da11f1b8dfc4d28d9c5d08
Author: Shuai Lin 
Date:   2016-10-14T15:46:07Z

[SPARK-17940][SQL] Fixed a typo in LAST function and improved its usage 
string.




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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