Code review comment: rename `partitionFieldType` to `partitionFieldTypes` ?  change the type definition to `LogicalType[]`? since `prunePartitions` method use `Array[LogicalType]` as argument type.

Code before review:
public void onMatch(RelOptRuleCall call) {
Filter filter = call.rel(0);
LogicalTableScan scan = call.rel(1);
Context context = call.getPlanner().getContext().unwrap(FlinkContext.class);
TableSourceTable tableSourceTable = scan.getTable().unwrap(TableSourceTable.class);
DynamicTableSource dynamicTableSource = tableSourceTable.tableSource();
RelDataType inputFieldType = filter.getInput().getRowType();
List<String> inputFieldName = inputFieldType.getFieldNames();
List<String> partitionedFieldNames = tableSourceTable.catalogTable().getPartitionKeys();
RelBuilder relBuilder = call.builder();
RexBuilder rexBuilder = relBuilder.getRexBuilder();
Tuple2<Seq<RexNode>, Seq<RexNode>> predicate = RexNodeExtractor.extractPartitionPredicateList(
filter.getCondition(),
FlinkRelOptUtil.getMaxCnfNodeCount(scan),
inputFieldName.toArray(new String[inputFieldName.size()]),
rexBuilder,
partitionedFieldNames.toArray(new String[partitionedFieldNames.size()])
);
RexNode partitionPredicate = RexUtil.composeConjunction(rexBuilder, JavaConversions.seqAsJavaList(predicate._1));
if (partitionPredicate.isAlwaysTrue()){
return;
}
List<LogicalType> partitionFieldType = partitionedFieldNames.stream().map(name -> {
int index = inputFieldName.indexOf(name);
if (index < 0) {
throw new RuntimeException(String.format("Partitioned key '%s' isn't found in input columns. " +
"Validator should have checked that.", name));
}
return inputFieldType.getFieldList().get(index).getType(); })
.map(FlinkTypeFactory::toLogicalType).collect(Collectors.toList());
List<Map<String, String>> allPartitions = ((SupportsPartitionPushDown) dynamicTableSource).listPartitions().get();
RexNode finalPartitionPredicate = adjustPartitionPredicate(inputFieldName, partitionedFieldNames, partitionPredicate);
List<Map<String, String>> remainingPartitions = PartitionPruner.prunePartitions(
((FlinkContext) context).getTableConfig(),
partitionedFieldNames.toArray(new String[partitionedFieldNames.size()]),
partitionFieldType.toArray(new LogicalType[partitionFieldType.size()]),
allPartitions,
finalPartitionPredicate
);
((SupportsPartitionPushDown) dynamicTableSource).applyPartitions(remainingPartitions);
FlinkStatistic statistic = tableSourceTable.getStatistic();
String extraDigest = "source: [partitions=" +
String.join(", ", ((SupportsPartitionPushDown) dynamicTableSource).listPartitions()
.get()
.stream()
.map(partition -> partition.toString())
.collect(Collectors.toList())
.toArray(new String[1])) +
"]";
TableSourceTable newTableSourceTable = tableSourceTable.copy(dynamicTableSource, statistic, new String[]{extraDigest});
LogicalTableScan newScan = new LogicalTableScan(
scan.getCluster(), scan.getTraitSet(), scan.getHints(), newTableSourceTable);
RexNode nonPartitionPredicate = RexUtil.composeConjunction(rexBuilder, JavaConversions.seqAsJavaList(predicate._2()));
if (nonPartitionPredicate.isAlwaysTrue()) {
call.transformTo(newScan);
} else {
call.transformTo(filter.copy(filter.getTraitSet(), newScan, nonPartitionPredicate));
}
}

