Skip to content

Commit 1c4099d

Browse files
committed
additional if check
1 parent d806bf0 commit 1c4099d

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

xtable-service/src/main/java/org/apache/xtable/service/ConversionService.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,14 @@ public ConversionService(
190190
public ConvertTableResponse convertTable(ConvertTableRequest convertTableRequest) {
191191

192192
Properties sourceProperties = new Properties();
193-
String partitionSpec =
194-
convertTableRequest.getConfigurations().getOrDefault("partition-spec", null);
195-
if (partitionSpec != null) {
196-
sourceProperties.put(PARTITION_FIELD_SPEC_CONFIG, partitionSpec);
193+
if (convertTableRequest.getConfigurations() != null) {
194+
String partitionSpec =
195+
convertTableRequest.getConfigurations().getOrDefault("partition-spec", null);
196+
if (partitionSpec != null
197+
&& (HUDI.equals(convertTableRequest.getSourceFormat())
198+
|| convertTableRequest.getTargetFormats().contains(HUDI))) {
199+
sourceProperties.put(PARTITION_FIELD_SPEC_CONFIG, partitionSpec);
200+
}
197201
}
198202

199203
SourceTable sourceTable =

0 commit comments

Comments
 (0)