-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for branching in Iceberg
- Loading branch information
Showing
18 changed files
with
854 additions
and
31 deletions.
There are no files selected for viewing
236 changes: 207 additions & 29 deletions
236
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergMetadata.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
.../trino-iceberg/src/main/java/io/trino/plugin/iceberg/procedure/CreateBranchProcedure.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 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 io.trino.plugin.iceberg.procedure; | ||
|
||
import com.google.common.collect.ImmutableList; | ||
import com.google.inject.Provider; | ||
import io.trino.spi.connector.TableProcedureMetadata; | ||
import io.trino.spi.session.PropertyMetadata; | ||
|
||
import static io.trino.plugin.iceberg.procedure.IcebergTableProcedureId.CREATE_BRANCH; | ||
import static io.trino.spi.connector.TableProcedureExecutionMode.coordinatorOnly; | ||
import static io.trino.spi.session.PropertyMetadata.stringProperty; | ||
|
||
public class CreateBranchProcedure | ||
implements Provider<TableProcedureMetadata> | ||
{ | ||
@Override | ||
public TableProcedureMetadata get() | ||
{ | ||
return new TableProcedureMetadata( | ||
CREATE_BRANCH.name(), | ||
coordinatorOnly(), | ||
ImmutableList.<PropertyMetadata<?>>builder() | ||
.add(stringProperty( | ||
"name", | ||
"Branch name", | ||
null, | ||
false)) | ||
.build()); | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
...in/trino-iceberg/src/main/java/io/trino/plugin/iceberg/procedure/DropBranchProcedure.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 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 io.trino.plugin.iceberg.procedure; | ||
|
||
import com.google.common.collect.ImmutableList; | ||
import com.google.inject.Provider; | ||
import io.trino.spi.connector.TableProcedureMetadata; | ||
import io.trino.spi.session.PropertyMetadata; | ||
|
||
import static io.trino.plugin.iceberg.procedure.IcebergTableProcedureId.DROP_BRANCH; | ||
import static io.trino.spi.connector.TableProcedureExecutionMode.coordinatorOnly; | ||
import static io.trino.spi.session.PropertyMetadata.stringProperty; | ||
|
||
public class DropBranchProcedure | ||
implements Provider<TableProcedureMetadata> | ||
{ | ||
@Override | ||
public TableProcedureMetadata get() | ||
{ | ||
return new TableProcedureMetadata( | ||
DROP_BRANCH.name(), | ||
coordinatorOnly(), | ||
ImmutableList.<PropertyMetadata<?>>builder() | ||
.add(stringProperty( | ||
"name", | ||
"Branch name", | ||
null, | ||
false)) | ||
.build()); | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
...n/trino-iceberg/src/main/java/io/trino/plugin/iceberg/procedure/FastForwardProcedure.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,47 @@ | ||
/* | ||
* 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 io.trino.plugin.iceberg.procedure; | ||
|
||
import com.google.common.collect.ImmutableList; | ||
import com.google.inject.Provider; | ||
import io.trino.spi.connector.TableProcedureMetadata; | ||
import io.trino.spi.session.PropertyMetadata; | ||
|
||
import static io.trino.plugin.iceberg.procedure.IcebergTableProcedureId.FAST_FORWARD; | ||
import static io.trino.spi.connector.TableProcedureExecutionMode.coordinatorOnly; | ||
import static io.trino.spi.session.PropertyMetadata.stringProperty; | ||
|
||
public class FastForwardProcedure | ||
implements Provider<TableProcedureMetadata> | ||
{ | ||
@Override | ||
public TableProcedureMetadata get() | ||
{ | ||
return new TableProcedureMetadata( | ||
FAST_FORWARD.name(), | ||
coordinatorOnly(), | ||
ImmutableList.<PropertyMetadata<?>>builder() | ||
.add(stringProperty( | ||
"from", | ||
"Branch to fast-forward", | ||
null, | ||
false)) | ||
.add(stringProperty( | ||
"to", | ||
"Ref for the from branch to be fast forwarded to", | ||
null, | ||
false)) | ||
.build()); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...no-iceberg/src/main/java/io/trino/plugin/iceberg/procedure/IcebergCreateBranchHandle.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,25 @@ | ||
/* | ||
* 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 io.trino.plugin.iceberg.procedure; | ||
|
||
import static java.util.Objects.requireNonNull; | ||
|
||
public record IcebergCreateBranchHandle(String name) | ||
implements IcebergProcedureHandle | ||
{ | ||
public IcebergCreateBranchHandle | ||
{ | ||
requireNonNull(name, "name is null"); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...rino-iceberg/src/main/java/io/trino/plugin/iceberg/procedure/IcebergDropBranchHandle.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,25 @@ | ||
/* | ||
* 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 io.trino.plugin.iceberg.procedure; | ||
|
||
import static java.util.Objects.requireNonNull; | ||
|
||
public record IcebergDropBranchHandle(String name) | ||
implements IcebergProcedureHandle | ||
{ | ||
public IcebergDropBranchHandle | ||
{ | ||
requireNonNull(name, "name is null"); | ||
} | ||
} |
Oops, something went wrong.