xuefuz commented on a change in pull request #10381: [FLINK-14513][hive] Implement listPartitionsByFilter to HiveCatalog URL: https://github.com/apache/flink/pull/10381#discussion_r355161669
########## File path: flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/util/HiveTableUtil.java ########## @@ -175,4 +186,93 @@ public static boolean requireRelyConstraint(byte trait) { return (trait & HIVE_CONSTRAINT_RELY) != 0; } + /** + * Generates a filter string for partition columns from the given filter expressions. + * + * @param numNonPartCol The number of non-partition columns -- used to shift field reference index + * @param partColNames The names of all partition columns + * @param expressions The filter expressions in CNF form + * @return an Optional filter string equivalent to the expressions, which is empty if the expressions can't be handled + */ + public static Optional<String> makePartitionFilter(int numNonPartCol, List<String> partColNames, List<Expression> expressions) { Review comment: Nit: what about rename numNonPartCol to partColOffset? ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services