alexeykudinkin commented on code in PR #6680: URL: https://github.com/apache/hudi/pull/6680#discussion_r1022045154
########## hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/UTF8StringPartitionPathFormatter.java: ########## @@ -0,0 +1,80 @@ +/* + * 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.hudi.keygen; + +import org.apache.hudi.common.util.PartitionPathEncodeUtils; +import org.apache.spark.unsafe.types.UTF8String; + +import java.util.function.Supplier; + +import static org.apache.hudi.keygen.BuiltinKeyGenerator.toUTF8String; Review Comment: Alright, i recollected now: - PartitionPathFormatter is actually not completely decoupled from KG: partition-paths formatting make sense and only occurs w/in the scope of key-generation (record-key, partition-path). Outside of it there's no use-case for it. In other words, we're not planning to use it completely detached from the KG. - What you're saying makes total sense nonetheless, but then i weighed in whether it's worth to add a new Utility class for this 1 method and ultimately decided that it's not. - `SparkKeyGenUtils` has actually a slightly different scope -- it hosts utils to work w/ KGs rather than internal helpers for KGs Let me know if you feel strongly about it, i can extract to a separate utility class. -- 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]
