Skip to content

Conversation

@lw-lin
Copy link
Contributor

@lw-lin lw-lin commented Dec 31, 2016

What changes were proposed in this pull request?

Currently some code snippets in the programming guide just do not compile. We should fix them.

How was this patch tested?

SKIP_API=1 jekyll build

Screenshot from part of the change:

snip20161231_37

Copy link
Contributor Author

Choose a reason for hiding this comment

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

type won't compile in scala since it is a keyword, hence here change it to deviceType

Copy link
Contributor Author

Choose a reason for hiding this comment

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

file format requires checkpointLocation and path to be explicitly specified

Copy link
Contributor Author

Choose a reason for hiding this comment

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

currently we don't have parquet(...)/csv(...)/text(...)/etc. methods

query.recentProgress // an array of the most recent process updates for this query

query.sinkStatus() // progress information about data written to the output sink
query.lastProgress // the most recent process update of this streaming query
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've wrapped source/sink statuses into recentProcesses/lastProcess

}
@Overrides void onQueryProgress(QueryProgressEvent queryProgress) {
@Override
public void onQueryProgress(QueryProgressEvent queryProgress) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's @Override in java, and these methods must be public

@lw-lin lw-lin changed the title [SPARK-19041[SS] Fix code snippet compilation issues in Structured Streaming Programming Guide [SPARK-19041][SS] Fix code snippet compilation issues in Structured Streaming Programming Guide Dec 31, 2016
@lw-lin
Copy link
Contributor Author

lw-lin commented Dec 31, 2016

@srowen would you take a look, thanks!

// Running average signal for each device type
import org.apache.spark.sql.expressions.scalalang.typed._
ds.groupByKey(_.type).agg(typed.avg(_.signal)) // using typed API
import org.apache.spark.sql.expressions.scalalang.typed
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this import should be ….scalalang.typed rather than ….scalalang.typed._

@SparkQA
Copy link

SparkQA commented Dec 31, 2016

Test build #70763 has finished for PR 16442 at commit c029e25.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class DeviceData(device: String, deviceType: String, signal: Double, time: DateTime)

@SparkQA
Copy link

SparkQA commented Dec 31, 2016

Test build #70764 has finished for PR 16442 at commit 96532ae.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class DeviceData(device: String, deviceType: String, signal: Double, time: DateTime)

Copy link
Member

@srowen srowen left a comment

Choose a reason for hiding this comment

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

I take your word for it on the recentProgress()/lastProgress() change but looks OK except for one comment

noAggDF
.writeStream()
.parquet("path/to/destination/directory")
.writeStream
Copy link
Member

Choose a reason for hiding this comment

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

This is a method call? it needs parens then.

@SparkQA
Copy link

SparkQA commented Jan 1, 2017

Test build #70769 has finished for PR 16442 at commit 93c598c.

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

@srowen
Copy link
Member

srowen commented Jan 2, 2017

Merged to master

@asfgit asfgit closed this in 808b84e Jan 2, 2017
@lw-lin lw-lin deleted the ss-pro-guide- branch January 2, 2017 14:47
@zsxwing
Copy link
Member

zsxwing commented Jan 2, 2017

Thanks! LGTM. I'm going to also cherry-pick to branch 2.1 in case we may want to push new docs to the website..

asfgit pushed a commit that referenced this pull request Jan 2, 2017
…treaming Programming Guide

## What changes were proposed in this pull request?

Currently some code snippets in the programming guide just do not compile. We should fix them.

## How was this patch tested?

```
SKIP_API=1 jekyll build
```

## Screenshot from part of the change:

![snip20161231_37](https://cloud.githubusercontent.com/assets/15843379/21576864/cc52fcd8-cf7b-11e6-8bd6-f935d9ff4a6b.png)

Author: Liwei Lin <lwlin7@gmail.com>

Closes #16442 from lw-lin/ss-pro-guide-.
@tdas
Copy link
Contributor

tdas commented Jan 3, 2017

@lw-lin thanks for catching these! :)

cmonkey pushed a commit to cmonkey/spark that referenced this pull request Jan 4, 2017
…treaming Programming Guide

## What changes were proposed in this pull request?

Currently some code snippets in the programming guide just do not compile. We should fix them.

## How was this patch tested?

```
SKIP_API=1 jekyll build
```

## Screenshot from part of the change:

![snip20161231_37](https://cloud.githubusercontent.com/assets/15843379/21576864/cc52fcd8-cf7b-11e6-8bd6-f935d9ff4a6b.png)

Author: Liwei Lin <lwlin7@gmail.com>

Closes apache#16442 from lw-lin/ss-pro-guide-.
uzadude pushed a commit to uzadude/spark that referenced this pull request Jan 27, 2017
…treaming Programming Guide

## What changes were proposed in this pull request?

Currently some code snippets in the programming guide just do not compile. We should fix them.

## How was this patch tested?

```
SKIP_API=1 jekyll build
```

## Screenshot from part of the change:

![snip20161231_37](https://cloud.githubusercontent.com/assets/15843379/21576864/cc52fcd8-cf7b-11e6-8bd6-f935d9ff4a6b.png)

Author: Liwei Lin <lwlin7@gmail.com>

Closes apache#16442 from lw-lin/ss-pro-guide-.
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.

5 participants