-
Notifications
You must be signed in to change notification settings - Fork 262
Add delete support for iceberg's merge on read mode. #13725
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
Open
liurenjie1024
wants to merge
24
commits into
NVIDIA:main
Choose a base branch
from
liurenjie1024:ray/13634
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
00e5dfa
Delete support for merge on read
liurenjie1024 7c35565
Merge remote-tracking branch 'upstream/main' into ray/13634
liurenjie1024 9113cbb
Fix leak
liurenjie1024 5989558
restore write
liurenjie1024 538785b
Some fix
liurenjie1024 25274b5
build break
liurenjie1024 962c6df
fshi
liurenjie1024 59e7384
fix write
liurenjie1024 a40d432
fix build
liurenjie1024 9979e87
Fix build
liurenjie1024 b94ecab
Address comments
liurenjie1024 adde725
Fix npe
liurenjie1024 2e062f3
Fix leak
liurenjie1024 a5934aa
Fix leak
liurenjie1024 58a49ee
Fix close too many
liurenjie1024 3faf020
Some refactoring
liurenjie1024 0f3ab0f
Fix another leak
liurenjie1024 e081526
Add check
liurenjie1024 d03960e
Fix chekc
liurenjie1024 067052f
a little refactor
liurenjie1024 1c14a78
Fix leak
liurenjie1024 8945fc6
Restore
liurenjie1024 adb0670
Merge remote-tracking branch 'upstream/main' into ray/13634
liurenjie1024 c8a6821
Fix build
liurenjie1024 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
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
68 changes: 68 additions & 0 deletions
68
iceberg/src/main/scala/com/nvidia/spark/rapids/iceberg/utils/GpuStructProjection.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,68 @@ | ||
| /* | ||
| * Copyright (c) 2025, NVIDIA CORPORATION. | ||
| * | ||
| * Licensed 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 com.nvidia.spark.rapids.iceberg.utils | ||
|
|
||
| import scala.collection.JavaConverters._ | ||
|
|
||
| import com.nvidia.spark.rapids.Arm.closeOnExcept | ||
| import com.nvidia.spark.rapids.GpuColumnVector | ||
| import org.apache.iceberg.types.Types.StructType | ||
|
|
||
| import org.apache.spark.sql.vectorized.{ColumnarBatch, ColumnVector} | ||
|
|
||
| /** | ||
| * Gpu version of {@link org.apache.iceberg.util.StructProjection} | ||
| */ | ||
| class GpuStructProjection(val positionMap: Array[Int]) { | ||
| def project(batch: ColumnarBatch): ColumnarBatch = { | ||
| val cols = new Array[ColumnVector](positionMap.length) | ||
| closeOnExcept(cols) { _ => | ||
| for (idx <- positionMap.indices) { | ||
| cols(idx) = batch.column(positionMap(idx)) | ||
| .asInstanceOf[GpuColumnVector] | ||
| .incRefCount() | ||
| } | ||
|
|
||
| new ColumnarBatch(cols, batch.numRows()) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| object GpuStructProjection { | ||
| def apply(dataType: StructType, projectType: StructType): GpuStructProjection = { | ||
| if (projectType.fields().asScala.exists(!_.`type`().isPrimitiveType)) { | ||
| throw new IllegalArgumentException( | ||
| "Gpu struct projection currently only supports primitive types") | ||
| } | ||
| val positionMap = new Array[Int](projectType.fields().size()) | ||
|
|
||
| for (idx <- positionMap.indices) { | ||
| val projectedField = projectType.fields().get(idx) | ||
| dataType.fields() | ||
| .asScala | ||
| .zipWithIndex | ||
| .find(p => p._1.fieldId() == projectedField.fieldId()) | ||
| match { | ||
| case Some(f) => positionMap(idx) = f._2 | ||
| case None => throw new IllegalArgumentException( | ||
| s"Field ${projectedField.name()} not found in projection source") | ||
| } | ||
| } | ||
|
|
||
| new GpuStructProjection(positionMap) | ||
| } | ||
| } |
50 changes: 0 additions & 50 deletions
50
iceberg/src/main/scala/org/apache/iceberg/io/GpuRollingDataWriter.scala
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Please update after this PR is merged: #13688