Skip to content

Conversation

@brkyvz
Copy link
Contributor

@brkyvz brkyvz commented Apr 3, 2016

What changes were proposed in this pull request?

The window function was added to Dataset with this PR.
This PR adds the Python, and SQL, API for this function.

With this PR, SQL, Java, and Scala will share the same APIs as in users can use:

  • window(timeColumn, windowDuration)
  • window(timeColumn, windowDuration, slideDuration)
  • window(timeColumn, windowDuration, slideDuration, startTime)

In Python, users can access all APIs above, but in addition they can do

  • In Python:
    window(timeColumn, windowDuration, startTime=...)

that is, they can provide the startTime without providing the slideDuration. In this case, we will generate tumbling windows.

How was this patch tested?

Unit tests + manual tests

@SparkQA
Copy link

SparkQA commented Apr 3, 2016

Test build #54801 has finished for PR 12136 at commit f589469.

  • This patch fails R style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@rxin
Copy link
Contributor

rxin commented Apr 3, 2016

Can we leave all the streaming stuff out of R for now? I don't know whether it makes sense to provide this functionality in R, and even if we do, the current API might change a lot, so having it in fewer languages would make it easier to change.

@rxin
Copy link
Contributor

rxin commented Apr 3, 2016

Ah OK this "window" thing is not streaming specific. I'd still consider breaking them into two separate prs so we can get the python thing in sooner.

@SparkQA
Copy link

SparkQA commented Apr 3, 2016

Test build #54807 has finished for PR 12136 at commit 12e1841.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@brkyvz brkyvz changed the title [SPARK-14353] Dateset Time Window window API for Python, SQL, and R [SPARK-14353] Dataset Time Window window API for Python, and SQL Apr 4, 2016
@SparkQA
Copy link

SparkQA commented Apr 4, 2016

Test build #54820 has finished for PR 12136 at commit e2aa616.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

} else {
newArgs ++ otherCopyArgs
}
val defaultCtor = ctors.find { ctor =>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need a smarter way to pick the constructor, or else the two constructors for TimeWindow cause issues depending on Java version

@SparkQA
Copy link

SparkQA commented Apr 5, 2016

Test build #54906 has finished for PR 12136 at commit a59ad58.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@brkyvz
Copy link
Contributor Author

brkyvz commented Apr 5, 2016

@davies Addressed your comments

@SparkQA
Copy link

SparkQA commented Apr 5, 2016

Test build #54912 has finished for PR 12136 at commit 71fa73f.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Apr 5, 2016

Test build #54913 has finished for PR 12136 at commit c891d75.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Apr 5, 2016

Test build #54933 has finished for PR 12136 at commit 9a3a47f.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Apr 5, 2016

Test build #54952 has finished for PR 12136 at commit 8dec7ca.

  • This patch fails PySpark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Apr 5, 2016

Test build #54961 has finished for PR 12136 at commit 891f448.

  • This patch fails PySpark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Apr 5, 2016

Test build #54999 has finished for PR 12136 at commit 1bd7563.

  • This patch fails PySpark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Apr 5, 2016

Test build #55008 has finished for PR 12136 at commit 68b9de2.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@davies
Copy link
Contributor

davies commented Apr 5, 2016

LGTM, merging this into master, thanks!

@asfgit asfgit closed this in 9ee5c25 Apr 5, 2016
asfgit pushed a commit that referenced this pull request Nov 15, 2016
…n Exception of Function Lookup

### What changes were proposed in this pull request?
When the exception is an invocation exception during function lookup, we return a useless/confusing error message:

For example,
```Scala
df.selectExpr("concat_ws()")
```
Below is the error message we got:
```
null; line 1 pos 0
org.apache.spark.sql.AnalysisException: null; line 1 pos 0
```

To get the meaningful error message, we need to get the cause. The fix is exactly the same as what we did in #12136. After the fix, the message we got is the exception issued in the constuctor of function implementation:
```
requirement failed: concat_ws requires at least one argument.; line 1 pos 0
org.apache.spark.sql.AnalysisException: requirement failed: concat_ws requires at least one argument.; line 1 pos 0
```

### How was this patch tested?
Added test cases.

Author: gatorsmile <gatorsmile@gmail.com>

Closes #15878 from gatorsmile/functionNotFound.

(cherry picked from commit 86430cc)
Signed-off-by: Reynold Xin <rxin@databricks.com>
asfgit pushed a commit that referenced this pull request Nov 15, 2016
…n Exception of Function Lookup

### What changes were proposed in this pull request?
When the exception is an invocation exception during function lookup, we return a useless/confusing error message:

For example,
```Scala
df.selectExpr("concat_ws()")
```
Below is the error message we got:
```
null; line 1 pos 0
org.apache.spark.sql.AnalysisException: null; line 1 pos 0
```

To get the meaningful error message, we need to get the cause. The fix is exactly the same as what we did in #12136. After the fix, the message we got is the exception issued in the constuctor of function implementation:
```
requirement failed: concat_ws requires at least one argument.; line 1 pos 0
org.apache.spark.sql.AnalysisException: requirement failed: concat_ws requires at least one argument.; line 1 pos 0
```

### How was this patch tested?
Added test cases.

Author: gatorsmile <gatorsmile@gmail.com>

Closes #15878 from gatorsmile/functionNotFound.
asfgit pushed a commit that referenced this pull request Nov 16, 2016
…g an Invocation Exception of Function Lookup

### What changes were proposed in this pull request?
This PR is to backport #15878

When the exception is an invocation exception during function lookup, we return a useless/confusing error message:

For example,
```Scala
df.selectExpr("concat_ws()")
```
Below is the error message we got:
```
null; line 1 pos 0
org.apache.spark.sql.AnalysisException: null; line 1 pos 0
```

To get the meaningful error message, we need to get the cause. The fix is exactly the same as what we did in #12136. After the fix, the message we got is the exception issued in the constuctor of function implementation:
```
requirement failed: concat_ws requires at least one argument.; line 1 pos 0
org.apache.spark.sql.AnalysisException: requirement failed: concat_ws requires at least one argument.; line 1 pos 0
```

### How was this patch tested?
Added test cases.

Author: gatorsmile <gatorsmile@gmail.com>

Closes #15902 from gatorsmile/functionNotFound20.
uzadude pushed a commit to uzadude/spark that referenced this pull request Jan 27, 2017
…n Exception of Function Lookup

### What changes were proposed in this pull request?
When the exception is an invocation exception during function lookup, we return a useless/confusing error message:

For example,
```Scala
df.selectExpr("concat_ws()")
```
Below is the error message we got:
```
null; line 1 pos 0
org.apache.spark.sql.AnalysisException: null; line 1 pos 0
```

To get the meaningful error message, we need to get the cause. The fix is exactly the same as what we did in apache#12136. After the fix, the message we got is the exception issued in the constuctor of function implementation:
```
requirement failed: concat_ws requires at least one argument.; line 1 pos 0
org.apache.spark.sql.AnalysisException: requirement failed: concat_ws requires at least one argument.; line 1 pos 0
```

### How was this patch tested?
Added test cases.

Author: gatorsmile <gatorsmile@gmail.com>

Closes apache#15878 from gatorsmile/functionNotFound.
@brkyvz brkyvz deleted the python-windows branch February 3, 2019 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants