gong commented on code in PR #6165:
URL: https://github.com/apache/inlong/pull/6165#discussion_r996451447
##########
inlong-sort/sort-connectors/kafka/src/main/java/org/apache/inlong/sort/kafka/table/KafkaDynamicTableFactory.java:
##########
@@ -206,6 +216,18 @@ private static void validateSinkPartitioner(ReadableConfig
tableOptions) {
throw new ValidationException(
"Currently 'round-robin' partitioner only
works "
+ "when option 'key.fields' is not
specified.");
+ } else if
((SINK_PARTITIONER_VALUE_RAW_HASH.equals(partitioner)
+ ||
"org.apache.inlong.sort.kafka.partitioner.RawDataHashPartitioner".equals(partitioner))
+ &&
(!"raw".equals(tableOptions.getOptional(FORMAT).orElse(null))
+ ||
!tableOptions.getOptional(SINK_MULTIPLE_FORMAT).isPresent()
+ ||
!tableOptions.getOptional(SINK_MULTIPLE_PARTITION_PATTERN).isPresent()
+ ||
tableOptions.getOptional(SINK_MULTIPLE_FORMAT).get().isEmpty()
+ ||
tableOptions.getOptional(SINK_MULTIPLE_PARTITION_PATTERN).get().isEmpty())) {
+ throw new ValidationException(
+ "Currently 'raw-hash' partitioner only works "
+ + "when option 'format' is 'raw' and
option 'sink.multiple.format' "
+ + "and
'sink.multiple.partition-pattern' is specified.");
Review Comment:
>
@yunqingmoswu Use boolean variables to store results of complicated
statements temporarily will increase the code’s readability.[refer
to](https://alibaba.github.io/Alibaba-Java-Coding-Guidelines/) 4th item of Flow
Control Statements.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]