CASSANALYTICS-26: Support vector data type#144
Open
lukasz-antoniak wants to merge 2 commits intoapache:trunkfrom
Open
CASSANALYTICS-26: Support vector data type#144lukasz-antoniak wants to merge 2 commits intoapache:trunkfrom
lukasz-antoniak wants to merge 2 commits intoapache:trunkfrom
Conversation
yifan-c
reviewed
Mar 18, 2026
|
|
||
| public abstract CqlField.CqlList list(CqlField.CqlType type); | ||
|
|
||
| public abstract CqlField.CqlVector vector(CqlField.CqlType type, int dimentions); |
Contributor
There was a problem hiding this comment.
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); |
Contributor
There was a problem hiding this comment.
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()); |
Contributor
There was a problem hiding this comment.
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())); | ||
| } |
Contributor
There was a problem hiding this comment.
I think vector is a single cell data type. But the for-loop adds multiple cells. Interesting that the tests are passing.
Contributor
There was a problem hiding this comment.
Ah. This method is only used for creating test mutations for CDC.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes CASSANALYTICS-26.