Skip to content

Commit

Permalink
issue 284 - Use origin ks/tbl when target property is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
msmygit committed Jul 31, 2024
1 parent e7a90df commit b2e4768
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Release Notes
## [4.3.4] - 2024-07-31
- 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.3.3] - 2024-07-22
- Removed deprecated functionality related to processing token-ranges via partition-file
- Upgraded Spark Cassandra Connector (SCC) version to 3.5.1.
Expand All @@ -8,7 +11,7 @@
- Removed deprecated functionality related to retry

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

## [4.3.0] - 2024-07-18
Expand Down
10 changes: 8 additions & 2 deletions src/main/scala/com/datastax/cdm/job/BasePartitionJob.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,16 @@ abstract class BasePartitionJob extends BaseJob[SplitPartitions.Partition] {
var trackRunFeature: TrackRun = _

override def getParts(pieces: Int): util.Collection[SplitPartitions.Partition] = {
var keyspaceTable = propertyHelper.getString(KnownProperties.TARGET_KEYSPACE_TABLE)
var keyspaceTable = Option(propertyHelper.getString(KnownProperties.TARGET_KEYSPACE_TABLE))
.getOrElse(Option(propertyHelper.getString(KnownProperties.ORIGIN_KEYSPACE_TABLE))

val keyspaceTableValue: String = keyspaceTable.getOrElse {
throw new RuntimeException("Both " + KnownProperties.TARGET_KEYSPACE_TABLE + " and "
+ KnownProperties.ORIGIN_KEYSPACE_TABLE + " properties are missing.")
}

if (trackRun) {
trackRunFeature = targetConnection.withSessionDo(targetSession => new TrackRun(targetSession, keyspaceTable))
trackRunFeature = targetConnection.withSessionDo(targetSession => new TrackRun(targetSession, keyspaceTableValue))
}

if (prevRunId != 0) {
Expand Down

0 comments on commit b2e4768

Please sign in to comment.