-
Notifications
You must be signed in to change notification settings - Fork 3k
Support pos-delete in vectorized read. #3287
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
Merged
aokolnychyi
merged 21 commits into
apache:master
from
flyrain:pos-delete-vectorized-read
Nov 9, 2021
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
6e4a25e
Add interface PositionDeleteIndex to avoid expose RoaringBitmap in pu…
flyrain e7a152b
Benchmark change
flyrain f8ef69d
Change the field name style.
flyrain 619a792
Style issue fix.
flyrain f59b8b0
Set vectorized read through table properties.
flyrain 4bce76a
Enforce the netty buffer version to make sure jmh test can pass.
flyrain c0c890b
Add tests for multiple row groups and constant column vector.
flyrain 5c7d230
Add tests for multiple row groups and constant column vector.
flyrain 2b52041
Benchmark refactor
flyrain fee319e
Revert "Enforce the netty buffer version to make sure jmh test can pa…
flyrain 2ce64cd
Resolve comments on the benchmark.
flyrain 24c9ef9
Add more benchmarks
flyrain 67767d1
Resolve comments.
flyrain f1c7df7
Add RoaringBitmap dependency to Spark3.0 and Spark3.1
flyrain 9b72f7c
Shaded org.roaringbitmap in Spark3.2.
flyrain f55c7c9
Resolve comments.
flyrain 6070ce4
Add interface PositionDeleteIndex to avoid expose RoaringBitmap in pu…
flyrain c94d84f
Remove unused import.
flyrain 9777e68
Remove roaringBitmap in iceberg-data.
flyrain c8e2c54
Exclude and shade roaringbitmap in Spark3.1
flyrain 617a19c
Make BitmapPositionDeleteIndex package-private.
flyrain 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
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
45 changes: 45 additions & 0 deletions
45
core/src/main/java/org/apache/iceberg/deletes/BitmapPositionDeleteIndex.java
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,45 @@ | ||
| /* | ||
| * 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.iceberg.deletes; | ||
|
|
||
| import org.roaringbitmap.longlong.Roaring64Bitmap; | ||
|
|
||
| class BitmapPositionDeleteIndex implements PositionDeleteIndex { | ||
| private final Roaring64Bitmap roaring64Bitmap; | ||
|
|
||
| BitmapPositionDeleteIndex() { | ||
| roaring64Bitmap = new Roaring64Bitmap(); | ||
| } | ||
|
|
||
| @Override | ||
| public void delete(long position) { | ||
| roaring64Bitmap.add(position); | ||
| } | ||
|
|
||
| @Override | ||
| public void delete(long posStart, long posEnd) { | ||
| roaring64Bitmap.add(posStart, posEnd); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean deleted(long position) { | ||
| return roaring64Bitmap.contains(position); | ||
| } | ||
| } |
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
42 changes: 42 additions & 0 deletions
42
core/src/main/java/org/apache/iceberg/deletes/PositionDeleteIndex.java
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,42 @@ | ||
| /* | ||
| * 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.iceberg.deletes; | ||
|
|
||
| public interface PositionDeleteIndex { | ||
| /** | ||
| * Set a deleted row position. | ||
| * @param position the deleted row position | ||
| */ | ||
| void delete(long position); | ||
|
|
||
| /** | ||
| * Set a range of deleted row positions. | ||
| * @param posStart inclusive beginning of position range | ||
| * @param posEnd exclusive ending of position range | ||
| */ | ||
| void delete(long posStart, long posEnd); | ||
|
|
||
| /** | ||
| * Checks whether a row at the position is deleted. | ||
| * @param position deleted row position | ||
| * @return whether the position is deleted | ||
| */ | ||
| boolean deleted(long position); | ||
| } |
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
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
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.
The library seems to be widely adopted in the big data ecosystem. I am +1 on using it instead of the inefficient Java implementation.