Skip to content

Commit 09d6f13

Browse files
committed
Fixed tests(smoke, regression & feature) scripts & code related to writetime/ttl
1 parent 15878dd commit 09d6f13

File tree

12 files changed

+48
-6
lines changed

12 files changed

+48
-6
lines changed

SIT/features/01_constant_column/breakData.cql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,11 @@
1414

1515
DELETE FROM target.feature_constant_column WHERE key='key2' AND const1='abcd';
1616
UPDATE target.feature_constant_column SET value='value999' WHERE key='key3' AND const1='abcd';
17+
18+
# This upsert to origin will update the writetime on origin to be newer than target
19+
INSERT INTO origin.feature_constant_column(key,value) VALUES ('key1','valueA');
20+
INSERT INTO origin.feature_constant_column(key,value) VALUES ('key2','valueB');
21+
INSERT INTO origin.feature_constant_column(key,value) VALUES ('key3','valueC');
22+
1723
SELECT * FROM target.feature_constant_column;
1824

SIT/features/02_explode_map/breakData.cql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,11 @@ DELETE FROM target.feature_explode_map WHERE key='key2';
1414
UPDATE target.feature_explode_map SET value='value999' WHERE key='key3' AND fruit='apples';
1515
UPDATE target.feature_explode_map SET fruit_qty=999 WHERE key='key3' AND fruit='oranges';
1616
DELETE FROM target.feature_explode_map WHERE key='key3' AND fruit='kiwi';
17+
18+
# This upsert to origin will update the writetime on origin to be newer than target
19+
INSERT INTO origin.feature_explode_map(key,value,fruits) VALUES ('key1','valueA', {'apples': 3, 'oranges': 5, 'bananas': 2, 'grapes': 11});
20+
INSERT INTO origin.feature_explode_map(key,value,fruits) VALUES ('key2','valueB', {'apples': 4, 'oranges': 6, 'bananas': 3, 'pears': 7});
21+
INSERT INTO origin.feature_explode_map(key,value,fruits) VALUES ('key3','valueC', {'apples': 5, 'oranges': 7, 'bananas': 4, 'kiwi': 42});
22+
1723
SELECT * FROM target.feature_explode_map;
1824

SIT/features/03_codec/breakData.cql

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,13 @@ UPDATE target.codec SET
1818
val_timestamp='2024-04-16 10:30:00+0000',
1919
val_decimal=999.1234
2020
WHERE key='key3';
21+
22+
# This upsert to origin will update the writetime on origin to be newer than target
23+
INSERT INTO origin.codec(key,val_int,val_bigint,val_timestamp,val_decimal,val_double)
24+
VALUES ('key1','1234' ,'9223372036854775807','040616110000', '3.14', '21474836470.7');
25+
INSERT INTO origin.codec(key,val_int,val_bigint,val_timestamp,val_decimal,val_double)
26+
VALUES ('key2','12345' ,'2147483648' ,'990616110000', '4.14', '21474836470.7');
27+
INSERT INTO origin.codec(key,val_int,val_bigint,val_timestamp,val_decimal,val_double)
28+
VALUES ('key3','123456','3141592653589793' ,'990616110000', '5.14', '21474836470.7');
29+
2130
SELECT * FROM target.codec;

SIT/features/06_partition_range/breakData.cql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,11 @@
1414

1515
DELETE FROM target.feature_partition_range WHERE key='key1';
1616
UPDATE target.feature_partition_range SET value='value999' WHERE key='key2';
17+
18+
# This upsert to origin will update the writetime on origin to be newer than target
19+
INSERT INTO origin.feature_partition_range(key,value) VALUES ('key1','valueA');
20+
INSERT INTO origin.feature_partition_range(key,value) VALUES ('key2','valueB');
21+
INSERT INTO origin.feature_partition_range(key,value) VALUES ('key3','valueC');
22+
1723
SELECT * FROM target.feature_partition_range;
1824

