Skip to content

Commit 500cacd

Browse files
authored
issue 284 - Use origin ks/tbl when target property is missing (#285)
1 parent e7a90df commit 500cacd

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

RELEASE.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Release Notes
2+
## [4.3.4] - 2024-07-31
3+
- Use `spark.cdm.schema.origin.keyspaceTable` when `spark.cdm.schema.target.keyspaceTable` is missing. Fixes [bug introduced in prior version](https://github.com/datastax/cassandra-data-migrator/issues/284).
4+
25
## [4.3.3] - 2024-07-22
36
- Removed deprecated functionality related to processing token-ranges via partition-file
47
- Upgraded Spark Cassandra Connector (SCC) version to 3.5.1.
@@ -8,7 +11,7 @@
811
- Removed deprecated functionality related to retry
912

1013
## [4.3.1] - 2024-07-19
11-
- Fixed a validation run [bug] (https://github.com/datastax/cassandra-data-migrator/issues/266) that sometimes did not report a failed token-range
14+
- Fixed a validation run [bug](https://github.com/datastax/cassandra-data-migrator/issues/266) that sometimes did not report a failed token-range
1215
- Removed deprecated MigrateRowsFromFile job
1316

1417
## [4.3.0] - 2024-07-18

src/main/scala/com/datastax/cdm/job/BasePartitionJob.scala

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,16 @@ abstract class BasePartitionJob extends BaseJob[SplitPartitions.Partition] {
2424
var trackRunFeature: TrackRun = _
2525

2626
override def getParts(pieces: Int): util.Collection[SplitPartitions.Partition] = {
27-
var keyspaceTable = propertyHelper.getString(KnownProperties.TARGET_KEYSPACE_TABLE)
27+
var keyspaceTable: Option[String] = Option(propertyHelper.getString(KnownProperties.TARGET_KEYSPACE_TABLE))
28+
.orElse(Option(propertyHelper.getString(KnownProperties.ORIGIN_KEYSPACE_TABLE)))
29+
30+
val keyspaceTableValue: String = keyspaceTable.getOrElse {
31+
throw new RuntimeException("Both " + KnownProperties.TARGET_KEYSPACE_TABLE + " and "
32+
+ KnownProperties.ORIGIN_KEYSPACE_TABLE + " properties are missing.")
33+
}
2834

2935
if (trackRun) {
30-
trackRunFeature = targetConnection.withSessionDo(targetSession => new TrackRun(targetSession, keyspaceTable))
36+
trackRunFeature = targetConnection.withSessionDo(targetSession => new TrackRun(targetSession, keyspaceTableValue))
3137
}
3238

3339
if (prevRunId != 0) {

0 commit comments

Comments
 (0)