You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/08/10 02:19:28 UTC

[GitHub] [hudi] alexeykudinkin opened a new pull request, #6351: [HUDI-4584] Cleaning up Spark utilities

alexeykudinkin opened a new pull request, #6351:
URL: https://github.com/apache/hudi/pull/6351

   ### Change Logs
   
   Cleaning up Spark utilities, removing duplication (this is a preparatory change for the one stacked on top).
   
   ### Impact
   
   None
   
   ### Contributor's checklist
   
   - [ ] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [ ] Change Logs and Impact were stated clearly
   - [ ] Adequate tests were added if applicable
   - [ ] CI passed
   


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] hudi-bot commented on pull request #6351: [HUDI-4584] Cleaning up Spark utilities

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6351:
URL: https://github.com/apache/hudi/pull/6351#issuecomment-1210103090

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "0e0bec34aafc344bf3b449172c848c9f3bcea372",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10714",
       "triggerID" : "0e0bec34aafc344bf3b449172c848c9f3bcea372",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 0e0bec34aafc344bf3b449172c848c9f3bcea372 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10714) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] hudi-bot commented on pull request #6351: [HUDI-4584] Cleaning up Spark utilities

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6351:
URL: https://github.com/apache/hudi/pull/6351#issuecomment-1210100518

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "0e0bec34aafc344bf3b449172c848c9f3bcea372",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "0e0bec34aafc344bf3b449172c848c9f3bcea372",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 0e0bec34aafc344bf3b449172c848c9f3bcea372 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] yihua merged pull request #6351: [HUDI-4584] Cleaning up Spark utilities

Posted by GitBox <gi...@apache.org>.
yihua merged PR #6351:
URL: https://github.com/apache/hudi/pull/6351


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] yihua commented on a diff in pull request #6351: [HUDI-4584] Cleaning up Spark utilities

Posted by GitBox <gi...@apache.org>.
yihua commented on code in PR #6351:
URL: https://github.com/apache/hudi/pull/6351#discussion_r952228957


##########
hudi-client/hudi-spark-client/src/main/scala/org/apache/hudi/util/SparkKeyGenUtils.scala:
##########
@@ -0,0 +1,60 @@
+/*
+ * 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.util
+
+import org.apache.hudi.common.config.TypedProperties
+import org.apache.hudi.keygen.constant.KeyGeneratorOptions
+import org.apache.hudi.keygen.{BaseKeyGenerator, CustomAvroKeyGenerator, CustomKeyGenerator, KeyGenerator}
+import org.apache.hudi.keygen.factory.HoodieSparkKeyGeneratorFactory
+
+import java.util.Properties
+import scala.collection.JavaConverters._
+
+object SparkKeyGenUtils {
+
+  /**
+   * @param properties config properties
+   * @return partition columns
+   */
+  def getPartitionColumns(properties: Properties): String = {
+    val props = new TypedProperties(properties)
+    val keyGenerator = HoodieSparkKeyGeneratorFactory.createKeyGenerator(props)
+    getPartitionColumns(keyGenerator, props)
+  }
+
+  /**
+   * @param keyGen key generator
+   * @return partition columns
+   */
+  def getPartitionColumns(keyGen: KeyGenerator, typedProperties: TypedProperties): String = {

Review Comment:
   Looks like there is no change to these util methods except for moving them to different Util classes.



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] hudi-bot commented on pull request #6351: [HUDI-4584] Cleaning up Spark utilities

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #6351:
URL: https://github.com/apache/hudi/pull/6351#issuecomment-1210176497

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "0e0bec34aafc344bf3b449172c848c9f3bcea372",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10714",
       "triggerID" : "0e0bec34aafc344bf3b449172c848c9f3bcea372",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 0e0bec34aafc344bf3b449172c848c9f3bcea372 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10714) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org