-
Notifications
You must be signed in to change notification settings - Fork 28.8k
[SPARK-53401][SQL] Enable Direct Passthrough Partitioning in the DataFrame API #52153
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
Closed
shujingyang-db
wants to merge
31
commits into
apache:master
from
shujingyang-db:direct-partitionId-pass-through
+313
−14
Closed
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
d1fe3da
init
shujingyang-db 7146dd8
ckp
shujingyang-db b3f2a94
fix
shujingyang-db fad6256
repartitionById ckp
shujingyang-db 7be523b
Merge remote-tracking branch 'spark/master' into direct-partitionId-p…
shujingyang-db 53ce88a
add more tests
shujingyang-db 84bafd8
add todos
shujingyang-db 6a13e3b
Update PlannerSuite.scala
shujingyang-db 228ca21
Update PlannerSuite.scala
shujingyang-db 599a3d6
Update PlannerSuite.scala
shujingyang-db 643b31a
rm conf
shujingyang-db 695278a
merge conflict
shujingyang-db e5f4c74
add tests
shujingyang-db 31d4c22
rm todos
shujingyang-db 799549a
clean up
shujingyang-db 4ab3e4b
fix tests
shujingyang-db ef1fa45
DirectShufflePartitionID
shujingyang-db 97cc15c
Update sql/core/src/test/scala/org/apache/spark/sql/execution/Planner…
shujingyang-db fddd5da
Update sql/core/src/main/scala/org/apache/spark/sql/classic/Dataset.s…
shujingyang-db e23ea46
Update sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expr…
shujingyang-db 09ec99b
Update sql/core/src/main/scala/org/apache/spark/sql/classic/Dataset.s…
shujingyang-db 5c9f681
int
shujingyang-db c9b6df5
Merge remote-tracking branch 'origin/direct-partitionId-pass-through'…
shujingyang-db 5d91e0e
Update DirectShufflePartitionID.scala
shujingyang-db 8805934
address comments
shujingyang-db b0add14
test case for join
shujingyang-db f678101
Merge remote-tracking branch 'origin/direct-partitionId-pass-through'…
shujingyang-db 13210a1
revert
shujingyang-db 8287ac5
revert
shujingyang-db 1480f86
Apply suggestions from code review
cloud-fan 276a650
Update sql/core/src/test/scala/org/apache/spark/sql/execution/Planner…
cloud-fan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
...t/src/main/scala/org/apache/spark/sql/catalyst/expressions/DirectShufflePartitionID.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License 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 | ||
|
||
import org.apache.spark.sql.types.{AbstractDataType, DataType, IntegerType} | ||
|
||
/** | ||
* Expression that takes a partition ID value and passes it through directly for use in | ||
* shuffle partitioning. This is used with RepartitionByExpression to allow users to | ||
* directly specify target partition IDs. | ||
* | ||
* The child expression must evaluate to an integral type and must not be null. | ||
* The resulting partition ID must be in the range [0, numPartitions). | ||
*/ | ||
case class DirectShufflePartitionID(child: Expression) | ||
extends UnaryExpression | ||
with ExpectsInputTypes | ||
with Unevaluable { | ||
|
||
override def dataType: DataType = child.dataType | ||
|
||
override def inputTypes: Seq[AbstractDataType] = IntegerType :: Nil | ||
|
||
override def nullable: Boolean = false | ||
|
||
override val prettyName: String = "direct_shuffle_partition_id" | ||
|
||
override protected def withNewChildInternal(newChild: Expression): DirectShufflePartitionID = | ||
copy(child = newChild) | ||
} | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.