Skip to content

NODEJS-666: Extend driver vector support to arbitrary subtypes and fix handling of variable length types (OSS C* 5.0) #427

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

Merged
merged 107 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
8bcd338
Update Jenkinsfile
SiyaoIsHiding Sep 9, 2024
86da0c0
Update Jenkinsfile
SiyaoIsHiding Sep 9, 2024
34d5024
Update Jenkinsfile
SiyaoIsHiding Sep 9, 2024
0699654
Update Jenkinsfile
SiyaoIsHiding Sep 9, 2024
5a5a9d8
Update Jenkinsfile
SiyaoIsHiding Sep 10, 2024
e715972
Update Jenkinsfile
SiyaoIsHiding Sep 10, 2024
406a8b6
Update Jenkinsfile
SiyaoIsHiding Sep 10, 2024
7653d95
Update test-helper.js
SiyaoIsHiding Sep 10, 2024
e33ba76
Update test-helper.js
SiyaoIsHiding Sep 10, 2024
ddcdec4
fixyaml
SiyaoIsHiding Sep 10, 2024
3796202
Update Jenkinsfile
SiyaoIsHiding Sep 10, 2024
3fe64ce
Merge branch 'master' of github.com:SiyaoIsHiding/nodejs-driver
SiyaoIsHiding Sep 11, 2024
c59e57c
fix eslint
SiyaoIsHiding Sep 11, 2024
dc66e2e
fix eslint
SiyaoIsHiding Sep 11, 2024
28fe313
fix virtual table
SiyaoIsHiding Sep 11, 2024
594be60
typo `
SiyaoIsHiding Sep 11, 2024
2a4575d
5.0-beta1, virtual table
SiyaoIsHiding Sep 11, 2024
3f5143d
method too large???
SiyaoIsHiding Sep 11, 2024
ed616b5
Update Jenkinsfile
SiyaoIsHiding Sep 11, 2024
d4bcb14
Update Jenkinsfile
SiyaoIsHiding Sep 11, 2024
552589e
fix isCassandraGreaterThan
SiyaoIsHiding Sep 11, 2024
73672c9
Merge branch 'master' of github.com:SiyaoIsHiding/nodejs-driver
SiyaoIsHiding Sep 11, 2024
5e91c29
eslint
SiyaoIsHiding Sep 11, 2024
51a00a9
Update Jenkinsfile
SiyaoIsHiding Sep 12, 2024
72e6fa8
c45-working
SiyaoIsHiding Sep 13, 2024
ffd0ded
add hcd
SiyaoIsHiding Sep 13, 2024
a324b5e
merge
SiyaoIsHiding Sep 13, 2024
824eca6
eslint
SiyaoIsHiding Sep 14, 2024
3873621
extend wait time
SiyaoIsHiding Sep 14, 2024
db633d4
deleting -j port
SiyaoIsHiding Sep 16, 2024
70a95e3
change test helper ccm commands to look exactly the same as lukasz's
SiyaoIsHiding Sep 16, 2024
ffcc240
wait for longer
SiyaoIsHiding Sep 17, 2024
d67111a
forNodeToBeAdded instead of forNodeUp
SiyaoIsHiding Sep 17, 2024
441a3a8
add all distributions to jenkinsfil
SiyaoIsHiding Sep 17, 2024
2618f42
method too large?
SiyaoIsHiding Sep 17, 2024
d062967
method too large2
SiyaoIsHiding Sep 17, 2024
44ca6af
method too large3
SiyaoIsHiding Sep 17, 2024
653a30f
at least add 3.11
SiyaoIsHiding Sep 17, 2024
845b0fa
delete some scaffold code
SiyaoIsHiding Sep 17, 2024
fcd0144
add nodenv install -list
SiyaoIsHiding Sep 19, 2024
7cabb9a
Merge branch 'master' of github.com:SiyaoIsHiding/nodejs-driver
SiyaoIsHiding Sep 19, 2024
6b42d4c
delete node v16
SiyaoIsHiding Sep 19, 2024
90a3722
update jenkinsfile for node 22
SiyaoIsHiding Sep 19, 2024
7bfdb9d
del description
SiyaoIsHiding Sep 19, 2024
54ae08b
comment out dse 6.8
SiyaoIsHiding Sep 19, 2024
4155270
delete notify slack
SiyaoIsHiding Sep 19, 2024
54633fe
uncomment 6.8.30
SiyaoIsHiding Sep 19, 2024
cd583f4
add back notify slack
SiyaoIsHiding Sep 20, 2024
d9ea8f5
delete notifyslack when success or unstable
SiyaoIsHiding Sep 20, 2024
23b267b
Update package.json
SiyaoIsHiding Sep 25, 2024
0b32897
typing not working, annoying
SiyaoIsHiding Sep 25, 2024
37255d9
Update package.json
SiyaoIsHiding Sep 25, 2024
ec4d008
most simple vector integration test working
SiyaoIsHiding Sep 25, 2024
e1b3573
value?.get not a function
SiyaoIsHiding Sep 26, 2024
7f02b84
Skip g.V().count)() related tests on dse6.9.0
SiyaoIsHiding Sep 26, 2024
1017261
use 5.0 instead of 5.0-beta1, use openjdk@17
SiyaoIsHiding Sep 26, 2024
6aaf093
lint
SiyaoIsHiding Sep 26, 2024
bd49d08
revert to 5.0-beta1
SiyaoIsHiding Sep 26, 2024
4a8f849
merge three functions into one
SiyaoIsHiding Sep 26, 2024
80112a3
delete notifySlack for ScehduledTesting
SiyaoIsHiding Sep 26, 2024
2c5b5e0
merge three functions into one
SiyaoIsHiding Sep 26, 2024
7b6f29d
add back long description
SiyaoIsHiding Sep 26, 2024
2f2a0ea
change package-lock.json
SiyaoIsHiding Sep 26, 2024
b61d998
float becomes double?
SiyaoIsHiding Sep 27, 2024
51a3c6c
methods are considered enumerable
SiyaoIsHiding Sep 27, 2024
f10cda6
refactor to class
SiyaoIsHiding Sep 27, 2024
ab35ee7
pass all existing tests
SiyaoIsHiding Sep 27, 2024
cecd530
pass existing tests
SiyaoIsHiding Sep 27, 2024
2a503dd
update package-lock
SiyaoIsHiding Sep 27, 2024
70cfb40
Update Jenkinsfile
SiyaoIsHiding Oct 1, 2024
ab9eb82
Update Jenkinsfile
SiyaoIsHiding Oct 1, 2024
60ea99b
Update Jenkinsfile
SiyaoIsHiding Oct 1, 2024
4c908ba
Update Jenkinsfile
SiyaoIsHiding Oct 1, 2024
a736b3a
Update Jenkinsfile to 5.0.1
SiyaoIsHiding Oct 2, 2024
9c35671
delete java version
SiyaoIsHiding Oct 2, 2024
e61f695
massive refactor of typedef ColumnInfo
SiyaoIsHiding Oct 4, 2024
8f2d5f2
refactor parseTypeName
SiyaoIsHiding Oct 4, 2024
35abc6c
refactor guessDataType
SiyaoIsHiding Oct 4, 2024
cbe002c
fixed several tests
SiyaoIsHiding Oct 4, 2024
706e7c9
fix eslint
SiyaoIsHiding Oct 4, 2024
f1e1673
refactor pass vector test
SiyaoIsHiding Oct 10, 2024
03a4432
trying to add var size vint, not working yet
SiyaoIsHiding Oct 11, 2024
482ed4c
all unit tests passed
SiyaoIsHiding Oct 12, 2024
45c4ef7
float diff
SiyaoIsHiding Oct 12, 2024
bbdd976
pass initial integration tests
SiyaoIsHiding Oct 14, 2024
ce81338
guess data type pass
SiyaoIsHiding Oct 16, 2024
aeafce6
add comprehensive integration tests
SiyaoIsHiding Oct 22, 2024
143eb7d
Merge branch 'master' into vector
SiyaoIsHiding Oct 22, 2024
ccb6257
add type declarations
SiyaoIsHiding Oct 23, 2024
203047d
add more integration tests
SiyaoIsHiding Oct 24, 2024
ad0682c
fix guessDataType
SiyaoIsHiding Oct 24, 2024
e5205e1
Merge branch 'master' into vector
SiyaoIsHiding Oct 24, 2024
9448898
add prepare to be false
SiyaoIsHiding Oct 25, 2024
67a1233
refactor vector data structure and test data provider
SiyaoIsHiding Feb 13, 2025
f218183
revert package-lock.json
SiyaoIsHiding Feb 13, 2025
6a4678b
Merge branch 'master' of github.com:datastax/nodejs-driver into vector
SiyaoIsHiding Feb 13, 2025
a515250
revert @types/mocha
SiyaoIsHiding Feb 13, 2025
9ba3fa9
revert package-lock.json
SiyaoIsHiding Feb 13, 2025
82b10dc
delete // const { types } = require('./types');
SiyaoIsHiding Feb 13, 2025
fa561a4
refactor API from (value, type.info) to (value, type)
SiyaoIsHiding Feb 14, 2025
6827dea
Fixing ArrayIterator
SiyaoIsHiding Feb 14, 2025
f94a29e
skip set<duration>
SiyaoIsHiding Feb 14, 2025
f456043
Deal with duration
SiyaoIsHiding Feb 14, 2025
eb1957c
doc change
SiyaoIsHiding Feb 19, 2025
d202034
Update README.md
SiyaoIsHiding Feb 19, 2025
0c641c7
add subtype hint in README
SiyaoIsHiding Feb 20, 2025
467d803
Merge branch 'vector' of github.com:SiyaoIsHiding/nodejs-driver into …
SiyaoIsHiding Feb 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/features/datatypes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ tuple|[Tuple](tuples)
uuid|[Uuid](uuids)
varchar|String
varint|[Integer](numerical)
vector|[Float32Array](collections)
vector|[Vector](collections)

## Encoding data

Expand Down
9 changes: 5 additions & 4 deletions doc/features/datatypes/collections/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ client.execute('SELECT map_val FROM tbl')

### Vector

As of version 4.7.0 the driver also includes support for the vector type available in Cassandra 5.0. Vectors are represented as instances of
the [Float32Array] class. For example, to create and write to a vector with three dimensions you can do the following:
The driver supports vectors of arbitrary subtypes available in Apache Cassandra 5.0. Vectors are represented as instances of `cassandra.types.Vector` class. For example, to create and write to a vector with three dimensions you can do the following:

```javascript
await c.connect()
Expand All @@ -84,8 +83,10 @@ await c.connect()
.then(() => c.execute("create custom index ann_index on test.foo(j) using 'StorageAttachedIndex'"))

