-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-28980][CORE][SQL][STREAMING][MLLIB] Remove most items deprecated in Spark 2.2.0 or earlier, for Spark 3 #25684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
srowen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's a big change. But the PR description should summarize the key logical parts of the change and help understand the major pieces. There are only about 5 major removals here, they just touch a lot of files.
| "sumDistinct", | ||
| "tan", | ||
| "tanh", | ||
| "toDegrees", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@felixcheung to comment on whether we should revisit going ahead and removing these in Spark 3 anyway. We had previously removed them in Pyspark, Scala and kept them in R.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they were deprecated eg. .Deprecated("degrees") in code, I'm ok with removing them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.Deprecated was just added recently though:
https://github.com/apache/spark/pull/22921/files
This was the previous thread:
#22921 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah then I"m less sure if we have never release with the deprecation before and go straight to remove
#22921 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep I see the argument @felixcheung . I reopened it because we have a similar situation with SQLContext.createExternalTable, which was deprecated everywhere but Pyspark. Presumably it was also just an oversight. Looks like we're going to remove that. I'd moderately prefer to remove these for consistency, both in the decision and w.r.t. the toDegrees method. Is that persuasive? If you feel fairly strongly about keeping it deprecated, that's OK and I can revert this part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with it. I'd prefer we deprecate it first though. Is there going to be 2.4.5 before 3.0?
(I generally would prefer use friendliness - ie. don't break code - than consistency, as not all language API are consistent, esp. some methods are language specific, and with R is always lagging behind...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No prob, I reverted this part of the change.
| } | ||
| } | ||
|
|
||
| if (contains("spark.master") && get("spark.master").startsWith("yarn-")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vanzin may be interested in the parts that remove support for yarn-client and yarn-cluster masters.
...kinesis-asl/src/main/scala/org/apache/spark/streaming/kinesis/KinesisUtilsPythonHelper.scala
Show resolved
Hide resolved
| * numIterations: 100, regParm: 0.01, miniBatchFraction: 1.0}. | ||
| */ | ||
| @Since("0.8.0") | ||
| @deprecated("Use ml.classification.LogisticRegression or LogisticRegressionWithLBFGS", "2.0.0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if @jkbradley or @mengxr want to review the removal of MLlib deprecated items, but these have been deprecated a while.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
the SQL part LGTM. I think |
|
The Kinesis part LGTM, though as @srowen mentioned not sure who is interested in. |
|
I added removal of HiveContext -- let's see how this goes with tests. I think that's not controversial? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
I support this PR. Well, I would even support to remove APIs deprecated as of 2.3.0 but can be done separately - I suspect that might be controversial. |
| cls.hive_available = True | ||
| cls.spark = None | ||
| try: | ||
| cls.sc._jvm.org.apache.hadoop.hive.conf.HiveConf() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@srowen, seems this code is still needed. SparkSession.builder.enableHiveSupport().getOrCreate() seems not able to directly check if Hive is available or not. I manually tested and just pushed the changes directly into your branch.
| lambda: ImageSchema.toImage("a")) | ||
|
|
||
|
|
||
| class ImageFileFormatOnHiveContextTest(PySparkTestCase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@srowen, this was removed (see #25684 (comment))
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Thanks @HyukjinKwon ! Looks like we're in good shape. I will leave it open for a bit, pending one more item about R |
This comment has been minimized.
This comment has been minimized.
|
Oops, thanks @HyukjinKwon for restoring the commits I lost. I forgot to pull and just rebased on master |
|
Test build #110344 has finished for PR 25684 at commit
|
|
Merged to master |
…ed in Spark 2.2.0 or earlier, for Spark 3 ### What changes were proposed in this pull request? - Remove SQLContext.createExternalTable and Catalog.createExternalTable, deprecated in favor of createTable since 2.2.0, plus tests of deprecated methods - Remove HiveContext, deprecated in 2.0.0, in favor of `SparkSession.builder.enableHiveSupport` - Remove deprecated KinesisUtils.createStream methods, plus tests of deprecated methods, deprecate in 2.2.0 - Remove deprecated MLlib (not Spark ML) linear method support, mostly utility constructors and 'train' methods, and associated docs. This includes methods in LinearRegression, LogisticRegression, Lasso, RidgeRegression. These have been deprecated since 2.0.0 - Remove deprecated Pyspark MLlib linear method support, including LogisticRegressionWithSGD, LinearRegressionWithSGD, LassoWithSGD - Remove 'runs' argument in KMeans.train() method, which has been a no-op since 2.0.0 - Remove deprecated ChiSqSelector isSorted protected method - Remove deprecated 'yarn-cluster' and 'yarn-client' master argument in favor of 'yarn' and deploy mode 'cluster', etc Notes: - I was not able to remove deprecated DataFrameReader.json(RDD) in favor of DataFrameReader.json(Dataset); the former was deprecated in 2.2.0, but, it is still needed to support Pyspark's .json() method, which can't use a Dataset. - Looks like SQLContext.createExternalTable was not actually deprecated in Pyspark, but, almost certainly was meant to be? Catalog.createExternalTable was. - I afterwards noted that the toDegrees, toRadians functions were almost removed fully in SPARK-25908, but Felix suggested keeping just the R version as they hadn't been technically deprecated. I'd like to revisit that. Do we really want the inconsistency? I'm not against reverting it again, but then that implies leaving SQLContext.createExternalTable just in Pyspark too, which seems weird. - I *kept* LogisticRegressionWithSGD, LinearRegressionWithSGD, LassoWithSGD, RidgeRegressionWithSGD in Pyspark, though deprecated, as it is hard to remove them (still used by StreamingLogisticRegressionWithSGD?) and they are not fully removed in Scala. Maybe should not have been deprecated. ### Why are the changes needed? Deprecated items are easiest to remove in a major release, so we should do so as much as possible for Spark 3. This does not target items deprecated 'recently' as of Spark 2.3, which is still 18 months old. ### Does this PR introduce any user-facing change? Yes, in that deprecated items are removed from some public APIs. ### How was this patch tested? Existing tests. Closes apache#25684 from srowen/SPARK-28980. Lead-authored-by: Sean Owen <[email protected]> Co-authored-by: HyukjinKwon <[email protected]> Signed-off-by: Sean Owen <[email protected]>
What changes were proposed in this pull request?
SparkSession.builder.enableHiveSupportNotes:
Why are the changes needed?
Deprecated items are easiest to remove in a major release, so we should do so as much as possible for Spark 3. This does not target items deprecated 'recently' as of Spark 2.3, which is still 18 months old.
Does this PR introduce any user-facing change?
Yes, in that deprecated items are removed from some public APIs.
How was this patch tested?
Existing tests.