[
https://issues.apache.org/jira/browse/IGNITE-15727?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Alexander Lapin updated IGNITE-15727:
-------------------------------------
Summary: DDL to Internal TableManager API reveal (was: DDL to Internal
TableManager API)
> DDL to Internal TableManager API reveal
> ---------------------------------------
>
> Key: IGNITE-15727
> URL: https://issues.apache.org/jira/browse/IGNITE-15727
> Project: Ignite
> Issue Type: Task
> Reporter: Alexander Lapin
> Priority: Major
> Labels: ignite-3
>
> There's а separate
> [ticket|https://issues.apache.org/jira/browse/IGNITE-15107] for DDL support
> in patch available state that proposes following Consumer to Predicate
> changes in TableManager.alter API.
> As-Is:
> {code:java}
> @Override public void alterTable(String name, Consumer<TableChange>
> tableChange)
> {code}
> To-Be:
> {code:java}
> @Override public void alterTable(String name, @NotNull Predicate<TableChange>
> tableChange)
> {code}
> Below is an example of such predicate api usage:
> {code:java}
> CompletableFuture<Void> fut =
> tableManager.alterTableAsync(canonicalName, tblCh -> {
> tblCh.changeColumns(
> columns -> {
> Set<String> existCols =
> columns.namedListKeys().stream().map(k -> columns.get(k).name())
> .collect(Collectors.toUnmodifiableSet());
>
> cmd.columns().stream().map(Column::name).filter(existCols::contains)
> .collect(Collectors.toCollection(() -> issues));
> if (issues.isEmpty()) {
> for (Column col0 : cmd.columns())
> columns.create(col0.name(), colChg ->
> convert(col0, colChg));
> }
> }
> );
> return issues.isEmpty();
> });
> {code}
> It's required to verify proposed API changes.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)