-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
API, Core, Spark 3.5: Parallelize reading of deletes and cache them o…
…n executors
- Loading branch information
1 parent
4d34398
commit 5e0392b
Showing
21 changed files
with
1,314 additions
and
87 deletions.
There are no files selected for viewing
This file contains 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 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 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 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
55 changes: 55 additions & 0 deletions
55
core/src/main/java/org/apache/iceberg/deletes/EmptyPositionDeleteIndex.java
This file contains 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,55 @@ | ||
/* | ||
* 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; | ||
|
||
class EmptyPositionDeleteIndex implements PositionDeleteIndex { | ||
|
||
private static final EmptyPositionDeleteIndex INSTANCE = new EmptyPositionDeleteIndex(); | ||
|
||
private EmptyPositionDeleteIndex() {} | ||
|
||
static EmptyPositionDeleteIndex get() { | ||
return INSTANCE; | ||
} | ||
|
||
@Override | ||
public void delete(long position) { | ||
throw new UnsupportedOperationException("Cannot modify " + getClass().getName()); | ||
} | ||
|
||
@Override | ||
public void delete(long posStart, long posEnd) { | ||
throw new UnsupportedOperationException("Cannot modify " + getClass().getName()); | ||
} | ||
|
||
@Override | ||
public boolean isDeleted(long position) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean isEmpty() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "PositionDeleteIndex{}"; | ||
} | ||
} |
This file contains 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/PositionDeleteIndexUtil.java
This file contains 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; | ||
|
||
import org.apache.iceberg.relocated.com.google.common.base.Preconditions; | ||
|
||
public class PositionDeleteIndexUtil { | ||
|
||
private PositionDeleteIndexUtil() {} | ||
|
||
public static PositionDeleteIndex merge(Iterable<? extends PositionDeleteIndex> indexes) { | ||
BitmapPositionDeleteIndex result = new BitmapPositionDeleteIndex(); | ||
|
||
for (PositionDeleteIndex index : indexes) { | ||
if (index.isNotEmpty()) { | ||
Preconditions.checkArgument( | ||
index instanceof BitmapPositionDeleteIndex, | ||
"Can merge only bitmap-based indexes, got %s", | ||
index.getClass().getName()); | ||
result.merge((BitmapPositionDeleteIndex) index); | ||
} | ||
} | ||
|
||
return result; | ||
} | ||
} |
This file contains 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.