XComp commented on code in PR #24390: URL: https://github.com/apache/flink/pull/24390#discussion_r1512374782
########## flink-connectors/flink-connector-files/src/main/java/org/apache/flink/connector/file/table/utils/PathUtils.java: ########## @@ -0,0 +1,51 @@ +/* + * 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.connector.file.table.utils; + +import org.apache.flink.core.fs.FileSystem; +import org.apache.flink.core.fs.Path; +import org.apache.flink.util.Preconditions; + +import java.io.IOException; +import java.util.UUID; + +/** Path utils for file system. */ +public class PathUtils { + + public static Path getStagingPath(Path path) { Review Comment: 1. Generate duplicate code for temporary file creation in `FileSystemOutputFormat` and `HiveTableSink`. (similar to the base code version of this PR) which should be ok because it's not really complex code that we're dealing with, here. 2. Move the folder generation into a dedicated method that needs to be annotated as `@Public` to honor the ArchUnit tests. That would be a viable solution if we think that the temporary folder is in some means relevant to the user (e.g. is the naming scheme for the staging directory relevant so that it should be not changed between releases?). In that case, we should, indeed, annotate it as `@Public`. To me, it sounds like the staging directory generation is an internal matter. How important is it that the naming scheme is matched between the `FileSystemTableSink` and the `HiveTableSink`? I would lean towards making the temp file generation internal functionality that is independent between `FileSystemTableSink` and `HiveTableSink` (option 1). But I'm not familiar with this code to judge here. -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org