Skip to content

Commit 95ff7a6

Browse files
authored
Bugfix: Migrate empty text values correctly (#381)
* Fixed issue related to empty-text-values not getting migrated (throwing exception) * Filtered records fill the log files, hence making it trace level (not default INFO level). Users can enable TRACE logging it they are interested in such logs * Updated release notes
1 parent aeaada3 commit 95ff7a6

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

RELEASE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Release Notes
22

3+
## [5.5.1] - 2025-08-01
4+
- 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.
5+
- 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.
6+
37
## [5.5.0] - 2025-07-07
48
- 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.
59

src/main/java/com/datastax/cdm/cql/statement/OriginSelectStatement.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ public boolean shouldFilterRecord(Record record) {
108108
if (this.filterColumnEnabled) {
109109
String col = (String) cqlTable.getData(this.filterColumnIndex, record.getOriginRow());
110110
if (null != col && this.filterColumnString.equalsIgnoreCase(col.trim())) {
111-
if (logger.isInfoEnabled())
112-
logger.info("Filter Column removing: {}", record.getPk());
111+
if (logger.isTraceEnabled())
112+
logger.trace("Filter Column removing: {}", record.getPk());
113113
return true;
114114
}
115115
}
@@ -121,8 +121,8 @@ public boolean shouldFilterRecord(Record record) {
121121
return false;
122122
}
123123
if (originWriteTimeStamp < minWriteTimeStampFilter || originWriteTimeStamp > maxWriteTimeStampFilter) {
124-
if (logger.isInfoEnabled())
125-
logger.info("Timestamp filter removing record with primary key: {} with write timestamp: {}",
124+
if (logger.isTraceEnabled())
125+
logger.trace("Timestamp filter removing record with primary key: {} with write timestamp: {}",
126126
record.getPk(), originWriteTimeStamp);
127127
return true;
128128
}

src/main/java/com/datastax/cdm/cql/statement/TargetInsertStatement.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ protected BoundStatement bind(Row originRow, Row targetRow, Integer ttl, Long wr
7979
bindValue = cqlTable.getOtherCqlTable().getAndConvertData(originIndex, originRow);
8080
}
8181

82-
if (!(null == bindValue || (bindValue instanceof String && ((String) bindValue).isEmpty()))) {
82+
if (!(null == bindValue)) {
8383
boundStatement = boundStatement.set(currentBindIndex, bindValue,
8484
cqlTable.getBindClass(targetIndex));
8585
}

src/main/java/com/datastax/cdm/cql/statement/TargetUpdateStatement.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ protected BoundStatement bind(Row originRow, Row targetRow, Integer ttl, Long wr
8989
bindValueTarget = cqlTable.getOtherCqlTable().getAndConvertData(originIndex, originRow);
9090
}
9191

92-
if (!(null == bindValueTarget
93-
|| (bindValueTarget instanceof String && ((String) bindValueTarget).isEmpty()))) {
92+
if (!(null == bindValueTarget)) {
9493
boundStatement = boundStatement.set(currentBindIndex, bindValueTarget,
9594
cqlTable.getBindClass(targetIndex));
9695
}

0 commit comments

Comments
 (0)