Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-15727

DDL to Internal TableManager API reveal

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0-alpha4
    • None

    Description

      There's а separate ticket for DDL support in patch available state that proposes following Consumer to Predicate changes in TableManager.alter API.
      As-Is:

      @Override public void alterTable(String name, Consumer<TableChange> tableChange)
      

      To-Be:

      @Override public void alterTable(String name, @NotNull Predicate<TableChange> tableChange)
      

      Below is an example of such predicate api usage:

              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();
              });
      

      It's required to verify proposed API changes.

      Attachments

        Issue Links

          Activity

            People

              v.pyatkov Vladislav Pyatkov
              alapin Alexander Lapin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: