Skip to content

Commit 5a34363

Browse files
authored
Use origin ks/tbl when target properties is not specified (#286)
* issue 284 - Use origin ks/tbl when target property is missing * Ignore empty values
1 parent 500cacd commit 5a34363

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ abstract class BasePartitionJob extends BaseJob[SplitPartitions.Partition] {
2525

2626
override def getParts(pieces: Int): util.Collection[SplitPartitions.Partition] = {
2727
var keyspaceTable: Option[String] = Option(propertyHelper.getString(KnownProperties.TARGET_KEYSPACE_TABLE))
28+
.filter(_.nonEmpty)
2829
.orElse(Option(propertyHelper.getString(KnownProperties.ORIGIN_KEYSPACE_TABLE)))
2930

30-
val keyspaceTableValue: String = keyspaceTable.getOrElse {
31+
var keyspaceTableValue: String = keyspaceTable.getOrElse {
3132
throw new RuntimeException("Both " + KnownProperties.TARGET_KEYSPACE_TABLE + " and "
3233
+ KnownProperties.ORIGIN_KEYSPACE_TABLE + " properties are missing.")
3334
}

0 commit comments

Comments
 (0)