Skip to content

Commit 0f65b92

Browse files
authored
Merge pull request #6 from agentzh2m/fix/partition-field-format-path-config
fix how to parse config
2 parents 9b404e5 + 25bf3d6 commit 0f65b92

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/com/canelmas/kafka/connect/FieldAndTimeBasedPartitioner.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ protected void init(long partitionDurationMs, String pathFormat, Locale locale,
4646
super.init(partitionDurationMs, pathFormat, locale, timeZone, config);
4747

4848
final List<String> fieldNames = (List<String>) config.get(PartitionerConfig.PARTITION_FIELD_NAME_CONFIG);
49-
final boolean formatPath = (Boolean) config.getOrDefault(PARTITION_FIELD_FORMAT_PATH_CONFIG, PARTITION_FIELD_FORMAT_PATH_DEFAULT);
49+
// option value is parse as string all other type is cast as string by kafka connect need to parse by ourselves
50+
final boolean formatPath = Boolean.parseBoolean((String) config.getOrDefault(PARTITION_FIELD_FORMAT_PATH_CONFIG, PARTITION_FIELD_FORMAT_PATH_DEFAULT));
5051

5152
this.partitionFieldExtractor = new PartitionFieldExtractor(fieldNames, formatPath);
5253
}

0 commit comments

Comments
 (0)