Skip to content

Conversation

@hvanhovell
Copy link
Contributor

What changes were proposed in this pull request?

The arrow collect code path for connect contains a bug where it would always fall back to JSON. This was caused by the assumption that NonFatal(e) does not match nulls, it unfortunately does. This has been fixed by doing explicit null checks and by reordering the checks in SparkConnectStreamHandler.processAsArrowBatches.

Why are the changes needed?

The previous code had a bug and would always fallback to JSON.

Does this PR introduce any user-facing change?

No

How was this patch tested?

I added a new test, and I re-enabled the python test disabled in SPARK-41184.

Copy link
Contributor

@grundprinzip grundprinzip left a comment

Choose a reason for hiding this comment

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

I will let others approve that have more knowledge of the internals of the collectors and their exception behavior.

result.get
} else if (NonFatal(error)) {
responseObserver.onError(error)
logError("Error while processing query.", error)
Copy link
Contributor

Choose a reason for hiding this comment

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

In theory, logging first then responding might be better in case something goes wrong and onError would throw.

beliefer pushed a commit to beliefer/spark that referenced this pull request Dec 15, 2022
… implementation to stream from server to client

### What changes were proposed in this pull request?

This PR proposes an optimized Arrow-based collect, that is virtually apache#38720 that implements the logics except a couple of nits.

### Why are the changes needed?

To stream the Arrow batch from the server to the client side instead of waiting all the jobs to finish.

### Does this PR introduce _any_ user-facing change?

No, this feature isn't released yet.

### How was this patch tested?

Unittest added.

Closes apache#38720

Closes apache#38759 from HyukjinKwon/SPARK-41165-followup.

Authored-by: Hyukjin Kwon <gurwls223@apache.org>
Signed-off-by: Herman van Hovell <herman@databricks.com>
beliefer pushed a commit to beliefer/spark that referenced this pull request Dec 18, 2022
… implementation to stream from server to client

### What changes were proposed in this pull request?

This PR proposes an optimized Arrow-based collect, that is virtually apache#38720 that implements the logics except a couple of nits.

### Why are the changes needed?

To stream the Arrow batch from the server to the client side instead of waiting all the jobs to finish.

### Does this PR introduce _any_ user-facing change?

No, this feature isn't released yet.

### How was this patch tested?

Unittest added.

Closes apache#38720

Closes apache#38759 from HyukjinKwon/SPARK-41165-followup.

Authored-by: Hyukjin Kwon <gurwls223@apache.org>
Signed-off-by: Herman van Hovell <herman@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants