Skip to content

CASSANALYTICS-26: Support vector data type#144

Open
lukasz-antoniak wants to merge 2 commits intoapache:trunkfrom
lukasz-antoniak:CASSANALYTICS-26
Open

CASSANALYTICS-26: Support vector data type#144
lukasz-antoniak wants to merge 2 commits intoapache:trunkfrom
lukasz-antoniak:CASSANALYTICS-26

Conversation

@lukasz-antoniak
Copy link
Member

@lukasz-antoniak lukasz-antoniak marked this pull request as ready for review February 18, 2026 06:50

public abstract CqlField.CqlList list(CqlField.CqlType type);

public abstract CqlField.CqlVector vector(CqlField.CqlType type, int dimentions);
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: dimentions -> dimensions

public abstract class CassandraTypes
{
public static final Pattern COLLECTION_PATTERN = Pattern.compile("^(set|list|map|tuple)<(.+)>$", Pattern.CASE_INSENSITIVE);
public static final Pattern VECTOR_PATTERN = Pattern.compile("^(vector)<(.+),(.*)>$", Pattern.CASE_INSENSITIVE);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the last group (.*) could be improved. We do not want to match 0 characters, right?
I'd propose the pattern ^(vector)<(.+),(.+)>$.

Comment on lines +247 to +248
throw new UnsupportedOperationException("Only native, collection, tuples or UDT data types are supported, "
+ "unsupported data type: " + cqlType.toString());
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: for cassandra 5, vector is also supported, so the error message ("Only native, collection, tuples or UDT data types are supported") is misleading.

Comment on lines +120 to +130
for (Object o : (List<?>) value)
{
if (ttl != NO_TTL)
{
rowBuilder.addCell(BufferCell.expiring(cd, timestamp, ttl, now, type().serialize(o),
CellPath.create(TimeUUID.Generator.nextTimeUUID().toBytes())));
}
else
{
rowBuilder.addCell(BufferCell.live(cd, timestamp, type().serialize(o), randomCellPath()));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think vector is a single cell data type. But the for-loop adds multiple cells. Interesting that the tests are passing.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah. This method is only used for creating test mutations for CDC.

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.

2 participants