Skip to content

Fix #2468 alterCollection, approach 2 (like "alterTable") -- PRIMARY option#2471

Draft
tatu-at-datastax wants to merge 27 commits into
mainfrom
tatu/2468-alter-collection-approach-2
Draft

Fix #2468 alterCollection, approach 2 (like "alterTable") -- PRIMARY option#2471
tatu-at-datastax wants to merge 27 commits into
mainfrom
tatu/2468-alter-collection-approach-2

Conversation

@tatu-at-datastax
Copy link
Copy Markdown
Contributor

What this PR does:

Implements "alterCollection" command to allow enabling of "lexical" indexing, with "alterTable" style

Which issue(s) this PR fixes:
Fixes #2468

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CLA Signed: DataStax CLA

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

📉 Unit Test Coverage Delta vs Main Branch

Metric Value
Main Branch 51.67%
This PR 51.42%
Delta 🔴 -0.25%
⚠️ Coverage decreased

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

Unit Test Coverage Report

Overall Project 51.42% -0.63% 🍏
Files changed 12.17%

File Coverage
SchemaException.java 100% 🍏
CommandName.java 97.31% 🍏
InsertCollectionOperation.java 94.43% -1.28%
CreateCollectionOperation.java 68.14% -0.44% 🍏
CommandObjectMapperHandler.java 24.69% -7.41%
CollectionLexicalConfig.java 20.53% -25.22%
CollectionDriverExceptionHandler.java 11.76% 🍏
CollectionSchemaObject.java 9.24% -0.5%
AlterCollectionOperationImpl.java 0%
AlterCollectionCommand.java 0%
CreateCollectionCommandResolver.java 0% -2.8%
AlterCollectionCommandResolver.java 0%
CollectionResource.java 0% 🍏
AlterCollectionLexicalOperation.java 0%
CollectionTableComment.java 0%

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

📉 Integration Test Coverage Delta vs Main Branch (dse69-it)

Metric Value
Main Branch 72.77%
This PR 72.43%
Delta 🔴 -0.34%
⚠️ Coverage decreased

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

Integration Test Coverage Report (dse69-it)

Overall Project 72.43% -0.59% 🍏
Files changed 17.38%

File Coverage
CommandName.java 100% 🍏
SchemaException.java 100% 🍏
CreateCollectionCommandResolver.java 97.73% 🍏
CollectionResource.java 96.8% 🍏
InsertCollectionOperation.java 91.43% -1.28%
CommandObjectMapperHandler.java 91.36% -7.41%
CollectionDriverExceptionHandler.java 83.53% 🍏
AlterCollectionCommand.java 80% -20% 🍏
CreateCollectionOperation.java 70.18% -6.28%
AlterCollectionOperationImpl.java 66.67% -33.33% 🍏
CollectionSchemaObject.java 66.22% 🍏
CollectionLexicalConfig.java 42.82% -15.54%
CollectionTableComment.java 35% -65%
AlterCollectionCommandResolver.java 23.24% -76.76%
AlterCollectionLexicalOperation.java 0%

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

📈 Integration Test Coverage Delta vs Main Branch (hcd-it)

Metric Value
Main Branch 74.19%
This PR 74.29%
Delta 🟢 +0.10%
✅ Coverage improved!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

Integration Test Coverage Report (hcd-it)

Overall Project 74.29% -0.05% 🍏
Files changed 92.51% 🍏

File Coverage
CommandName.java 100% 🍏
SchemaException.java 100% 🍏
CommandObjectMapperHandler.java 98.77% 🍏
CreateCollectionCommandResolver.java 97.98% 🍏
AlterCollectionCommandResolver.java 97.89% -2.11% 🍏
CollectionResource.java 96.8% 🍏
InsertCollectionOperation.java 94.65% 🍏
CollectionLexicalConfig.java 92.38% 🍏
CollectionDriverExceptionHandler.java 91.76% 🍏
AlterCollectionLexicalOperation.java 87.8% -12.2% 🍏
CollectionTableComment.java 82.5% -17.5% 🍏
CreateCollectionOperation.java 81.68% 🍏
AlterCollectionCommand.java 80% -20% 🍏
CollectionSchemaObject.java 71.93% 🍏
AlterCollectionOperationImpl.java 66.67% -33.33% 🍏

@tatu-at-datastax tatu-at-datastax changed the title Fix #2468 alterCollection, approach 1 Fix #2468 alterCollection, approach 2 (like "alterTable") May 19, 2026
description =
"Command that alters mutable settings of an existing collection. Currently supports enabling the 'lexical' feature.")
@JsonTypeName(CommandName.Names.ALTER_COLLECTION)
public record AlterCollectionCommand(AlterCollectionOperation operation)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modeled after AlterTableCommand, same approach with polymorphich operation types.

*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.WRAPPER_OBJECT)
@JsonSubTypes({@JsonSubTypes.Type(value = AlterCollectionOperationImpl.EnableLexical.class)})
public sealed interface AlterCollectionOperation
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modeled after AlterTableOperation, but uses sealed types to reduce likelihood of missing handlers

import org.eclipse.microprofile.openapi.annotations.media.Schema;

/** Each operation that {@link AlterCollectionCommand} understands is represented by a record. */
public class AlterCollectionOperationImpl {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this is modeled after AlterTableOperationImpl.

@tatu-at-datastax tatu-at-datastax changed the title Fix #2468 alterCollection, approach 2 (like "alterTable") Fix #2468 alterCollection, approach 2 (like "alterTable") -- PRIMARY option May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add command alterCollection, initially to allow enabling "lexical" feature after creation

1 participant