SIT/regression/01_explode_map_with_constants/breakData.cql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,10 @@ DELETE FROM target.feature_explode_map_with_constants WHERE const1='abcd' AND co
1616
UPDATE target.feature_explode_map_with_constants SET time=7398730800000 WHERE const1='abcd' AND const2=1234 AND key='key3' AND fruit='apples';
1717
UPDATE target.feature_explode_map_with_constants SET fruit_qty=999 WHERE const1='abcd' AND const2=1234 AND key='key3' AND fruit='oranges';
1818
DELETE FROM target.feature_explode_map_with_constants WHERE const1='abcd' AND const2=1234 AND key='key3' AND fruit='kiwi';
19+
20+
# This upsert to origin will update the writetime on origin to be newer than target
21+
INSERT INTO origin.feature_explode_map_with_constants(key,time,fruits) VALUES ('key1','1087383600000', {'apples': 3, 'oranges': 5, 'bananas': 2, 'grapes': 11});
22+
INSERT INTO origin.feature_explode_map_with_constants(key,time,fruits) VALUES ('key2','1087383600000', {'apples': 4, 'oranges': 6, 'bananas': 3, 'pears': 7});
23+
INSERT INTO origin.feature_explode_map_with_constants(key,time,fruits) VALUES ('key3','1087383600000', {'apples': 5, 'oranges': 7, 'bananas': 4, 'kiwi': 42});
24+
1925
SELECT * FROM target.feature_explode_map_with_constants;

SIT/regression/02_ColumnRenameWithConstantsAndExplode/breakData.cql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
limitations under the License.
1313
*/
1414

15-
DELETE FROM target.column_rename_with_constants_and_explode WHERE customer='CUSTOMER' AND year=2023 AND key_name='key2';
16-
UPDATE target.column_rename_with_constants_and_explode SET fruit_qty=999 WHERE customer='CUSTOMER' AND year=2023 AND key_name='key3' AND fruit='oranges';
17-
DELETE FROM target.column_rename_with_constants_and_explode WHERE customer='CUSTOMER' AND year=2023 AND key_name='key3' AND fruit='kiwi';
15+
DELETE FROM target.column_rename_with_constants_and_explode WHERE customer='CUSTOMER' AND year=2023 AND key_name='key2';
16+
UPDATE target.column_rename_with_constants_and_explode SET fruit_qty=999 WHERE customer='CUSTOMER' AND year=2023 AND key_name='key3' AND fruit='oranges';
17+
DELETE FROM target.column_rename_with_constants_and_explode WHERE customer='CUSTOMER' AND year=2023 AND key_name='key3' AND fruit='kiwi';
1818
SELECT * FROM target.column_rename_with_constants_and_explode;
1919

SIT/regression/03_performance/breakData.cql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
limitations under the License.
1313
*/
1414

15-
DELETE FROM target.regression_performance WHERE pk_id = 600;
15+
DELETE FROM target.regression_performance WHERE pk_id = 600;
1616
SELECT * FROM target.regression_performance WHERE pk_id >= 400 AND pk_id < 700 ALLOW FILTERING;

SIT/regression/03_performance/execute.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,8 @@ dsbulk load -url $workingDir/data.csv -h $CASS_CLUSTER -u $CASS_USERNAME -p $CAS
2828
dsbulk load -url $workingDir/data_break.csv -h $CASS_CLUSTER -u $CASS_USERNAME -p $CASS_PASSWORD -k target -t regression_performance
2929
cqlsh -u $CASS_USERNAME -p $CASS_PASSWORD $CASS_CLUSTER -f $workingDir/breakData.cql > $workingDir/breakData.out 2> $workingDir/breakData.err
3030

31+
# This upsert to origin will update the writetime on origin to be newer than target
32+
dsbulk load -url $workingDir/data.csv -h $CASS_CLUSTER -u $CASS_USERNAME -p $CASS_PASSWORD -k origin -t regression_performance
33+
3134
/local/cdm.sh -f cdm.txt -s fixData -d "$workingDir" > cdm.fixData.out 2>cdm.fixData.err
3235
/local/cdm-assert.sh -f cdm.fixData.out -a cdm.fixData.assert -d "$workingDir"

SIT/regression/03_performance/migrate.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# limitations under the License.
1313
#
1414

15-
1615
spark.cdm.connect.origin.host cdm-sit-cass
1716
spark.cdm.connect.target.host cdm-sit-cass
1817

SIT/smoke/02_autocorrect_kvp/breakData.cql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,11 @@
1212

1313
DELETE FROM target.smoke_autocorrect_kvp WHERE key='key2';
1414
UPDATE target.smoke_autocorrect_kvp SET value='value999' WHERE key='key3';
15+
16+
# This upsert to origin will update the writetime on origin to be newer than target
17+
INSERT INTO origin.smoke_autocorrect_kvp(key,value) VALUES ('key1','valueA');
18+
INSERT INTO origin.smoke_autocorrect_kvp(key,value) VALUES ('key2','valueB');
19+
INSERT INTO origin.smoke_autocorrect_kvp(key,value) VALUES ('key3','valueC');
20+
1521
SELECT * FROM target.smoke_autocorrect_kvp;
1622

0 commit comments

Comments
 (0)