Skip to content

Conversation

@HyukjinKwon
Copy link
Member

What changes were proposed in this pull request?

Currently, R's Scala codes happened to refer Python's Scala codes for code deduplications. It's a bit odd. For instance, when we face an exception from R, it shows python related code path, which makes confusing to debug. It should rather have one code base and R's and Python's should share.

This PR proposes:

  1. Make a SocketAuthServer and move PythonServer so that PythonRDD and RRDD can share it.
  2. Move readRDDFromFile and readRDDFromInputStream into JavaRDD.
  3. Reuse RAuthHelper and remove RSocketAuthHelper in RRDD.
  4. Rename getEncryptionEnabled to isEncryptionEnabled while I am here.

So, now, the places below:

  • sql/core/src/main/scala/org/apache/spark/sql/api/r
  • core/src/main/scala/org/apache/spark/api/r
  • mllib/src/main/scala/org/apache/spark/ml/r

don't refer Python's Scala codes.

How was this patch tested?

Existing tests should cover this.

Copy link
Member Author

Choose a reason for hiding this comment

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

All moved codes are as are, except that I made this private.

@HyukjinKwon
Copy link
Member Author

cc @vanzin, @felixcheung, @squito

@SparkQA

This comment has been minimized.

@SparkQA
Copy link

SparkQA commented Mar 8, 2019

Test build #103196 has finished for PR 24023 at commit 1384234.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@dilipbiswal
Copy link
Contributor

retest this please

@SparkQA
Copy link

SparkQA commented Mar 8, 2019

Test build #103198 has finished for PR 24023 at commit 1384234.

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

Copy link
Contributor

@squito squito left a comment

Choose a reason for hiding this comment

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

Just want to double-check I understand -- you're not trying to change any behavior, just don't want "python" to appear in stack traces from R?

a couple very minor style things, but lgtm otherwise.

@HyukjinKwon
Copy link
Member Author

@squito, Yup. That's the main reason and I tried to not change behaviour, yes. Actually I received some comments that's a bit odd R's Scala codes refers Python's Scala codes from @vanzin and @felixcheung as well.

@SparkQA
Copy link

SparkQA commented Mar 9, 2019

Test build #103241 has finished for PR 24023 at commit a94c041.

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

@SparkQA
Copy link

SparkQA commented Mar 9, 2019

Test build #103243 has finished for PR 24023 at commit 9e41ca5.

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

Copy link
Member

@felixcheung felixcheung left a comment

Choose a reason for hiding this comment

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

LG, one comment

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.

Looks good if this is just a refactoring

@felixcheung
Copy link
Member

LGTM

@HyukjinKwon
Copy link
Member Author

Merged to master.

Thanks, guys.

@HyukjinKwon HyukjinKwon deleted the SPARK-27102 branch March 3, 2020 01:19
rshkv pushed a commit to palantir/spark that referenced this pull request Jun 4, 2020
…a codes in R's Scala codes

## What changes were proposed in this pull request?

Currently, R's Scala codes happened to refer Python's Scala codes for code deduplications. It's a bit odd. For instance, when we face an exception from R, it shows python related code path, which makes confusing to debug. It should rather have one code base and R's and Python's should share.

This PR proposes:

1. Make a `SocketAuthServer` and move `PythonServer` so that `PythonRDD` and `RRDD` can share it.
2. Move `readRDDFromFile` and `readRDDFromInputStream` into `JavaRDD`.
3. Reuse `RAuthHelper` and remove `RSocketAuthHelper` in `RRDD`.
4. Rename `getEncryptionEnabled` to `isEncryptionEnabled` while I am here.

So, now, the places below:

- `sql/core/src/main/scala/org/apache/spark/sql/api/r`
- `core/src/main/scala/org/apache/spark/api/r`
- `mllib/src/main/scala/org/apache/spark/ml/r`

don't refer Python's Scala codes.

## How was this patch tested?

Existing tests should cover this.

Closes apache#24023 from HyukjinKwon/SPARK-27102.

Authored-by: Hyukjin Kwon <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
rshkv pushed a commit to palantir/spark that referenced this pull request Jun 5, 2020
…a codes in R's Scala codes

## What changes were proposed in this pull request?

Currently, R's Scala codes happened to refer Python's Scala codes for code deduplications. It's a bit odd. For instance, when we face an exception from R, it shows python related code path, which makes confusing to debug. It should rather have one code base and R's and Python's should share.

This PR proposes:

1. Make a `SocketAuthServer` and move `PythonServer` so that `PythonRDD` and `RRDD` can share it.
2. Move `readRDDFromFile` and `readRDDFromInputStream` into `JavaRDD`.
3. Reuse `RAuthHelper` and remove `RSocketAuthHelper` in `RRDD`.
4. Rename `getEncryptionEnabled` to `isEncryptionEnabled` while I am here.

So, now, the places below:

- `sql/core/src/main/scala/org/apache/spark/sql/api/r`
- `core/src/main/scala/org/apache/spark/api/r`
- `mllib/src/main/scala/org/apache/spark/ml/r`

don't refer Python's Scala codes.

## How was this patch tested?

Existing tests should cover this.

Closes apache#24023 from HyukjinKwon/SPARK-27102.

Authored-by: Hyukjin Kwon <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
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.

7 participants