JingsongLi commented on a change in pull request #9864: [FLINK-14254][table] Introduce FileSystemOutputFormat for batch URL: https://github.com/apache/flink/pull/9864#discussion_r341930365
########## File path: flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/filesystem/PartitionComputer.java ########## @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.table.filesystem; + +import org.apache.flink.annotation.Internal; + +import java.io.Serializable; + +/** + * Compute partition path from record and project non-partition columns for output writer. + * + * <p>See {@link RowPartitionComputer}. + * + * @param <T> The type of the consumed records. + */ +@Internal +public interface PartitionComputer<T> extends Serializable { + + /** + * Compute partition path from record. + * + * @param in input record. + * @return partition path. + */ + String computePartition(T in) throws Exception; Review comment: Yes, we could, my little concern is that the interfaces are too more... Actually it is not so complex. `PartitionComputer` for Row or BaseRow, they both are simple. We can rely on util in implementations. With multi interface, that will limit the arguments of implementation. For `LinkedHashMap`, maybe with BaseRow, we can have a higher performance implementation which not rely on `LinkedHashMap` and JAVA Strings. But here, I agree with you to separate it. ---------------------------------------------------------------- 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: [email protected] With regards, Apache Git Services
