Skip to content

Commit e9f7bbc

Browse files
committed
Fail on list partitions with no filter/pagination for tables listed in a fast property 'metacat.service.tables.error.list.partitions.no.filter' as a comma delimited string.
1 parent 12ec1e9 commit e9f7bbc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

metacat-main/src/main/java/com/netflix/metacat/main/services/impl/PartitionServiceImpl.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ private ConnectorPartitionResult getPartitionResult(QualifiedName name, String f
9191
@Override
9292
public List<PartitionDto> list(QualifiedName name, String filter, List<String> partitionNames, Sort sort
9393
, Pageable pageable, boolean includeUserDefinitionMetadata, boolean includeUserDataMetadata, boolean includePartitionDetails) {
94-
if(Strings.isNullOrEmpty(filter) && pageable != null && !pageable.isPageable()
94+
if(Strings.isNullOrEmpty(filter)
95+
&& (pageable == null || !pageable.isPageable())
96+
&& (partitionNames == null || partitionNames.isEmpty())
9597
&& config.getQualifiedNamesToThrowErrorWhenNoFilterOnListPartitions().contains(name)){
9698
throw new IllegalArgumentException(String.format("No filter or limit specified for table %s", name));
9799
}

0 commit comments

Comments
 (0)