forked from apache/iceberg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Spark: Reimplement RewriteDatafilesAction with partial progress (apac…
- Loading branch information
1 parent
bed47a4
commit 25eaeba
Showing
19 changed files
with
1,826 additions
and
14 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
50 changes: 50 additions & 0 deletions
50
core/src/main/java/org/apache/iceberg/actions/BaseFileGroupRewriteResult.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,50 @@ | ||
/* | ||
* 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.actions; | ||
|
||
import org.apache.iceberg.actions.RewriteDataFiles.FileGroupInfo; | ||
import org.apache.iceberg.actions.RewriteDataFiles.FileGroupRewriteResult; | ||
|
||
public class BaseFileGroupRewriteResult implements FileGroupRewriteResult { | ||
private final int addedDataFilesCount; | ||
private final int rewrittenDataFilesCount; | ||
private final FileGroupInfo info; | ||
|
||
public BaseFileGroupRewriteResult(FileGroupInfo info, int addedFilesCount, int rewrittenFilesCount) { | ||
this.info = info; | ||
this.addedDataFilesCount = addedFilesCount; | ||
this.rewrittenDataFilesCount = rewrittenFilesCount; | ||
} | ||
|
||
@Override | ||
public FileGroupInfo info() { | ||
return info; | ||
} | ||
|
||
@Override | ||
public int addedDataFilesCount() { | ||
return addedDataFilesCount; | ||
} | ||
|
||
@Override | ||
public int rewrittenDataFilesCount() { | ||
return rewrittenDataFilesCount; | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
core/src/main/java/org/apache/iceberg/actions/BaseRewriteDataFilesFileGroupInfo.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,59 @@ | ||
/* | ||
* 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.actions; | ||
|
||
import org.apache.iceberg.StructLike; | ||
import org.apache.iceberg.relocated.com.google.common.base.MoreObjects; | ||
|
||
public class BaseRewriteDataFilesFileGroupInfo implements RewriteDataFiles.FileGroupInfo { | ||
private final int globalIndex; | ||
private final int partitionIndex; | ||
private final StructLike partition; | ||
|
||
public BaseRewriteDataFilesFileGroupInfo(int globalIndex, int partitionIndex, StructLike partition) { | ||
this.globalIndex = globalIndex; | ||
this.partitionIndex = partitionIndex; | ||
this.partition = partition; | ||
} | ||
|
||
@Override | ||
public int globalIndex() { | ||
return globalIndex; | ||
} | ||
|
||
@Override | ||
public int partitionIndex() { | ||
return partitionIndex; | ||
} | ||
|
||
@Override | ||
public StructLike partition() { | ||
return partition; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return MoreObjects.toStringHelper(this) | ||
.add("globalIndex", globalIndex) | ||
.add("partitionIndex", partitionIndex) | ||
.add("partition", partition) | ||
.toString(); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
core/src/main/java/org/apache/iceberg/actions/BaseRewriteDataFilesResult.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,37 @@ | ||
/* | ||
* 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.actions; | ||
|
||
import java.util.List; | ||
import org.apache.iceberg.actions.RewriteDataFiles.FileGroupRewriteResult; | ||
import org.apache.iceberg.actions.RewriteDataFiles.Result; | ||
|
||
public class BaseRewriteDataFilesResult implements Result { | ||
private final List<FileGroupRewriteResult> rewriteResults; | ||
|
||
public BaseRewriteDataFilesResult(List<FileGroupRewriteResult> rewriteResults) { | ||
this.rewriteResults = rewriteResults; | ||
} | ||
|
||
@Override | ||
public List<FileGroupRewriteResult> rewriteResults() { | ||
return rewriteResults; | ||
} | ||
} |
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.