AMashenkov commented on code in PR #2105:
URL: https://github.com/apache/ignite-3/pull/2105#discussion_r1217731149
##########
modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogServiceImpl.java:
##########
@@ -321,6 +341,89 @@ public CompletableFuture<Void>
dropColumn(AlterTableDropColumnParams params) {
});
}
+ /** {@inheritDoc} */
+ @Override
+ public CompletableFuture<Void> alterColumn(AlterColumnParams params) {
+ return saveUpdate(catalog -> {
+ String schemaName =
Objects.requireNonNullElse(params.schemaName(), CatalogService.PUBLIC);
+
+ SchemaDescriptor schema =
Objects.requireNonNull(catalog.schema(schemaName), "No schema found: " +
schemaName);
+
+ TableDescriptor table = schema.table(params.tableName());
+
+ if (table == null) {
+ throw new TableNotFoundException(schemaName,
params.tableName());
+ }
+
+ String columnName = params.columnName();
+
+ Optional<TableColumnDescriptor> source =
table.columns().stream().filter(desc ->
desc.name().equals(columnName)).findFirst();
+
+ if (source.isEmpty()) {
+ throw new ColumnNotFoundException(columnName);
+ }
Review Comment:
```suggestion
TableColumnDescriptor source = table.columns().stream()
.filter(desc -> desc.name().equals(columnName))
.findFirst()
.orElseThrow(() -> new ColumnNotFoundException(columnName));
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]