-
Notifications
You must be signed in to change notification settings - Fork 582
Upgrade to spark 3.2 #416
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
Upgrade to spark 3.2 #416
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,18 @@ | ||
| /** | ||
| * Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"). You may not | ||
| * use this file except in compliance with the License. A copy of the License | ||
| * is located at | ||
| * | ||
| * http://aws.amazon.com/apache2.0/ | ||
| * | ||
| * or in the "license" file accompanying this file. This file is distributed on | ||
| * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
| * express or implied. See the License for the specific language governing | ||
| * permissions and limitations under the License. | ||
| * | ||
| */ | ||
|
|
||
| * Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Formatted using scalafmt to pass scalastyle check. |
||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"). You may not | ||
| * use this file except in compliance with the License. A copy of the License | ||
| * is located at | ||
| * | ||
| * http://aws.amazon.com/apache2.0/ | ||
| * | ||
| * or in the "license" file accompanying this file. This file is distributed on | ||
| * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
| * express or implied. See the License for the specific language governing | ||
| * permissions and limitations under the License. | ||
| * | ||
| */ | ||
| package org.apache.spark.sql.catalyst.expressions.aggregate | ||
|
|
||
| import org.apache.spark.sql.catalyst.InternalRow | ||
|
|
@@ -26,12 +25,13 @@ import org.apache.spark.sql.types._ | |
|
|
||
| /** Adjusted version of org.apache.spark.sql.catalyst.expressions.aggregate.ApproximatePercentile | ||
| * (github tag v2.2.0) */ | ||
| private[sql] case class StatefulApproxQuantile( | ||
| child: Expression, | ||
| accuracyExpression: Expression, | ||
| override val mutableAggBufferOffset: Int, | ||
| override val inputAggBufferOffset: Int) | ||
| extends TypedImperativeAggregate[PercentileDigest] with ImplicitCastInputTypes with BinaryLike[Expression] { | ||
| private[sql] case class StatefulApproxQuantile(child: Expression, | ||
| accuracyExpression: Expression, | ||
| override val mutableAggBufferOffset: Int, | ||
| override val inputAggBufferOffset: Int) | ||
| extends TypedImperativeAggregate[PercentileDigest] | ||
| with ImplicitCastInputTypes | ||
| with BinaryLike[Expression] { | ||
|
|
||
| def this(child: Expression, accuracyExpression: Expression) = { | ||
| this(child, accuracyExpression, 0, 0) | ||
|
|
@@ -111,11 +111,12 @@ private[sql] case class StatefulApproxQuantile( | |
| } | ||
|
|
||
| override def left: Expression = child | ||
|
|
||
| override def right: Expression = accuracyExpression | ||
| // override def third: Expression = accuracyExpression | ||
|
|
||
| protected def withNewChildrenInternal( | ||
| newFirst: Expression, newSecond: Expression): StatefulApproxQuantile = | ||
| protected def withNewChildrenInternal(newFirst: Expression, | ||
| newSecond: Expression): StatefulApproxQuantile = | ||
| copy(child = newFirst, accuracyExpression = newSecond) | ||
|
|
||
| // protected def withNewChildrenInternal( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,4 +50,8 @@ private[sql] class StatefulCorrelation( | |
| val state = Seq(super.hashCode(), evaluateExpression) | ||
| state.map { _.hashCode() }.foldLeft(0) {(a, b) => 31 * a + b } | ||
| } | ||
|
|
||
| override protected def withNewChildrenInternal(newLeft: Expression, | ||
| newRight: Expression): StatefulCorrelation = | ||
| new StatefulCorrelation(newLeft, newRight, nullOnDivideByZero) | ||
|
Comment on lines
+54
to
+56
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is to fix a fail on If we do not provide this |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,6 +78,7 @@ trait SparkContextSpec { | |
| .appName("test") | ||
| .config("spark.ui.enabled", "false") | ||
| .config("spark.sql.shuffle.partitions", 2.toString) | ||
| .config("spark.sql.adaptive.enabled", value = false) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is to fix failed tests when verifying submitted job count from SparkSessionStats
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The plan is explained on master branch (spark 3.1) The plan is explained on this branch (Spark 3.2.1) |
||
| .getOrCreate() | ||
| session.sparkContext.setCheckpointDir(System.getProperty("java.io.tmpdir")) | ||
| session | ||
|
|
||
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.
This is to fix the following error happened on my local PC