swuferhong commented on code in PR #20596:
URL: https://github.com/apache/flink/pull/20596#discussion_r950049079
##########
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/connectors/hive/HiveTableSource.java:
##########
@@ -252,48 +250,41 @@ public void applyPartitions(List<Map<String, String>>
remainingPartitions) {
}
@Override
- public List<String> applyDynamicFiltering(List<String>
candidateFilterFields) {
- if (catalogTable.getPartitionKeys() != null
- && catalogTable.getPartitionKeys().size() != 0) {
- checkArgument(
- !candidateFilterFields.isEmpty(),
- "At least one field should be provided for dynamic
filtering");
-
- // only accept partition fields of supported types to do dynamic
partition pruning
- List<String> dynamicFilterPartitionKeys = new ArrayList<>();
- for (String field : candidateFilterFields) {
- if (catalogTable.getPartitionKeys().contains(field)
- &&
HiveSourceDynamicFileEnumerator.SUPPORTED_TYPES.contains(
- catalogTable
- .getSchema()
- .getFieldDataType(field)
- .map(DataType::getLogicalType)
- .map(LogicalType::getTypeRoot)
- .orElse(null))) {
- dynamicFilterPartitionKeys.add(field);
- }
- }
- if (dynamicFilterPartitionKeys.isEmpty()) {
- LOG.warn(
- "No dynamic filter field is accepted,"
- + " only partition fields can use for dynamic
filtering.");
- }
+ public List<String> listAcceptedFilterFields() {
+ return catalogTable.getPartitionKeys();
Review Comment:
> only return the partition keys with the supported types
Done!
--
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]