Skip to content

Bugfix: Migrate empty text values correctly #381

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 3 commits into from
Aug 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes

## [5.5.1] - 2025-08-01
- Fixed issue related to empty text fields not getting migrated (introduced in 5.4.0). `Null` fields will still be skipped, however not empty strings.
- Filtered rows will now be logged at LOG4J `TRACE` level to avoid filling the logs. Users can enabled `TRACE` level logging if such logs are needed.

## [5.5.0] - 2025-07-07
- Logged metrics will now report how many Partition-Ranges out of the configured [`numParts`](https://github.com/datastax/cassandra-data-migrator/blob/main/src/resources/cdm-detailed.properties#L230) passed or failed.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ public boolean shouldFilterRecord(Record record) {
if (this.filterColumnEnabled) {
String col = (String) cqlTable.getData(this.filterColumnIndex, record.getOriginRow());
if (null != col && this.filterColumnString.equalsIgnoreCase(col.trim())) {
if (logger.isInfoEnabled())
logger.info("Filter Column removing: {}", record.getPk());
if (logger.isTraceEnabled())
logger.trace("Filter Column removing: {}", record.getPk());
return true;
}
}
Expand All @@ -121,8 +121,8 @@ public boolean shouldFilterRecord(Record record) {
return false;
}
if (originWriteTimeStamp < minWriteTimeStampFilter || originWriteTimeStamp > maxWriteTimeStampFilter) {
if (logger.isInfoEnabled())
logger.info("Timestamp filter removing record with primary key: {} with write timestamp: {}",
if (logger.isTraceEnabled())
logger.trace("Timestamp filter removing record with primary key: {} with write timestamp: {}",
record.getPk(), originWriteTimeStamp);
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ protected BoundStatement bind(Row originRow, Row targetRow, Integer ttl, Long wr
bindValue = cqlTable.getOtherCqlTable().getAndConvertData(originIndex, originRow);
}

if (!(null == bindValue || (bindValue instanceof String && ((String) bindValue).isEmpty()))) {
if (!(null == bindValue)) {
boundStatement = boundStatement.set(currentBindIndex, bindValue,
cqlTable.getBindClass(targetIndex));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ protected BoundStatement bind(Row originRow, Row targetRow, Integer ttl, Long wr
bindValueTarget = cqlTable.getOtherCqlTable().getAndConvertData(originIndex, originRow);
}

if (!(null == bindValueTarget
|| (bindValueTarget instanceof String && ((String) bindValueTarget).isEmpty()))) {
if (!(null == bindValueTarget)) {
boundStatement = boundStatement.set(currentBindIndex, bindValueTarget,
cqlTable.getBindClass(targetIndex));
}
Expand Down