Skip to content

Conversation

@zsxwing
Copy link
Member

@zsxwing zsxwing commented Dec 3, 2016

What changes were proposed in this pull request?

  • Add StreamingQuery.explain and exception to Python.
  • Fix StreamingQueryException to not expose OffsetSeq.

How was this patch tested?

Jenkins

:return: the StreamingQueryException if the query was terminated by an exception, or None.
>>> sq = sdf.writeStream.format('memory').queryName('query_exception').start()
>>> str(sq.exception())
Copy link
Member Author

Choose a reason for hiding this comment

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

Convert None to a string 'None'. Otherwise, REPL prints nothing.

@SparkQA
Copy link

SparkQA commented Dec 3, 2016

Test build #69596 has finished for PR 16125 at commit 757cf2f.

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

@SparkQA
Copy link

SparkQA commented Dec 3, 2016

Test build #69597 has finished for PR 16125 at commit 4334557.

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

... pass # Ignore the error as we want to test the "exception" method
>>> sq.exception()
StreamingQueryException()
>>> sq.stop()
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure if such a big test should be present as doc tests. please add this to the sql/tests.py.

val numRowsUpdated: Long) {

/** The compact JSON representation of this progress. */
def json: String = compact(render(jsonValue))
Copy link
Contributor

@tdas tdas Dec 3, 2016

Choose a reason for hiding this comment

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

why are these needed? the outer StreamingQueryProgress already converts to json correctly. is this just for consistency with SourceProgress?

Copy link
Member Author

Choose a reason for hiding this comment

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

is this just for consistency with SourceProgress?

Yes. Other progress classes have these json methods.

"incorrect start offset on exception")
AssertOnQuery(q => {
q.exception.get.startOffset ===
q.committedOffsets.toOffsetSeq(Seq(inputData), "{}").toString &&
Copy link
Contributor

Choose a reason for hiding this comment

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

This line would conflict with my PR #16113 , you may have to fix issues after my PR gets merged.

@SparkQA
Copy link

SparkQA commented Dec 3, 2016

Test build #69607 has finished for PR 16125 at commit 169cd20.

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

endOffset: String) {
this(
// scalastyle:off
s"""${classOf[StreamingQueryException].getName}: ${cause.getMessage} ${cause.getStackTrace.take(10).mkString("", "\n|\t", "\n")}
Copy link
Member Author

Choose a reason for hiding this comment

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

The class name here allows capture_sql_exception to convert Java StreamingQueryException to Python StreamingQueryException.

@tdas
Copy link
Contributor

tdas commented Dec 5, 2016

Merging this to master and 2.1

@asfgit asfgit closed this in 2460128 Dec 5, 2016
@tdas
Copy link
Contributor

tdas commented Dec 5, 2016

Merged to master, but 2.1 failed due to mima exclude conflict. can you make another PR for 2.1 @zsxwing thanks!

@zsxwing zsxwing deleted the py-streaming-explain branch December 5, 2016 20:10
asfgit pushed a commit that referenced this pull request Dec 5, 2016
…and fix StreamingQueryException (branch 2.1)

## What changes were proposed in this pull request?

Backport #16125 to branch 2.1.

## How was this patch tested?

Jenkins

Author: Shixiong Zhu <[email protected]>

Closes #16153 from zsxwing/SPARK-18694-2.1.
robert3005 pushed a commit to palantir/spark that referenced this pull request Dec 15, 2016
…and fix StreamingQueryException

## What changes were proposed in this pull request?

- Add StreamingQuery.explain and exception to Python.
- Fix StreamingQueryException to not expose `OffsetSeq`.

## How was this patch tested?

Jenkins

Author: Shixiong Zhu <[email protected]>

Closes apache#16125 from zsxwing/py-streaming-explain.
uzadude pushed a commit to uzadude/spark that referenced this pull request Jan 27, 2017
…and fix StreamingQueryException

## What changes were proposed in this pull request?

- Add StreamingQuery.explain and exception to Python.
- Fix StreamingQueryException to not expose `OffsetSeq`.

## How was this patch tested?

Jenkins

Author: Shixiong Zhu <[email protected]>

Closes apache#16125 from zsxwing/py-streaming-explain.
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.

3 participants