tkalkirill commented on code in PR #2231:
URL: https://github.com/apache/ignite-3/pull/2231#discussion_r1237469616
##########
modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogServiceImpl.java:
##########
@@ -277,82 +259,62 @@ private Catalog catalogAt(long timestamp) {
return entry.getValue();
}
- /** {@inheritDoc} */
@Override
public CompletableFuture<Void> createTable(CreateTableParams params) {
return saveUpdate(catalog -> {
- String schemaName =
Objects.requireNonNullElse(params.schemaName(), CatalogService.PUBLIC);
-
- CatalogSchemaDescriptor schema =
Objects.requireNonNull(catalog.schema(schemaName), "No schema found: " +
schemaName);
+ CatalogSchemaDescriptor schema = getSchema(catalog,
params.schemaName());
if (schema.table(params.tableName()) != null) {
- throw new TableAlreadyExistsException(schemaName,
params.tableName());
+ throw new TableAlreadyExistsException(schema.name(),
params.tableName());
}
-
params.columns().stream().map(ColumnParams::name).filter(Predicate.not(new
HashSet<>()::add))
- .findAny().ifPresent(columnName -> {
- throw new IgniteInternalException(
-
ErrorGroups.Index.INVALID_INDEX_DEFINITION_ERR, "Can't create table with
duplicate columns: "
- +
params.columns().stream().map(ColumnParams::name).collect(Collectors.joining(",
"))
- );
- });
+ validateParams(params);
+
+ CatalogZoneDescriptor zone = getZone(catalog,
Objects.requireNonNullElse(params.zone(), DEFAULT_ZONE_NAME));
Review Comment:
What exactly should be done in another ticket I don't understand.
--
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]