Line under review: List<LogicalType> partitionFieldType = partitionedFieldNames.stream().map(name -> {

Code after addressing the review:
public void onMatch(RelOptRuleCall call) {
Filter filter = call.rel(0);
LogicalTableScan scan = call.rel(1);
TableSourceTable tableSourceTable = scan.getTable().unwrap(TableSourceTable.class);
RelDataType inputFieldTypes = filter.getInput().getRowType();
List<String> inputFieldNames = inputFieldTypes.getFieldNames();
List<String> partitionFieldNames = tableSourceTable.catalogTable().getPartitionKeys();
RelBuilder relBuilder = call.builder();
RexBuilder rexBuilder = relBuilder.getRexBuilder();
Tuple2<Seq<RexNode>, Seq<RexNode>> allPredicates = RexNodeExtractor.extractPartitionPredicateList(
filter.getCondition(),
FlinkRelOptUtil.getMaxCnfNodeCount(scan),
inputFieldNames.toArray(new String[0]),
rexBuilder,
partitionFieldNames.toArray(new String[0]));
RexNode partitionPredicate = RexUtil.composeConjunction(rexBuilder, JavaConversions.seqAsJavaList(allPredicates._1));
if (partitionPredicate.isAlwaysTrue()) {
return;
}
LogicalType[] partitionFieldTypes = partitionFieldNames.stream()
.map(name -> {
int index  = inputFieldNames.indexOf(name);
if (index < 0) {
throw new TableException(String.format("Partitioned key '%s' isn't found in input columns. " +
"Validator should have checked that.", name));
}
return inputFieldTypes.getFieldList().get(index).getType(); })
.map(FlinkTypeFactory::toLogicalType)
.toArray(LogicalType[]::new);
RexNode finalPartitionPredicate = adjustPartitionPredicate(inputFieldNames, partitionFieldNames, partitionPredicate);
FlinkContext context = call.getPlanner().getContext().unwrap(FlinkContext.class);
Function<List<Map<String, String>>, List<Map<String, String>>> defaultPruner = partitions -> PartitionPruner.prunePartitions(
context.getTableConfig(),
partitionFieldNames.toArray(new String[0]),
partitionFieldTypes,
partitions,
finalPartitionPredicate);
Optional<List<Map<String, String>>> remainingPartitions =
readPartitionsAndPrune(context, tableSourceTable, defaultPruner, allPredicates._1(), inputFieldNames);
DynamicTableSource dynamicTableSource = tableSourceTable.tableSource().copy();
remainingPartitions.ifPresent(((SupportsPartitionPushDown) dynamicTableSource)::applyPartitions);
TableStats newTableStat = null;
ObjectIdentifier identifier = tableSourceTable.tableIdentifier();
ObjectPath tablePath = identifier.toObjectPath();
Optional<Catalog> catalogOptional = context.getCatalogManager().getCatalog(identifier.getCatalogName());
Optional<TableStats> partitionStats;
if (remainingPartitions.isPresent() && catalogOptional.isPresent()) {
for (Map<String, String> partition: remainingPartitions.get()) {
partitionStats = getPartitionStats(catalogOptional.get(), tablePath, partition);
if (!partitionStats.isPresent()) {
newTableStat = null;
break;
} else {
newTableStat = newTableStat == null ? partitionStats.get() : newTableStat.merge(partitionStats.get());
}
}
}
FlinkStatistic newStatistic = FlinkStatistic.builder()
.statistic(tableSourceTable.getStatistic())
.tableStats(newTableStat)
.build();
String extraDigest = remainingPartitions.map(partition -> ("partitions=[" +
String.join(", ", partition
.stream()
.map(Object::toString)
.toArray(String[]::new)) +
"]")).orElse("partitions=[]");
TableSourceTable newTableSourceTable = tableSourceTable.copy(dynamicTableSource, newStatistic, new String[]{extraDigest});
LogicalTableScan newScan = LogicalTableScan.create(scan.getCluster(), newTableSourceTable, scan.getHints());
RexNode nonPartitionPredicate = RexUtil.composeConjunction(rexBuilder, JavaConversions.seqAsJavaList(allPredicates._2()));
if (nonPartitionPredicate.isAlwaysTrue()) {
call.transformTo(newScan);
} else {
Filter newFilter = filter.copy(filter.getTraitSet(), newScan, nonPartitionPredicate);
call.transformTo(newFilter);
}
}