Skip to content

Commit

Permalink
fix: null options for equivalent change streams (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
iceriver123 authored Sep 22, 2024
1 parent af1db7d commit 331b0fe
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -379,12 +379,14 @@ public List<String> generateDifferenceStatements(Map<String, Boolean> options)

String optionsDiff = generateOptionsUpdates(Maps.difference(oldOptionsKv, newOptionsKv));

if (optionsDiff != null) {
output.add(
"ALTER CHANGE STREAM "
+ changedChangeStream.rightValue().getName()
+ " SET OPTIONS ("
+ optionsDiff
+ ")");
}
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/test/resources/newDdl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,11 @@ Create UNIQUE NULL_filtered index IF NOT EXISTS test4 on test1 ( col1 ) STORING

Create table myCreatedTable (mycol int64) primary key (mycol);
create change stream toremain for all options (retention_period = '36h');
create change stream toremain2 for all
OPTIONS (
value_capture_type = 'OLD_AND_NEW_VALUES',
retention_period = '7d',
exclude_ttl_deletes = true);
create change stream toBeChanged for myTable2 ( col1, col3, col4), mytable3 () options (retention_period = '48h');
create change stream toCreate for mytable4 options (retention_period = '36h');
create change stream toCreateAll for all;
Expand Down
5 changes: 5 additions & 0 deletions src/test/resources/originalDdl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,11 @@ Create index IF NOT EXISTS test4 on test1 ( col1 ) STORING ( col2 )

Create table myToBeDeletedTable (mycol int64) primary key (mycol);
create change stream toremain for all options (retention_period = '36h');
create change stream toremain2 for all
OPTIONS (
retention_period = '7d',
value_capture_type = 'OLD_AND_NEW_VALUES',
exclude_ttl_deletes = true);
create change stream toBeDeleted for myTable options (retention_period = '36h');
create change stream toBeChanged for myTable1, myTable2 ( col1, col3) options (retention_period = '36h');
create change stream toBeChangedOnlyTable for myTable1, myTable2 ( col1, col3) options (retention_period = '36h');
Expand Down

0 comments on commit 331b0fe

Please sign in to comment.