Skip to content

Commit 125eefe

Browse files
authored
Feature/vector support (#201)
* CDM-94 Add JaCoCo code coverage plugin and set for minimum coverage percentage or else fail the build * Initil draft to support vectors * Upgrade cassandra-all dependency to 5.0-alpha1 * Implement smoke test for vector cql data type support
1 parent b3cf22e commit 125eefe

File tree

17 files changed

+161
-54
lines changed

17 files changed

+161
-54
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ dependency-reduced-pom.xml
77
cassandra-data-migrator.iml
88
SIT/local
99
*.DS_Store
10+
.classpath
11+
.project
12+
.settings/*

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[![License Apache2](https://img.shields.io/hexpm/l/plug.svg)](http://www.apache.org/licenses/LICENSE-2.0)
22
[![Star on Github](https://img.shields.io/github/stars/datastax/cassandra-data-migrator.svg?style=social)](https://github.com/datastax/cassandra-data-migrator/stargazers)
33
![GitHub release (with filter)](https://img.shields.io/github/v/release/datastax/cassandra-data-migrator?label=latest%20release&color=green&link=!%5BGitHub%20release%20(with%20filter)%5D(https%3A%2F%2Fimg.shields.io%2Fgithub%2Fv%2Frelease%2Fdatastax%2Fcassandra-data-migrator%3Flabel%3Dlatest%2520release%26color%3Dgreen))
4+
![Docker Pulls](https://img.shields.io/docker/pulls/datastax/cassandra-data-migrator)
45

56
# cassandra-data-migrator
67

SIT/cdm-assert.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ assertCmd="egrep 'JobSession.* Final ' \${OUTPUT_FILE} | sed 's/^.*Final //'"
55
_usage() {
66
cat <<EOF
77
8-
usage: $0 -f output_file -a assertFile [-d directory]
8+
usage: $0 -f output_file -a assert_file [-d directory]
99
1010
Required
1111
-f output_file : a file with list of scenarios, same format as cdm.sh
12-
-a assertFile : a file with the assertions
12+
-a assert_file : a file with the assertions
1313
1414
Optional
1515
-d directory : directory in which output_file and assertFile may be found
1616
1717
==================
18-
assertFile Format
18+
assert_file Format
1919
==================
2020
Expected to contain the "Final" job session summary information, generated similar to
2121
${assertCmd}
@@ -66,7 +66,7 @@ else
6666
fi
6767

6868
if [[ -z "$ASSERT_FILENAME" ]]; then
69-
echo "missing -a assertFile"
69+
echo "missing -a assert_file"
7070
argErrors=1
7171
else
7272
if [[ -z "${CONFIG_DIR}" ]]; then

SIT/smoke/04_counters/breakData.cql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ DELETE FROM target.smoke_counters where key='record3';
99
UPDATE origin.smoke_counters SET col2=col2+1 WHERE key='record4';
1010
UPDATE target.smoke_counters SET col2=col2+1 WHERE key='record4';
1111

12-
-- change by different amounts, they shouuld be brought into alignment with
12+
-- change by different amounts, they should be brought into alignment with
1313
-- origin, even if that means going down
1414
UPDATE origin.smoke_counters SET col2=col2+1 WHERE key='record5';
1515
UPDATE target.smoke_counters SET col2=col2+2 WHERE key='record5';
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Read Record Count: 2
2+
Skipped Record Count: 0
3+
Write Record Count: 2
4+
Error Record Count: 0

SIT/smoke_inflight/06_vector/cdm.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
migrateData com.datastax.cdm.job.Migrate /smoke/06_vector/migrate.properties
2+
validateData com.datastax.cdm.job.DiffData /smoke/06_vector/migrate.properties
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Read Record Count: 2
2+
Mismatch Record Count: 0
3+
Corrected Mismatch Record Count: 0
4+
Missing Record Count: 0
5+
Corrected Missing Record Count: 0
6+
Valid Record Count: 2
7+
Skipped Record Count: 0
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash -e
2+
3+
workingDir="$1"
4+
cd "$workingDir"
5+
6+
for scenario in $(cat cdm.txt | awk '{print $1}'); do
7+
/local/cdm.sh -f cdm.txt -s $scenario -d "$workingDir" > "cdm.$scenario.out" 2>cdm.$scenario.err
8+
/local/cdm-assert.sh -f "cdm.$scenario.out" -a "cdm.$scenario.assert" -d "$workingDir"
9+
done
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SELECT * FROM target.smoke_vector;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
col1 | embedding
3+
------+--------------------
4+
1 | [1.1, 2.2, 3.3]
5+
2 | [4.4, -0.01, 0.99]
6+
7+
(2 rows)

0 commit comments

Comments
 (0)