Skip to content

Commit 620a193

Browse files
committed
Allow nulls in non-pk columns (DiffData)
1 parent ca0612c commit 620a193

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/java/datastax/astra/migrate/DiffJobSession.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,16 @@ private String isDifferent(Row sourceRow, Row astraRow) {
173173
IntStream.range(0, selectColTypes.size()).parallel().forEach(index -> {
174174
MigrateDataType dataTypeObj = selectColTypes.get(index);
175175
Object source = getData(dataTypeObj, index, sourceRow);
176-
Optional<Object> optionalVal = handleBlankInPrimaryKey(index, source, dataTypeObj.typeClass, sourceRow, false);
176+
if (index < idColTypes.size()) {
177+
Optional<Object> optionalVal = handleBlankInPrimaryKey(index, source, dataTypeObj.typeClass, sourceRow, false);
178+
if (optionalVal.isPresent()) {
179+
source = optionalVal.get();
180+
}
181+
}
177182

178183
Object astra = getData(dataTypeObj, index, astraRow);
179184

180-
boolean isDiff = dataTypeObj.diff(optionalVal.get(), astra);
185+
boolean isDiff = dataTypeObj.diff(source, astra);
181186
if (isDiff) {
182187
if (dataTypeObj.typeClass.equals(UdtValue.class)) {
183188
String sourceUdtContent = ((UdtValue) source).getFormattedContents();

0 commit comments

Comments
 (0)