From 6dcd5782c6bbaa0dc2636b1f90b4a5c347898eaa Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Fri, 20 Dec 2024 10:44:37 -0800 Subject: [PATCH] Minor clean up on #1698 fix based on code review comments --- .../jsonapi/service/operation/tables/TableInsertAttempt.java | 3 +-- .../sgv2/jsonapi/service/schema/tables/ApiSupportDef.java | 4 ---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/main/java/io/stargate/sgv2/jsonapi/service/operation/tables/TableInsertAttempt.java b/src/main/java/io/stargate/sgv2/jsonapi/service/operation/tables/TableInsertAttempt.java index 22863e179..28a764bf6 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/service/operation/tables/TableInsertAttempt.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/service/operation/tables/TableInsertAttempt.java @@ -3,7 +3,6 @@ import io.stargate.sgv2.jsonapi.api.model.command.table.definition.ColumnsDescContainer; import io.stargate.sgv2.jsonapi.service.cqldriver.executor.TableSchemaObject; import io.stargate.sgv2.jsonapi.service.operation.InsertAttempt; -import io.stargate.sgv2.jsonapi.service.schema.tables.ApiSupportDef; import io.stargate.sgv2.jsonapi.service.shredding.DocRowIdentifer; import io.stargate.sgv2.jsonapi.service.shredding.tables.RowId; import io.stargate.sgv2.jsonapi.service.shredding.tables.WriteableTableRow; @@ -45,7 +44,7 @@ public Optional schemaDescription() { return Optional.empty(); } var apiColumns = schemaObject.apiTableDef().primaryKeys(); - var unsupported = apiColumns.filterBySupport(ApiSupportDef::isUnsupportedInsert); + var unsupported = apiColumns.filterBySupport(x -> !x.insert()); if (!unsupported.isEmpty()) { throw new IllegalStateException("Unsupported columns primary key: %s" + unsupported); } diff --git a/src/main/java/io/stargate/sgv2/jsonapi/service/schema/tables/ApiSupportDef.java b/src/main/java/io/stargate/sgv2/jsonapi/service/schema/tables/ApiSupportDef.java index d8b9ab42e..fb117f564 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/service/schema/tables/ApiSupportDef.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/service/schema/tables/ApiSupportDef.java @@ -57,10 +57,6 @@ default boolean isUnsupportedDML() { return !insert() || !read() || !filter(); } - default boolean isUnsupportedInsert() { - return !insert(); - } - /** * Helper record to be used when the support can be determined at compile time, or easily cached. */