-
Notifications
You must be signed in to change notification settings - Fork 873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JAVA-3061 Remove CqlVector, represent CQL vector types as Lists #1656
Changes from 10 commits
dfd3087
0185e7a
e1b1daf
fcc3ce4
67ec906
e9f30ae
96a521d
50cade5
046b146
671c060
563532b
8f7cb9c
88a01b7
b0815c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -570,10 +570,11 @@ default SelfT setCqlDuration(@NonNull String name, @Nullable CqlDuration v) { | |
*/ | ||
@NonNull | ||
@CheckReturnValue | ||
default SelfT setCqlVector(@NonNull String name, @Nullable CqlVector<?> v) { | ||
default <ElementT> SelfT setVector( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replace There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup, this one too! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
@NonNull String name, @Nullable List<ElementT> v, @NonNull Class<ElementT> elementsClass) { | ||
SelfT result = null; | ||
for (Integer i : allIndicesOf(name)) { | ||
result = (result == null ? this : result).setCqlVector(i, v); | ||
result = (result == null ? this : result).setVector(i, v, elementsClass); | ||
} | ||
assert result != null; // allIndices throws if there are no results | ||
return result; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright DataStax, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.datastax.oss.driver.api.core.type; | ||
|
||
import edu.umd.cs.findbugs.annotations.NonNull; | ||
|
||
/** An ordered collection of some contained value, otherwise known as a "sequence" */ | ||
public interface SequenceType { | ||
|
||
@NonNull | ||
DataType getElementType(); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright DataStax, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.datastax.oss.driver.api.core.type; | ||
|
||
/** | ||
* Type representing a Cassandra vector type as described in CEP-30. At the moment this is | ||
* implemented as a custom type so we include the CustomType interface as well. | ||
*/ | ||
public interface VectorType extends CustomType, SequenceType { | ||
|
||
int getDimensions(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be
vector
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should indeed... good catch @hhughes!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.