// Base inserts using simple and prepared statements
.then(() => c.execute(`insert into test.foo (i, j) values (?, ?)`, [cassandra.types.Integer.fromInt(1), new Float32Array([8, 2.3, 58])]))
.then(() => c.execute(`insert into test.foo (i, j) values (?, ?)`, [cassandra.types.Integer.fromInt(5), new Float32Array([23, 18, 3.9])], {prepare: true}));
.then(() => c.execute(`insert into test.foo (i, j) values (?, ?)`, [cassandra.types.Integer.fromInt(1), new cassandra.types.Vector([8, 2.3, 58], 'float')]))
.then(() => c.execute(`insert into test.foo (i, j) values (?, ?)`, [cassandra.types.Integer.fromInt(5), new cassandra.types.Vector([23, 18, 3.9])], {prepare: true}));
```

In driver versions 4.7.0 - 4.7.2, the vector of floats was represented as a [Float32Array]. This is still supported for backward compatibility, but it is deprecated, and it is recommended to use the `cassandra.types.Vector` class instead.

[Float32Array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array
4 changes: 4 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,10 @@ export namespace errors {
constructor(address: string, maxRequestsPerConnection: number, connectionLength: number);
}

class VIntOutOfRangeException extends DriverError {
constructor(long: Long);
}

abstract class DriverError extends Error {
info: string;

Expand Down
Loading