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/05/07 02:28:58 UTC

[GitHub] [hudi] alexeykudinkin opened a new pull request, #5523: [WIP][HUDI-4039] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   ## *Tips*
   - *Thank you very much for contributing to Apache Hudi.*
   - *Please review https://hudi.apache.org/contribute/how-to-contribute before opening a pull request.*
   
   ## What is the purpose of the pull request
   
   This PR makes sure that all builtin `KeyGenerator`s properly implement Spark specific APIs in a performant way (minimizing key-generators overhead) 
   
   ## Brief change log
   
    - Cleaned up SparkKeyGeneratorInterface: moved in API defs from `BuiltinKeyGenerator`, added java-docs;
    - Rebased BuiltinKeyGenerator to return UTF8String for API ingesting `InternalRow`
    - Abstracted away nested-field path access, and Spark's Row conversion w/in corresponding `SparkRowAccessor`, `SparkRowConverter` w/in `BuiltinKeyGenerator`
    - Rebased all builtin KGs onto new framework
    - Cleaned up
   
   ## Verify this pull request
   
   This pull request is already covered by existing tests, such as *(please describe tests)*.
   
   ## Committer checklist
   
    - [ ] Has a corresponding JIRA in PR title & commit
    
    - [ ] Commit message is descriptive of the change
    
    - [ ] CI is green
   
    - [ ] Necessary doc changes done or have another open PR
          
    - [ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.
   


-- 
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 #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4b608b4a1cb022986e282c404554dd6272588606",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979",
       "triggerID" : "4b608b4a1cb022986e282c404554dd6272588606",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 80e0b11c890cbb1f6bec082ed04e428772f69694 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969) 
   * 4b608b4a1cb022986e282c404554dd6272588606 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979) 
   
   <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] nsivabalan commented on pull request #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   A good refactoring patch @alexeykudinkin . thanks for taking it up. w/o unncessary row <> internal conversion, there could even be some perf improvement. 
   


-- 
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] alexeykudinkin commented on a diff in pull request #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/io/storage/row/HoodieRowCreateHandle.java:
##########
@@ -39,49 +39,74 @@
 import org.apache.log4j.Logger;
 import org.apache.spark.sql.catalyst.InternalRow;
 import org.apache.spark.sql.types.StructType;
+import org.apache.spark.unsafe.types.UTF8String;
 
 import java.io.IOException;
 import java.io.Serializable;
 import java.util.concurrent.atomic.AtomicLong;
+import java.util.function.Function;
 
 /**
  * Create handle with InternalRow for datasource implementation of bulk insert.
  */
 public class HoodieRowCreateHandle implements Serializable {
 
   private static final long serialVersionUID = 1L;
+
   private static final Logger LOG = LogManager.getLogger(HoodieRowCreateHandle.class);
-  private static final AtomicLong SEQGEN = new AtomicLong(1);
+  private static final AtomicLong GLOBAL_SEQ_NO = new AtomicLong(1);
+
+  private static final Integer RECORD_KEY_META_FIELD_ORD =
+      HoodieRecord.HOODIE_META_COLUMNS_NAME_TO_POS.get(HoodieRecord.RECORD_KEY_METADATA_FIELD);

Review Comment:
   Good call!



-- 
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 #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4b608b4a1cb022986e282c404554dd6272588606",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979",
       "triggerID" : "4b608b4a1cb022986e282c404554dd6272588606",
       "triggerType" : "PUSH"
     }, {
       "hash" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10052",
       "triggerID" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10067",
       "triggerID" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10073",
       "triggerID" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10080",
       "triggerID" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a749f666b8b5ee409cef0342532d6c90a6b71a2a",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10085",
       "triggerID" : "a749f666b8b5ee409cef0342532d6c90a6b71a2a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1814b10b6bf6e3bc0fe1c483442b8637f929b2b0",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "1814b10b6bf6e3bc0fe1c483442b8637f929b2b0",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a749f666b8b5ee409cef0342532d6c90a6b71a2a Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10085) 
   * 1814b10b6bf6e3bc0fe1c483442b8637f929b2b0 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] hudi-bot commented on pull request #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4b608b4a1cb022986e282c404554dd6272588606",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979",
       "triggerID" : "4b608b4a1cb022986e282c404554dd6272588606",
       "triggerType" : "PUSH"
     }, {
       "hash" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10052",
       "triggerID" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10067",
       "triggerID" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10073",
       "triggerID" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10080",
       "triggerID" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a749f666b8b5ee409cef0342532d6c90a6b71a2a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10085",
       "triggerID" : "a749f666b8b5ee409cef0342532d6c90a6b71a2a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1814b10b6bf6e3bc0fe1c483442b8637f929b2b0",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10106",
       "triggerID" : "1814b10b6bf6e3bc0fe1c483442b8637f929b2b0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bd922449d1756895a5e1cd8c3c85e33fcc3dd809",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10150",
       "triggerID" : "bd922449d1756895a5e1cd8c3c85e33fcc3dd809",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * bd922449d1756895a5e1cd8c3c85e33fcc3dd809 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10150) 
   
   <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 #5523: [WIP][HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 5a8425e8613610f85af091a9dbc8037c74b7f858 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482) 
   
   <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 #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4b608b4a1cb022986e282c404554dd6272588606",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979",
       "triggerID" : "4b608b4a1cb022986e282c404554dd6272588606",
       "triggerType" : "PUSH"
     }, {
       "hash" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10052",
       "triggerID" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10067",
       "triggerID" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10073",
       "triggerID" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10080",
       "triggerID" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a749f666b8b5ee409cef0342532d6c90a6b71a2a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10085",
       "triggerID" : "a749f666b8b5ee409cef0342532d6c90a6b71a2a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1814b10b6bf6e3bc0fe1c483442b8637f929b2b0",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10106",
       "triggerID" : "1814b10b6bf6e3bc0fe1c483442b8637f929b2b0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bd922449d1756895a5e1cd8c3c85e33fcc3dd809",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10150",
       "triggerID" : "bd922449d1756895a5e1cd8c3c85e33fcc3dd809",
       "triggerType" : "PUSH"
     }, {
       "hash" : "24da4bb8af969e5c0706c91eb4ae5e64ecb5d1dc",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "24da4bb8af969e5c0706c91eb4ae5e64ecb5d1dc",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * bd922449d1756895a5e1cd8c3c85e33fcc3dd809 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10150) 
   * 24da4bb8af969e5c0706c91eb4ae5e64ecb5d1dc 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] hudi-bot commented on pull request #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966) 
   * 80e0b11c890cbb1f6bec082ed04e428772f69694 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] nsivabalan commented on a diff in pull request #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/client/model/HoodieInternalRow.java:
##########
@@ -57,187 +92,153 @@ public int numFields() {
   }
 
   @Override
-  public void setNullAt(int i) {
-    if (i < HoodieRecord.HOODIE_META_COLUMNS.size()) {
-      switch (i) {
-        case 0: {
-          this.commitTime = null;
-          break;
-        }
-        case 1: {
-          this.commitSeqNumber = null;
-          break;
-        }
-        case 2: {
-          this.recordKey = null;
-          break;
-        }
-        case 3: {
-          this.partitionPath = null;
-          break;
-        }
-        case 4: {
-          this.fileName = null;
-          break;
-        }
-        default: throw new IllegalArgumentException("Not expected");
-      }
+  public void setNullAt(int ordinal) {
+    if (ordinal < metaFields.length) {
+      metaFields[ordinal] = null;
     } else {
-      row.setNullAt(i);
+      row.setNullAt(rebaseOrdinal(ordinal));
     }
   }
 
   @Override
-  public void update(int i, Object value) {
-    if (i < HoodieRecord.HOODIE_META_COLUMNS.size()) {
-      switch (i) {
-        case 0: {
-          this.commitTime = value.toString();
-          break;
-        }
-        case 1: {
-          this.commitSeqNumber = value.toString();
-          break;
-        }
-        case 2: {
-          this.recordKey = value.toString();
-          break;
-        }
-        case 3: {
-          this.partitionPath = value.toString();
-          break;
-        }
-        case 4: {
-          this.fileName = value.toString();
-          break;
-        }
-        default: throw new IllegalArgumentException("Not expected");
+  public void update(int ordinal, Object value) {
+    if (ordinal < metaFields.length) {
+      if (value instanceof UTF8String) {
+        metaFields[ordinal] = (UTF8String) value;
+      } else if (value instanceof String) {
+        metaFields[ordinal] = UTF8String.fromString((String) value);
+      } else {
+        throw new IllegalArgumentException(
+            String.format("Could not update the row at (%d) with value of type (%s), either UTF8String or String are expected", ordinal, value.getClass().getSimpleName()));
       }
     } else {
-      row.update(i, value);
+      row.update(rebaseOrdinal(ordinal), value);
     }
   }
 
-  private String getMetaColumnVal(int ordinal) {
-    switch (ordinal) {
-      case 0: {
-        return commitTime;
-      }
-      case 1: {
-        return commitSeqNumber;
-      }
-      case 2: {
-        return recordKey;
-      }
-      case 3: {
-        return partitionPath;
-      }
-      case 4: {
-        return fileName;
-      }
-      default: throw new IllegalArgumentException("Not expected");
+  @Override
+  public boolean isNullAt(int ordinal) {
+    if (ordinal < metaFields.length) {
+      return metaFields[ordinal] == null;
     }
+    return row.isNullAt(rebaseOrdinal(ordinal));
   }
 
   @Override
-  public boolean isNullAt(int ordinal) {
+  public UTF8String getUTF8String(int ordinal) {
+    if (ordinal < HoodieRecord.HOODIE_META_COLUMNS.size()) {
+      return metaFields[ordinal];
+    }
+    return row.getUTF8String(rebaseOrdinal(ordinal));
+  }
+
+  @Override
+  public Object get(int ordinal, DataType dataType) {
     if (ordinal < HoodieRecord.HOODIE_META_COLUMNS.size()) {
-      return null == getMetaColumnVal(ordinal);
+      validateMetaFieldDataType(dataType);
+      return metaFields[ordinal];
     }
-    return row.isNullAt(ordinal);
+    return row.get(rebaseOrdinal(ordinal), dataType);
   }
 
   @Override
   public boolean getBoolean(int ordinal) {
-    return row.getBoolean(ordinal);
+    ruleOutMetaFieldsAccess(ordinal, Boolean.class);
+    return row.getBoolean(rebaseOrdinal(ordinal));
   }
 
   @Override
   public byte getByte(int ordinal) {
-    return row.getByte(ordinal);
+    ruleOutMetaFieldsAccess(ordinal, Byte.class);
+    return row.getByte(rebaseOrdinal(ordinal));
   }
 
   @Override
   public short getShort(int ordinal) {
-    return row.getShort(ordinal);
+    ruleOutMetaFieldsAccess(ordinal, Short.class);
+    return row.getShort(rebaseOrdinal(ordinal));
   }
 
   @Override
   public int getInt(int ordinal) {
-    return row.getInt(ordinal);
+    ruleOutMetaFieldsAccess(ordinal, Integer.class);
+    return row.getInt(rebaseOrdinal(ordinal));
   }
 
   @Override
   public long getLong(int ordinal) {
-    return row.getLong(ordinal);
+    ruleOutMetaFieldsAccess(ordinal, Long.class);
+    return row.getLong(rebaseOrdinal(ordinal));
   }
 
   @Override
   public float getFloat(int ordinal) {
-    return row.getFloat(ordinal);
+    ruleOutMetaFieldsAccess(ordinal, Float.class);
+    return row.getFloat(rebaseOrdinal(ordinal));
   }
 
   @Override
   public double getDouble(int ordinal) {
-    return row.getDouble(ordinal);
+    ruleOutMetaFieldsAccess(ordinal, Double.class);
+    return row.getDouble(rebaseOrdinal(ordinal));
   }
 
   @Override
   public Decimal getDecimal(int ordinal, int precision, int scale) {
-    return row.getDecimal(ordinal, precision, scale);
-  }
-
-  @Override
-  public UTF8String getUTF8String(int ordinal) {
-    if (ordinal < HoodieRecord.HOODIE_META_COLUMNS.size()) {
-      return UTF8String.fromBytes(getMetaColumnVal(ordinal).getBytes());
-    }
-    return row.getUTF8String(ordinal);
-  }
-
-  @Override
-  public String getString(int ordinal) {
-    if (ordinal < HoodieRecord.HOODIE_META_COLUMNS.size()) {
-      return new String(getMetaColumnVal(ordinal).getBytes());
-    }
-    return row.getString(ordinal);
+    ruleOutMetaFieldsAccess(ordinal, Decimal.class);
+    return row.getDecimal(rebaseOrdinal(ordinal), precision, scale);
   }
 
   @Override
   public byte[] getBinary(int ordinal) {
-    return row.getBinary(ordinal);
+    ruleOutMetaFieldsAccess(ordinal, Byte[].class);
+    return row.getBinary(rebaseOrdinal(ordinal));
   }
 
   @Override
   public CalendarInterval getInterval(int ordinal) {
-    return row.getInterval(ordinal);
+    ruleOutMetaFieldsAccess(ordinal, CalendarInterval.class);
+    return row.getInterval(rebaseOrdinal(ordinal));
   }
 
   @Override
   public InternalRow getStruct(int ordinal, int numFields) {
-    return row.getStruct(ordinal, numFields);
+    ruleOutMetaFieldsAccess(ordinal, InternalRow.class);
+    return row.getStruct(rebaseOrdinal(ordinal), numFields);
   }
 
   @Override
   public ArrayData getArray(int ordinal) {
-    return row.getArray(ordinal);
+    ruleOutMetaFieldsAccess(ordinal, ArrayData.class);
+    return row.getArray(rebaseOrdinal(ordinal));
   }
 
   @Override
   public MapData getMap(int ordinal) {
-    return row.getMap(ordinal);
+    ruleOutMetaFieldsAccess(ordinal, MapData.class);
+    return row.getMap(rebaseOrdinal(ordinal));
   }
 
   @Override
-  public Object get(int ordinal, DataType dataType) {
-    if (ordinal < HoodieRecord.HOODIE_META_COLUMNS.size()) {
-      return UTF8String.fromBytes(getMetaColumnVal(ordinal).getBytes());
+  public InternalRow copy() {
+    return new HoodieInternalRow(Arrays.copyOf(metaFields, metaFields.length), row.copy(), containsMetaFields);
+  }
+
+  private int rebaseOrdinal(int ordinal) {
+    // NOTE: In cases when source row does not contain meta fields, we will have to
+    //       rebase ordinal onto its indexes
+    return containsMetaFields ? ordinal : ordinal - metaFields.length;
+  }
+
+  private void validateMetaFieldDataType(DataType dataType) {
+    if (!dataType.sameType(StringType$.MODULE$)) {
+      throw new ClassCastException(String.format("Can not cast meta-field of type UTF8String to %s", dataType.simpleString()));
     }
-    return row.get(ordinal, dataType);
   }
 
-  @Override
-  public InternalRow copy() {
-    return new HoodieInternalRow(commitTime, commitSeqNumber, recordKey, partitionPath, fileName, row.copy());
+  private void ruleOutMetaFieldsAccess(int ordinal, Class<?> expectedDataType) {

Review Comment:
   do we need to have this validation in fast path? i..e for every column that is not meta field will be going through this for every record. Is there a way to optimize or reduce the frequency of validations. 



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/BuiltinKeyGenerator.java:
##########
@@ -18,121 +18,334 @@
 
 package org.apache.hudi.keygen;
 
-import org.apache.hudi.ApiMaturityLevel;
+import org.apache.avro.generic.GenericRecord;
 import org.apache.hudi.AvroConversionUtils;
-import org.apache.hudi.PublicAPIMethod;
+import org.apache.hudi.HoodieSparkUtils;
+import org.apache.hudi.client.utils.SparkRowSerDe;
 import org.apache.hudi.common.config.TypedProperties;
-import org.apache.hudi.common.util.collection.Pair;
-import org.apache.hudi.exception.HoodieIOException;
-
-import org.apache.avro.generic.GenericRecord;
+import org.apache.hudi.common.util.PartitionPathEncodeUtils;
+import org.apache.hudi.exception.HoodieKeyException;
+import org.apache.hudi.unsafe.UTF8StringBuilder;
+import org.apache.spark.sql.HoodieUnsafeRowUtils;
+import org.apache.spark.sql.HoodieUnsafeRowUtils$;
 import org.apache.spark.sql.Row;
 import org.apache.spark.sql.catalyst.InternalRow;
-import org.apache.spark.sql.types.DataType;
 import org.apache.spark.sql.types.StructType;
+import org.apache.spark.unsafe.types.UTF8String;
+import scala.Function1;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
+import javax.annotation.concurrent.ThreadSafe;
 
-import scala.Function1;
+import static org.apache.hudi.common.util.ValidationUtils.checkState;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_PARTITION_PATH_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_RECORD_KEY_PARTS_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.HUDI_DEFAULT_PARTITION_PATH;
 
 /**
- * Base class for the built-in key generators. Contains methods structured for
- * code reuse amongst them.
+ * Base class for all built-in key generators.
+ *
+ * NOTE: By default it implements all the methods of {@link SparkKeyGeneratorInterface}, which
+ *       by default however fallback to Avro implementation. For maximum performance (to avoid
+ *       conversion from Spark's internal data-types to Avro) you should override these methods
+ *       in your implementation.
+ *
+ * TODO rename to AvroFallbackBaseKeyGenerator
  */
+@ThreadSafe
 public abstract class BuiltinKeyGenerator extends BaseKeyGenerator implements SparkKeyGeneratorInterface {
 
-  private static final String STRUCT_NAME = "hoodieRowTopLevelField";
-  private static final String NAMESPACE = "hoodieRow";
-  private Function1<Row, GenericRecord> converterFn = null;
-  private final AtomicBoolean validatePartitionFields = new AtomicBoolean(false);
-  protected StructType structType;
+  protected static final UTF8String HUDI_DEFAULT_PARTITION_PATH_UTF8 = UTF8String.fromString(HUDI_DEFAULT_PARTITION_PATH);
 
-  protected Map<String, Pair<List<Integer>, DataType>> recordKeySchemaInfo = new HashMap<>();
-  protected Map<String, Pair<List<Integer>, DataType>> partitionPathSchemaInfo = new HashMap<>();
+  protected transient volatile SparkRowConverter rowConverter;
+  protected transient volatile SparkRowAccessor rowAccessor;
 
   protected BuiltinKeyGenerator(TypedProperties config) {
     super(config);
   }
 
-  /**
-   * Fetch record key from {@link Row}.
-   *
-   * @param row instance of {@link Row} from which record key is requested.
-   * @return the record key of interest from {@link Row}.
-   */
   @Override
-  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
   public String getRecordKey(Row row) {
-    if (null == converterFn) {
-      converterFn = AvroConversionUtils.createConverterToAvro(row.schema(), STRUCT_NAME, NAMESPACE);
+    tryInitRowConverter(row.schema());
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return getRecordKey(rowConverter.convertToAvro(row));
+  }
+
+  @Override
+  public UTF8String getRecordKey(InternalRow internalRow, StructType schema) {
+    tryInitRowConverter(schema);
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return UTF8String.fromString(getRecordKey(rowConverter.convertToAvro(internalRow)));
+  }
+
+  @Override
+  public String getPartitionPath(Row row) {
+    tryInitRowConverter(row.schema());
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return getPartitionPath(rowConverter.convertToAvro(row));
+  }
+
+  @Override
+  public UTF8String getPartitionPath(InternalRow internalRow, StructType schema) {
+    tryInitRowConverter(schema);
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    GenericRecord avroRecord = rowConverter.convertToAvro(internalRow);
+    return UTF8String.fromString(getPartitionPath(avroRecord));
+  }
+
+  protected void tryInitRowAccessor(StructType schema) {
+    if (this.rowAccessor == null) {
+      synchronized (this) {
+        if (this.rowAccessor == null) {
+          this.rowAccessor = new SparkRowAccessor(schema);
+        }
+      }
     }
-    return getKey(converterFn.apply(row)).getRecordKey();
   }
 
   /**
-   * Fetch partition path from {@link Row}.
-   *
-   * @param row instance of {@link Row} from which partition path is requested
-   * @return the partition path of interest from {@link Row}.
+   * NOTE: This method has to stay final (so that it's easier for JIT compiler to apply certain
+   *       optimizations, like inlining)
    */
-  @Override
-  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
-  public String getPartitionPath(Row row) {
-    if (null == converterFn) {
-      converterFn = AvroConversionUtils.createConverterToAvro(row.schema(), STRUCT_NAME, NAMESPACE);
+  protected final String combinePartitionPath(Object... partitionPathParts) {
+    checkState(partitionPathParts.length == recordKeyFields.size());
+    // Avoid creating [[StringBuilder]] in case there's just one partition-path part,
+    // and Hive-style of partitioning is not required
+    if (!hiveStylePartitioning && partitionPathParts.length == 1) {
+      return partitionPathParts[0] != null
+          ? partitionPathParts[0].toString()
+          : HUDI_DEFAULT_PARTITION_PATH;
     }
-    return getKey(converterFn.apply(row)).getPartitionPath();
+
+    StringBuilder sb = new StringBuilder();
+    for (int i = 0; i < partitionPathParts.length; ++i) {
+      String partitionPathPartStr = partitionPathParts[i] != null
+          ? partitionPathParts[i].toString()

Review Comment:
   may I know why encoding is honored in next method and not here? 



##########
hudi-client/hudi-spark-client/src/main/scala/org/apache/hudi/unsafe/UTF8StringBuilder.java:
##########
@@ -0,0 +1,100 @@
+/*
+ * 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.unsafe;
+
+import org.apache.spark.unsafe.Platform;
+import org.apache.spark.unsafe.array.ByteArrayMethods;
+import org.apache.spark.unsafe.types.UTF8String;
+
+/**
+ * A helper class to write {@link UTF8String}s to an internal buffer and build the concatenated
+ * {@link UTF8String} at the end.
+ */
+public class UTF8StringBuilder {
+
+  private static final int ARRAY_MAX = ByteArrayMethods.MAX_ROUNDED_ARRAY_LENGTH;
+
+  private byte[] buffer;
+  private int cursor = Platform.BYTE_ARRAY_OFFSET;
+
+  public UTF8StringBuilder() {

Review Comment:
   do we have tests for this? 



##########
hudi-common/src/main/java/org/apache/hudi/keygen/KeyGenerator.java:
##########
@@ -52,7 +52,7 @@ protected KeyGenerator(TypedProperties config) {
    * @return list of field names, when concatenated make up the record key.
    */
   @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
-  public List<String> getRecordKeyFieldNames() {

Review Comment:
   we should be careful in renaming public methods. can we retain the same name. 



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/BuiltinKeyGenerator.java:
##########
@@ -18,121 +18,334 @@
 
 package org.apache.hudi.keygen;
 
-import org.apache.hudi.ApiMaturityLevel;
+import org.apache.avro.generic.GenericRecord;
 import org.apache.hudi.AvroConversionUtils;
-import org.apache.hudi.PublicAPIMethod;
+import org.apache.hudi.HoodieSparkUtils;
+import org.apache.hudi.client.utils.SparkRowSerDe;
 import org.apache.hudi.common.config.TypedProperties;
-import org.apache.hudi.common.util.collection.Pair;
-import org.apache.hudi.exception.HoodieIOException;
-
-import org.apache.avro.generic.GenericRecord;
+import org.apache.hudi.common.util.PartitionPathEncodeUtils;
+import org.apache.hudi.exception.HoodieKeyException;
+import org.apache.hudi.unsafe.UTF8StringBuilder;
+import org.apache.spark.sql.HoodieUnsafeRowUtils;
+import org.apache.spark.sql.HoodieUnsafeRowUtils$;
 import org.apache.spark.sql.Row;
 import org.apache.spark.sql.catalyst.InternalRow;
-import org.apache.spark.sql.types.DataType;
 import org.apache.spark.sql.types.StructType;
+import org.apache.spark.unsafe.types.UTF8String;
+import scala.Function1;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
+import javax.annotation.concurrent.ThreadSafe;
 
-import scala.Function1;
+import static org.apache.hudi.common.util.ValidationUtils.checkState;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_PARTITION_PATH_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_RECORD_KEY_PARTS_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.HUDI_DEFAULT_PARTITION_PATH;
 
 /**
- * Base class for the built-in key generators. Contains methods structured for
- * code reuse amongst them.
+ * Base class for all built-in key generators.
+ *
+ * NOTE: By default it implements all the methods of {@link SparkKeyGeneratorInterface}, which
+ *       by default however fallback to Avro implementation. For maximum performance (to avoid
+ *       conversion from Spark's internal data-types to Avro) you should override these methods
+ *       in your implementation.
+ *
+ * TODO rename to AvroFallbackBaseKeyGenerator
  */
+@ThreadSafe
 public abstract class BuiltinKeyGenerator extends BaseKeyGenerator implements SparkKeyGeneratorInterface {
 
-  private static final String STRUCT_NAME = "hoodieRowTopLevelField";
-  private static final String NAMESPACE = "hoodieRow";
-  private Function1<Row, GenericRecord> converterFn = null;
-  private final AtomicBoolean validatePartitionFields = new AtomicBoolean(false);
-  protected StructType structType;
+  protected static final UTF8String HUDI_DEFAULT_PARTITION_PATH_UTF8 = UTF8String.fromString(HUDI_DEFAULT_PARTITION_PATH);
 
-  protected Map<String, Pair<List<Integer>, DataType>> recordKeySchemaInfo = new HashMap<>();
-  protected Map<String, Pair<List<Integer>, DataType>> partitionPathSchemaInfo = new HashMap<>();
+  protected transient volatile SparkRowConverter rowConverter;
+  protected transient volatile SparkRowAccessor rowAccessor;
 
   protected BuiltinKeyGenerator(TypedProperties config) {
     super(config);
   }
 
-  /**
-   * Fetch record key from {@link Row}.
-   *
-   * @param row instance of {@link Row} from which record key is requested.
-   * @return the record key of interest from {@link Row}.
-   */
   @Override
-  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
   public String getRecordKey(Row row) {
-    if (null == converterFn) {
-      converterFn = AvroConversionUtils.createConverterToAvro(row.schema(), STRUCT_NAME, NAMESPACE);
+    tryInitRowConverter(row.schema());
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return getRecordKey(rowConverter.convertToAvro(row));
+  }
+
+  @Override
+  public UTF8String getRecordKey(InternalRow internalRow, StructType schema) {
+    tryInitRowConverter(schema);
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return UTF8String.fromString(getRecordKey(rowConverter.convertToAvro(internalRow)));
+  }
+
+  @Override
+  public String getPartitionPath(Row row) {
+    tryInitRowConverter(row.schema());
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return getPartitionPath(rowConverter.convertToAvro(row));
+  }
+
+  @Override
+  public UTF8String getPartitionPath(InternalRow internalRow, StructType schema) {
+    tryInitRowConverter(schema);
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    GenericRecord avroRecord = rowConverter.convertToAvro(internalRow);
+    return UTF8String.fromString(getPartitionPath(avroRecord));
+  }
+
+  protected void tryInitRowAccessor(StructType schema) {
+    if (this.rowAccessor == null) {
+      synchronized (this) {
+        if (this.rowAccessor == null) {
+          this.rowAccessor = new SparkRowAccessor(schema);
+        }
+      }
     }
-    return getKey(converterFn.apply(row)).getRecordKey();
   }
 
   /**
-   * Fetch partition path from {@link Row}.
-   *
-   * @param row instance of {@link Row} from which partition path is requested
-   * @return the partition path of interest from {@link Row}.
+   * NOTE: This method has to stay final (so that it's easier for JIT compiler to apply certain
+   *       optimizations, like inlining)
    */
-  @Override
-  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
-  public String getPartitionPath(Row row) {
-    if (null == converterFn) {
-      converterFn = AvroConversionUtils.createConverterToAvro(row.schema(), STRUCT_NAME, NAMESPACE);
+  protected final String combinePartitionPath(Object... partitionPathParts) {
+    checkState(partitionPathParts.length == recordKeyFields.size());
+    // Avoid creating [[StringBuilder]] in case there's just one partition-path part,
+    // and Hive-style of partitioning is not required
+    if (!hiveStylePartitioning && partitionPathParts.length == 1) {
+      return partitionPathParts[0] != null
+          ? partitionPathParts[0].toString()
+          : HUDI_DEFAULT_PARTITION_PATH;
     }
-    return getKey(converterFn.apply(row)).getPartitionPath();
+
+    StringBuilder sb = new StringBuilder();
+    for (int i = 0; i < partitionPathParts.length; ++i) {
+      String partitionPathPartStr = partitionPathParts[i] != null
+          ? partitionPathParts[i].toString()
+          : HUDI_DEFAULT_PARTITION_PATH;
+
+      // TODO support url-encoding
+
+      if (hiveStylePartitioning) {
+        sb.append(recordKeyFields.get(i))

Review Comment:
   again, is this referring to partitionPathFields.get(i)? 



##########
hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/client/model/TestHoodieInternalRow.java:
##########
@@ -64,7 +65,13 @@ public void testGet() {
     Object[] values = getRandomValue(true);
 
     InternalRow row = new GenericInternalRow(values);
-    HoodieInternalRow hoodieInternalRow = new HoodieInternalRow("commitTime", "commitSeqNo", "recordKey", "partitionPath", "fileName", row);
+    HoodieInternalRow hoodieInternalRow = new HoodieInternalRow(UTF8String.fromString("commitTime"),
+        UTF8String.fromString("commitSeqNo"),

Review Comment:
   can we declare constants for these UTF8strings and use it across all tests? 



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/io/storage/row/HoodieRowCreateHandle.java:
##########
@@ -39,49 +39,74 @@
 import org.apache.log4j.Logger;
 import org.apache.spark.sql.catalyst.InternalRow;
 import org.apache.spark.sql.types.StructType;
+import org.apache.spark.unsafe.types.UTF8String;
 
 import java.io.IOException;
 import java.io.Serializable;
 import java.util.concurrent.atomic.AtomicLong;
+import java.util.function.Function;
 
 /**
  * Create handle with InternalRow for datasource implementation of bulk insert.
  */
 public class HoodieRowCreateHandle implements Serializable {
 
   private static final long serialVersionUID = 1L;
+
   private static final Logger LOG = LogManager.getLogger(HoodieRowCreateHandle.class);
-  private static final AtomicLong SEQGEN = new AtomicLong(1);
+  private static final AtomicLong GLOBAL_SEQ_NO = new AtomicLong(1);
+
+  private static final Integer RECORD_KEY_META_FIELD_ORD =
+      HoodieRecord.HOODIE_META_COLUMNS_NAME_TO_POS.get(HoodieRecord.RECORD_KEY_METADATA_FIELD);

Review Comment:
   PARTITION_PATH_META_FIELD_POS as well



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/BuiltinKeyGenerator.java:
##########
@@ -18,121 +18,334 @@
 
 package org.apache.hudi.keygen;
 
-import org.apache.hudi.ApiMaturityLevel;
+import org.apache.avro.generic.GenericRecord;
 import org.apache.hudi.AvroConversionUtils;
-import org.apache.hudi.PublicAPIMethod;
+import org.apache.hudi.HoodieSparkUtils;
+import org.apache.hudi.client.utils.SparkRowSerDe;
 import org.apache.hudi.common.config.TypedProperties;
-import org.apache.hudi.common.util.collection.Pair;
-import org.apache.hudi.exception.HoodieIOException;
-
-import org.apache.avro.generic.GenericRecord;
+import org.apache.hudi.common.util.PartitionPathEncodeUtils;
+import org.apache.hudi.exception.HoodieKeyException;
+import org.apache.hudi.unsafe.UTF8StringBuilder;
+import org.apache.spark.sql.HoodieUnsafeRowUtils;
+import org.apache.spark.sql.HoodieUnsafeRowUtils$;
 import org.apache.spark.sql.Row;
 import org.apache.spark.sql.catalyst.InternalRow;
-import org.apache.spark.sql.types.DataType;
 import org.apache.spark.sql.types.StructType;
+import org.apache.spark.unsafe.types.UTF8String;
+import scala.Function1;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
+import javax.annotation.concurrent.ThreadSafe;
 
-import scala.Function1;
+import static org.apache.hudi.common.util.ValidationUtils.checkState;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_PARTITION_PATH_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_RECORD_KEY_PARTS_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.HUDI_DEFAULT_PARTITION_PATH;
 
 /**
- * Base class for the built-in key generators. Contains methods structured for
- * code reuse amongst them.
+ * Base class for all built-in key generators.
+ *
+ * NOTE: By default it implements all the methods of {@link SparkKeyGeneratorInterface}, which
+ *       by default however fallback to Avro implementation. For maximum performance (to avoid
+ *       conversion from Spark's internal data-types to Avro) you should override these methods
+ *       in your implementation.
+ *
+ * TODO rename to AvroFallbackBaseKeyGenerator
  */
+@ThreadSafe
 public abstract class BuiltinKeyGenerator extends BaseKeyGenerator implements SparkKeyGeneratorInterface {
 
-  private static final String STRUCT_NAME = "hoodieRowTopLevelField";
-  private static final String NAMESPACE = "hoodieRow";
-  private Function1<Row, GenericRecord> converterFn = null;
-  private final AtomicBoolean validatePartitionFields = new AtomicBoolean(false);
-  protected StructType structType;
+  protected static final UTF8String HUDI_DEFAULT_PARTITION_PATH_UTF8 = UTF8String.fromString(HUDI_DEFAULT_PARTITION_PATH);
 
-  protected Map<String, Pair<List<Integer>, DataType>> recordKeySchemaInfo = new HashMap<>();
-  protected Map<String, Pair<List<Integer>, DataType>> partitionPathSchemaInfo = new HashMap<>();
+  protected transient volatile SparkRowConverter rowConverter;
+  protected transient volatile SparkRowAccessor rowAccessor;
 
   protected BuiltinKeyGenerator(TypedProperties config) {
     super(config);
   }
 
-  /**
-   * Fetch record key from {@link Row}.
-   *
-   * @param row instance of {@link Row} from which record key is requested.
-   * @return the record key of interest from {@link Row}.
-   */
   @Override
-  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
   public String getRecordKey(Row row) {
-    if (null == converterFn) {
-      converterFn = AvroConversionUtils.createConverterToAvro(row.schema(), STRUCT_NAME, NAMESPACE);
+    tryInitRowConverter(row.schema());
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return getRecordKey(rowConverter.convertToAvro(row));
+  }
+
+  @Override
+  public UTF8String getRecordKey(InternalRow internalRow, StructType schema) {
+    tryInitRowConverter(schema);
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return UTF8String.fromString(getRecordKey(rowConverter.convertToAvro(internalRow)));
+  }
+
+  @Override
+  public String getPartitionPath(Row row) {
+    tryInitRowConverter(row.schema());
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return getPartitionPath(rowConverter.convertToAvro(row));
+  }
+
+  @Override
+  public UTF8String getPartitionPath(InternalRow internalRow, StructType schema) {
+    tryInitRowConverter(schema);
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    GenericRecord avroRecord = rowConverter.convertToAvro(internalRow);
+    return UTF8String.fromString(getPartitionPath(avroRecord));
+  }
+
+  protected void tryInitRowAccessor(StructType schema) {
+    if (this.rowAccessor == null) {
+      synchronized (this) {
+        if (this.rowAccessor == null) {
+          this.rowAccessor = new SparkRowAccessor(schema);
+        }
+      }
     }
-    return getKey(converterFn.apply(row)).getRecordKey();
   }
 
   /**
-   * Fetch partition path from {@link Row}.
-   *
-   * @param row instance of {@link Row} from which partition path is requested
-   * @return the partition path of interest from {@link Row}.
+   * NOTE: This method has to stay final (so that it's easier for JIT compiler to apply certain
+   *       optimizations, like inlining)
    */
-  @Override
-  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
-  public String getPartitionPath(Row row) {
-    if (null == converterFn) {
-      converterFn = AvroConversionUtils.createConverterToAvro(row.schema(), STRUCT_NAME, NAMESPACE);
+  protected final String combinePartitionPath(Object... partitionPathParts) {
+    checkState(partitionPathParts.length == recordKeyFields.size());

Review Comment:
   did you mean partitionPathFields as 2nd arg?



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/io/storage/row/HoodieRowCreateHandle.java:
##########
@@ -39,49 +39,74 @@
 import org.apache.log4j.Logger;
 import org.apache.spark.sql.catalyst.InternalRow;
 import org.apache.spark.sql.types.StructType;
+import org.apache.spark.unsafe.types.UTF8String;
 
 import java.io.IOException;
 import java.io.Serializable;
 import java.util.concurrent.atomic.AtomicLong;
+import java.util.function.Function;
 
 /**
  * Create handle with InternalRow for datasource implementation of bulk insert.
  */
 public class HoodieRowCreateHandle implements Serializable {
 
   private static final long serialVersionUID = 1L;
+
   private static final Logger LOG = LogManager.getLogger(HoodieRowCreateHandle.class);
-  private static final AtomicLong SEQGEN = new AtomicLong(1);
+  private static final AtomicLong GLOBAL_SEQ_NO = new AtomicLong(1);
+
+  private static final Integer RECORD_KEY_META_FIELD_ORD =
+      HoodieRecord.HOODIE_META_COLUMNS_NAME_TO_POS.get(HoodieRecord.RECORD_KEY_METADATA_FIELD);

Review Comment:
   we already have HoodieRecord.RECORD_KEY_META_FIELD_POS. probably we can re-use.



##########
hudi-spark-datasource/hudi-spark-common/src/main/java/org/apache/hudi/internal/BulkInsertDataInternalWriterHelper.java:
##########
@@ -157,7 +152,29 @@ public List<HoodieInternalWriteStatus> getWriteStatuses() throws IOException {
     return writeStatusList;
   }
 
-  public void abort() {
+  public void abort() {}
+
+  public void close() throws IOException {
+    for (HoodieRowCreateHandle rowCreateHandle : handles.values()) {
+      writeStatusList.add(rowCreateHandle.close());
+    }
+    handles.clear();
+    handle = null;
+  }
+
+  private UTF8String extractPartitionPath(InternalRow row) {
+    if (populateMetaFields) {
+      // In case meta-fields are materialized w/in the table itself, we can just simply extract
+      // partition path from there
+      //
+      // NOTE: Helper keeps track of [[lastKnownPartitionPath]] as [[UTF8String]] to avoid
+      //       conversion from Catalyst internal representation into a [[String]]
+      return row.getUTF8String(HoodieRecord.PARTITION_PATH_META_FIELD_POS);
+    } else if (keyGeneratorOpt.isPresent()) {
+      return keyGeneratorOpt.get().getPartitionPath(row, structType);

Review Comment:
   prior to this patch, in case of SimpleKeyGen, we had a special case where we directly fetch the field and not go via key generator L131 to L136. guess we missed to retain that. only if not for simple key gen, we go via regular key gen. 
   



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/CustomKeyGenerator.java:
##########
@@ -46,16 +47,27 @@
  * field in the partition path, use field1:simple 3. If you want your table to be non partitioned, simply leave it as blank.
  *
  * RecordKey is internally generated using either SimpleKeyGenerator or ComplexKeyGenerator.
+ *
+ * @deprecated
  */
+@Deprecated

Review Comment:
   do we know why we are deprecating this? whats the alternative suggested? 



##########
hudi-client/hudi-spark-client/src/main/scala/org/apache/spark/sql/HoodieUnsafeRowUtils.scala:
##########
@@ -0,0 +1,122 @@
+/*
+ * 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.spark.sql
+
+import org.apache.spark.sql.catalyst.InternalRow
+import org.apache.spark.sql.types.{StructField, StructType}
+
+import scala.collection.mutable.ArrayBuffer
+
+object HoodieUnsafeRowUtils {
+
+  /**
+   * Fetches (nested) value w/in provided [[Row]] uniquely identified by the provided nested-field path
+   * previously composed by [[composeNestedFieldPath]]
+   */
+  def getNestedRowValue(row: Row, nestedFieldPath: NestedFieldPath): Any = {

Review Comment:
   did you have to make any changes or just moved code as is? If you can point me to the actual changes, will review only those.



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/BuiltinKeyGenerator.java:
##########
@@ -18,121 +18,334 @@
 
 package org.apache.hudi.keygen;
 
-import org.apache.hudi.ApiMaturityLevel;
+import org.apache.avro.generic.GenericRecord;
 import org.apache.hudi.AvroConversionUtils;
-import org.apache.hudi.PublicAPIMethod;
+import org.apache.hudi.HoodieSparkUtils;
+import org.apache.hudi.client.utils.SparkRowSerDe;
 import org.apache.hudi.common.config.TypedProperties;
-import org.apache.hudi.common.util.collection.Pair;
-import org.apache.hudi.exception.HoodieIOException;
-
-import org.apache.avro.generic.GenericRecord;
+import org.apache.hudi.common.util.PartitionPathEncodeUtils;
+import org.apache.hudi.exception.HoodieKeyException;
+import org.apache.hudi.unsafe.UTF8StringBuilder;
+import org.apache.spark.sql.HoodieUnsafeRowUtils;
+import org.apache.spark.sql.HoodieUnsafeRowUtils$;
 import org.apache.spark.sql.Row;
 import org.apache.spark.sql.catalyst.InternalRow;
-import org.apache.spark.sql.types.DataType;
 import org.apache.spark.sql.types.StructType;
+import org.apache.spark.unsafe.types.UTF8String;
+import scala.Function1;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
+import javax.annotation.concurrent.ThreadSafe;
 
-import scala.Function1;
+import static org.apache.hudi.common.util.ValidationUtils.checkState;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_PARTITION_PATH_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_RECORD_KEY_PARTS_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.HUDI_DEFAULT_PARTITION_PATH;
 
 /**
- * Base class for the built-in key generators. Contains methods structured for
- * code reuse amongst them.
+ * Base class for all built-in key generators.
+ *
+ * NOTE: By default it implements all the methods of {@link SparkKeyGeneratorInterface}, which
+ *       by default however fallback to Avro implementation. For maximum performance (to avoid
+ *       conversion from Spark's internal data-types to Avro) you should override these methods
+ *       in your implementation.
+ *
+ * TODO rename to AvroFallbackBaseKeyGenerator
  */
+@ThreadSafe
 public abstract class BuiltinKeyGenerator extends BaseKeyGenerator implements SparkKeyGeneratorInterface {
 
-  private static final String STRUCT_NAME = "hoodieRowTopLevelField";
-  private static final String NAMESPACE = "hoodieRow";
-  private Function1<Row, GenericRecord> converterFn = null;
-  private final AtomicBoolean validatePartitionFields = new AtomicBoolean(false);
-  protected StructType structType;
+  protected static final UTF8String HUDI_DEFAULT_PARTITION_PATH_UTF8 = UTF8String.fromString(HUDI_DEFAULT_PARTITION_PATH);
 
-  protected Map<String, Pair<List<Integer>, DataType>> recordKeySchemaInfo = new HashMap<>();
-  protected Map<String, Pair<List<Integer>, DataType>> partitionPathSchemaInfo = new HashMap<>();
+  protected transient volatile SparkRowConverter rowConverter;
+  protected transient volatile SparkRowAccessor rowAccessor;
 
   protected BuiltinKeyGenerator(TypedProperties config) {
     super(config);
   }
 
-  /**
-   * Fetch record key from {@link Row}.
-   *
-   * @param row instance of {@link Row} from which record key is requested.
-   * @return the record key of interest from {@link Row}.
-   */
   @Override
-  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
   public String getRecordKey(Row row) {
-    if (null == converterFn) {
-      converterFn = AvroConversionUtils.createConverterToAvro(row.schema(), STRUCT_NAME, NAMESPACE);
+    tryInitRowConverter(row.schema());

Review Comment:
   may I know why we have removed the maturity ("EVOLVING") annotation? 



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/client/model/HoodieInternalRow.java:
##########
@@ -57,187 +92,153 @@ public int numFields() {
   }
 
   @Override
-  public void setNullAt(int i) {
-    if (i < HoodieRecord.HOODIE_META_COLUMNS.size()) {
-      switch (i) {
-        case 0: {
-          this.commitTime = null;
-          break;
-        }
-        case 1: {
-          this.commitSeqNumber = null;
-          break;
-        }
-        case 2: {
-          this.recordKey = null;
-          break;
-        }
-        case 3: {
-          this.partitionPath = null;
-          break;
-        }
-        case 4: {
-          this.fileName = null;
-          break;
-        }
-        default: throw new IllegalArgumentException("Not expected");
-      }
+  public void setNullAt(int ordinal) {
+    if (ordinal < metaFields.length) {
+      metaFields[ordinal] = null;
     } else {
-      row.setNullAt(i);
+      row.setNullAt(rebaseOrdinal(ordinal));
     }
   }
 
   @Override
-  public void update(int i, Object value) {
-    if (i < HoodieRecord.HOODIE_META_COLUMNS.size()) {
-      switch (i) {
-        case 0: {
-          this.commitTime = value.toString();
-          break;
-        }
-        case 1: {
-          this.commitSeqNumber = value.toString();
-          break;
-        }
-        case 2: {
-          this.recordKey = value.toString();
-          break;
-        }
-        case 3: {
-          this.partitionPath = value.toString();
-          break;
-        }
-        case 4: {
-          this.fileName = value.toString();
-          break;
-        }
-        default: throw new IllegalArgumentException("Not expected");
+  public void update(int ordinal, Object value) {
+    if (ordinal < metaFields.length) {
+      if (value instanceof UTF8String) {
+        metaFields[ordinal] = (UTF8String) value;
+      } else if (value instanceof String) {
+        metaFields[ordinal] = UTF8String.fromString((String) value);
+      } else {
+        throw new IllegalArgumentException(
+            String.format("Could not update the row at (%d) with value of type (%s), either UTF8String or String are expected", ordinal, value.getClass().getSimpleName()));
       }
     } else {
-      row.update(i, value);
+      row.update(rebaseOrdinal(ordinal), value);
     }
   }
 
-  private String getMetaColumnVal(int ordinal) {
-    switch (ordinal) {
-      case 0: {
-        return commitTime;
-      }
-      case 1: {
-        return commitSeqNumber;
-      }
-      case 2: {
-        return recordKey;
-      }
-      case 3: {
-        return partitionPath;
-      }
-      case 4: {
-        return fileName;
-      }
-      default: throw new IllegalArgumentException("Not expected");
+  @Override
+  public boolean isNullAt(int ordinal) {
+    if (ordinal < metaFields.length) {
+      return metaFields[ordinal] == null;
     }
+    return row.isNullAt(rebaseOrdinal(ordinal));
   }
 
   @Override
-  public boolean isNullAt(int ordinal) {
+  public UTF8String getUTF8String(int ordinal) {
+    if (ordinal < HoodieRecord.HOODIE_META_COLUMNS.size()) {

Review Comment:
   minor. to be consistent w/ other places, can we do 
   ```
   < metaFields.length
   ```



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/SparkKeyGeneratorInterface.java:
##########
@@ -18,18 +18,65 @@
 
 package org.apache.hudi.keygen;
 
+import org.apache.hudi.ApiMaturityLevel;
+import org.apache.hudi.PublicAPIMethod;
 import org.apache.spark.sql.Row;
 import org.apache.spark.sql.catalyst.InternalRow;
 import org.apache.spark.sql.types.StructType;
+import org.apache.spark.unsafe.types.UTF8String;
 
 /**
- * Spark key generator interface.
+ * Spark-specific {@link KeyGenerator} interface extension allowing implementation to
+ * specifically implement record-key, partition-path generation w/o the need for (expensive)
+ * conversion from Spark internal representation (for ex, to Avro)
  */
 public interface SparkKeyGeneratorInterface extends KeyGeneratorInterface {
 
+  /**
+   * Extracts record key from Spark's {@link Row}
+   *
+   * @param row instance of {@link Row} from which record-key is extracted
+   * @return record's (primary) key
+   */
+  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
   String getRecordKey(Row row);
 
+  /**
+   * Extracts record key from Spark's {@link InternalRow}
+   *
+   * NOTE: Difference b/w {@link Row} and {@link InternalRow} is that {@link InternalRow} could
+   *       internally hold just a binary representation of the data, while {@link Row} has it
+   *       deserialized into JVM-native representation (like {@code Integer}, {@code Long},
+   *       {@code String}, etc)
+   *
+   * @param row instance of {@link InternalRow} from which record-key is extracted
+   * @param schema schema {@link InternalRow} is adhering to
+   * @return record-key as instance of {@link UTF8String}
+   */
+  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
+  UTF8String getRecordKey(InternalRow row, StructType schema);
+
+  /**
+   * Extracts partition-path from {@link Row}
+   *
+   * @param row instance of {@link Row} from which record-key is extracted

Review Comment:
   minor. "from which partition path" is extracted.



##########
hudi-client/hudi-spark-client/src/main/scala/org/apache/spark/sql/HoodieUnsafeRowUtils.scala:
##########
@@ -0,0 +1,122 @@
+/*
+ * 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.spark.sql
+
+import org.apache.spark.sql.catalyst.InternalRow
+import org.apache.spark.sql.types.{StructField, StructType}
+
+import scala.collection.mutable.ArrayBuffer
+
+object HoodieUnsafeRowUtils {
+
+  /**
+   * Fetches (nested) value w/in provided [[Row]] uniquely identified by the provided nested-field path
+   * previously composed by [[composeNestedFieldPath]]
+   */
+  def getNestedRowValue(row: Row, nestedFieldPath: NestedFieldPath): Any = {
+    var curRow = row
+    for (idx <- nestedFieldPath.parts.indices) {
+      val (ord, f) = nestedFieldPath.parts(idx)
+      if (curRow.isNullAt(ord)) {
+        // scalastyle:off return
+        if (f.nullable) return null

Review Comment:
   I see one change. null place holder is replaced w/ explicit nulls.



##########
hudi-common/src/main/java/org/apache/hudi/keygen/KeyGenerator.java:
##########
@@ -52,7 +52,7 @@ protected KeyGenerator(TypedProperties config) {
    * @return list of field names, when concatenated make up the record key.
    */
   @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
-  public List<String> getRecordKeyFieldNames() {

Review Comment:
   or add deprecated for older ones.



-- 
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 #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4b608b4a1cb022986e282c404554dd6272588606",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979",
       "triggerID" : "4b608b4a1cb022986e282c404554dd6272588606",
       "triggerType" : "PUSH"
     }, {
       "hash" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10052",
       "triggerID" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10067",
       "triggerID" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10073",
       "triggerID" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10080",
       "triggerID" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a749f666b8b5ee409cef0342532d6c90a6b71a2a",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "a749f666b8b5ee409cef0342532d6c90a6b71a2a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c7faef9c1c5f12303cd94c51ff4e6fe71473c16f Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10080) 
   * a749f666b8b5ee409cef0342532d6c90a6b71a2a 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] hudi-bot commented on pull request #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4b608b4a1cb022986e282c404554dd6272588606",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979",
       "triggerID" : "4b608b4a1cb022986e282c404554dd6272588606",
       "triggerType" : "PUSH"
     }, {
       "hash" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10052",
       "triggerID" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10067",
       "triggerID" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10073",
       "triggerID" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10080",
       "triggerID" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a749f666b8b5ee409cef0342532d6c90a6b71a2a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10085",
       "triggerID" : "a749f666b8b5ee409cef0342532d6c90a6b71a2a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1814b10b6bf6e3bc0fe1c483442b8637f929b2b0",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10106",
       "triggerID" : "1814b10b6bf6e3bc0fe1c483442b8637f929b2b0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bd922449d1756895a5e1cd8c3c85e33fcc3dd809",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10150",
       "triggerID" : "bd922449d1756895a5e1cd8c3c85e33fcc3dd809",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1814b10b6bf6e3bc0fe1c483442b8637f929b2b0 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10106) 
   * bd922449d1756895a5e1cd8c3c85e33fcc3dd809 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10150) 
   
   <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 #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 80e0b11c890cbb1f6bec082ed04e428772f69694 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969) 
   
   <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 #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a01447ba4b2d720d362be8fd963fca781747b0d3 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944) 
   * cafc6f941ac2f13a71f80c7298b84712e93d16b8 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963) 
   
   <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 #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4b608b4a1cb022986e282c404554dd6272588606",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979",
       "triggerID" : "4b608b4a1cb022986e282c404554dd6272588606",
       "triggerType" : "PUSH"
     }, {
       "hash" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10052",
       "triggerID" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10067",
       "triggerID" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * e7a1d6a5699b8d8b759f613c751329dcb27d97b7 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10067) 
   * 567bfb97df6f9cf5630cb925ad778f0d17d4ff88 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] hudi-bot commented on pull request #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4b608b4a1cb022986e282c404554dd6272588606",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979",
       "triggerID" : "4b608b4a1cb022986e282c404554dd6272588606",
       "triggerType" : "PUSH"
     }, {
       "hash" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10052",
       "triggerID" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10067",
       "triggerID" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10073",
       "triggerID" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10080",
       "triggerID" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 567bfb97df6f9cf5630cb925ad778f0d17d4ff88 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10073) 
   * c7faef9c1c5f12303cd94c51ff4e6fe71473c16f Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10080) 
   
   <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] alexeykudinkin commented on pull request #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   CI has been green:
   https://dev.azure.com/apache-hudi-ci-org/apache-hudi-ci/_build/results?buildId=10106&view=results


-- 
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 #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4b608b4a1cb022986e282c404554dd6272588606",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979",
       "triggerID" : "4b608b4a1cb022986e282c404554dd6272588606",
       "triggerType" : "PUSH"
     }, {
       "hash" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10052",
       "triggerID" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10067",
       "triggerID" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10073",
       "triggerID" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10080",
       "triggerID" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a749f666b8b5ee409cef0342532d6c90a6b71a2a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10085",
       "triggerID" : "a749f666b8b5ee409cef0342532d6c90a6b71a2a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1814b10b6bf6e3bc0fe1c483442b8637f929b2b0",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10106",
       "triggerID" : "1814b10b6bf6e3bc0fe1c483442b8637f929b2b0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bd922449d1756895a5e1cd8c3c85e33fcc3dd809",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10150",
       "triggerID" : "bd922449d1756895a5e1cd8c3c85e33fcc3dd809",
       "triggerType" : "PUSH"
     }, {
       "hash" : "24da4bb8af969e5c0706c91eb4ae5e64ecb5d1dc",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "24da4bb8af969e5c0706c91eb4ae5e64ecb5d1dc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "dbaafef2a8cfe013976422897ddd18bf0038a7dc",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "dbaafef2a8cfe013976422897ddd18bf0038a7dc",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * bd922449d1756895a5e1cd8c3c85e33fcc3dd809 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10150) 
   * 24da4bb8af969e5c0706c91eb4ae5e64ecb5d1dc UNKNOWN
   * dbaafef2a8cfe013976422897ddd18bf0038a7dc 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] alexeykudinkin commented on a diff in pull request #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/client/model/HoodieInternalRow.java:
##########
@@ -57,187 +92,153 @@ public int numFields() {
   }
 
   @Override
-  public void setNullAt(int i) {
-    if (i < HoodieRecord.HOODIE_META_COLUMNS.size()) {
-      switch (i) {
-        case 0: {
-          this.commitTime = null;
-          break;
-        }
-        case 1: {
-          this.commitSeqNumber = null;
-          break;
-        }
-        case 2: {
-          this.recordKey = null;
-          break;
-        }
-        case 3: {
-          this.partitionPath = null;
-          break;
-        }
-        case 4: {
-          this.fileName = null;
-          break;
-        }
-        default: throw new IllegalArgumentException("Not expected");
-      }
+  public void setNullAt(int ordinal) {
+    if (ordinal < metaFields.length) {
+      metaFields[ordinal] = null;
     } else {
-      row.setNullAt(i);
+      row.setNullAt(rebaseOrdinal(ordinal));
     }
   }
 
   @Override
-  public void update(int i, Object value) {
-    if (i < HoodieRecord.HOODIE_META_COLUMNS.size()) {
-      switch (i) {
-        case 0: {
-          this.commitTime = value.toString();
-          break;
-        }
-        case 1: {
-          this.commitSeqNumber = value.toString();
-          break;
-        }
-        case 2: {
-          this.recordKey = value.toString();
-          break;
-        }
-        case 3: {
-          this.partitionPath = value.toString();
-          break;
-        }
-        case 4: {
-          this.fileName = value.toString();
-          break;
-        }
-        default: throw new IllegalArgumentException("Not expected");
+  public void update(int ordinal, Object value) {
+    if (ordinal < metaFields.length) {
+      if (value instanceof UTF8String) {
+        metaFields[ordinal] = (UTF8String) value;
+      } else if (value instanceof String) {
+        metaFields[ordinal] = UTF8String.fromString((String) value);
+      } else {
+        throw new IllegalArgumentException(
+            String.format("Could not update the row at (%d) with value of type (%s), either UTF8String or String are expected", ordinal, value.getClass().getSimpleName()));
       }
     } else {
-      row.update(i, value);
+      row.update(rebaseOrdinal(ordinal), value);
     }
   }
 
-  private String getMetaColumnVal(int ordinal) {
-    switch (ordinal) {
-      case 0: {
-        return commitTime;
-      }
-      case 1: {
-        return commitSeqNumber;
-      }
-      case 2: {
-        return recordKey;
-      }
-      case 3: {
-        return partitionPath;
-      }
-      case 4: {
-        return fileName;
-      }
-      default: throw new IllegalArgumentException("Not expected");
+  @Override
+  public boolean isNullAt(int ordinal) {
+    if (ordinal < metaFields.length) {
+      return metaFields[ordinal] == null;
     }
+    return row.isNullAt(rebaseOrdinal(ordinal));
   }
 
   @Override
-  public boolean isNullAt(int ordinal) {
+  public UTF8String getUTF8String(int ordinal) {
+    if (ordinal < HoodieRecord.HOODIE_META_COLUMNS.size()) {
+      return metaFields[ordinal];
+    }
+    return row.getUTF8String(rebaseOrdinal(ordinal));
+  }
+
+  @Override
+  public Object get(int ordinal, DataType dataType) {
     if (ordinal < HoodieRecord.HOODIE_META_COLUMNS.size()) {
-      return null == getMetaColumnVal(ordinal);
+      validateMetaFieldDataType(dataType);
+      return metaFields[ordinal];
     }
-    return row.isNullAt(ordinal);
+    return row.get(rebaseOrdinal(ordinal), dataType);
   }
 
   @Override
   public boolean getBoolean(int ordinal) {
-    return row.getBoolean(ordinal);
+    ruleOutMetaFieldsAccess(ordinal, Boolean.class);
+    return row.getBoolean(rebaseOrdinal(ordinal));
   }
 
   @Override
   public byte getByte(int ordinal) {
-    return row.getByte(ordinal);
+    ruleOutMetaFieldsAccess(ordinal, Byte.class);
+    return row.getByte(rebaseOrdinal(ordinal));
   }
 
   @Override
   public short getShort(int ordinal) {
-    return row.getShort(ordinal);
+    ruleOutMetaFieldsAccess(ordinal, Short.class);
+    return row.getShort(rebaseOrdinal(ordinal));
   }
 
   @Override
   public int getInt(int ordinal) {
-    return row.getInt(ordinal);
+    ruleOutMetaFieldsAccess(ordinal, Integer.class);
+    return row.getInt(rebaseOrdinal(ordinal));
   }
 
   @Override
   public long getLong(int ordinal) {
-    return row.getLong(ordinal);
+    ruleOutMetaFieldsAccess(ordinal, Long.class);
+    return row.getLong(rebaseOrdinal(ordinal));
   }
 
   @Override
   public float getFloat(int ordinal) {
-    return row.getFloat(ordinal);
+    ruleOutMetaFieldsAccess(ordinal, Float.class);
+    return row.getFloat(rebaseOrdinal(ordinal));
   }
 
   @Override
   public double getDouble(int ordinal) {
-    return row.getDouble(ordinal);
+    ruleOutMetaFieldsAccess(ordinal, Double.class);
+    return row.getDouble(rebaseOrdinal(ordinal));
   }
 
   @Override
   public Decimal getDecimal(int ordinal, int precision, int scale) {
-    return row.getDecimal(ordinal, precision, scale);
-  }
-
-  @Override
-  public UTF8String getUTF8String(int ordinal) {
-    if (ordinal < HoodieRecord.HOODIE_META_COLUMNS.size()) {
-      return UTF8String.fromBytes(getMetaColumnVal(ordinal).getBytes());
-    }
-    return row.getUTF8String(ordinal);
-  }
-
-  @Override
-  public String getString(int ordinal) {
-    if (ordinal < HoodieRecord.HOODIE_META_COLUMNS.size()) {
-      return new String(getMetaColumnVal(ordinal).getBytes());
-    }
-    return row.getString(ordinal);
+    ruleOutMetaFieldsAccess(ordinal, Decimal.class);
+    return row.getDecimal(rebaseOrdinal(ordinal), precision, scale);
   }
 
   @Override
   public byte[] getBinary(int ordinal) {
-    return row.getBinary(ordinal);
+    ruleOutMetaFieldsAccess(ordinal, Byte[].class);
+    return row.getBinary(rebaseOrdinal(ordinal));
   }
 
   @Override
   public CalendarInterval getInterval(int ordinal) {
-    return row.getInterval(ordinal);
+    ruleOutMetaFieldsAccess(ordinal, CalendarInterval.class);
+    return row.getInterval(rebaseOrdinal(ordinal));
   }
 
   @Override
   public InternalRow getStruct(int ordinal, int numFields) {
-    return row.getStruct(ordinal, numFields);
+    ruleOutMetaFieldsAccess(ordinal, InternalRow.class);
+    return row.getStruct(rebaseOrdinal(ordinal), numFields);
   }
 
   @Override
   public ArrayData getArray(int ordinal) {
-    return row.getArray(ordinal);
+    ruleOutMetaFieldsAccess(ordinal, ArrayData.class);
+    return row.getArray(rebaseOrdinal(ordinal));
   }
 
   @Override
   public MapData getMap(int ordinal) {
-    return row.getMap(ordinal);
+    ruleOutMetaFieldsAccess(ordinal, MapData.class);
+    return row.getMap(rebaseOrdinal(ordinal));
   }
 
   @Override
-  public Object get(int ordinal, DataType dataType) {
-    if (ordinal < HoodieRecord.HOODIE_META_COLUMNS.size()) {
-      return UTF8String.fromBytes(getMetaColumnVal(ordinal).getBytes());
+  public InternalRow copy() {
+    return new HoodieInternalRow(Arrays.copyOf(metaFields, metaFields.length), row.copy(), containsMetaFields);
+  }
+
+  private int rebaseOrdinal(int ordinal) {
+    // NOTE: In cases when source row does not contain meta fields, we will have to
+    //       rebase ordinal onto its indexes
+    return containsMetaFields ? ordinal : ordinal - metaFields.length;
+  }
+
+  private void validateMetaFieldDataType(DataType dataType) {
+    if (!dataType.sameType(StringType$.MODULE$)) {
+      throw new ClassCastException(String.format("Can not cast meta-field of type UTF8String to %s", dataType.simpleString()));
     }
-    return row.get(ordinal, dataType);
   }
 
-  @Override
-  public InternalRow copy() {
-    return new HoodieInternalRow(commitTime, commitSeqNumber, recordKey, partitionPath, fileName, row.copy());
+  private void ruleOutMetaFieldsAccess(int ordinal, Class<?> expectedDataType) {

Review Comment:
   It's a good call out, we should be vigilant to make sure we're not tripping into easily avoidable perf traps. In this case though, i don't think this method will have much impact -- it's a single conditional w/ simple check that will be inlined be the JVM (it's cost won't be much). Later on if we see it showing up in the profiles, we can follow-up and make validations optional but out the gate i wouldn't try to optimize it out since it's impact won't be material.



##########
hudi-client/hudi-spark-client/src/main/scala/org/apache/spark/sql/HoodieUnsafeRowUtils.scala:
##########
@@ -0,0 +1,122 @@
+/*
+ * 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.spark.sql
+
+import org.apache.spark.sql.catalyst.InternalRow
+import org.apache.spark.sql.types.{StructField, StructType}
+
+import scala.collection.mutable.ArrayBuffer
+
+object HoodieUnsafeRowUtils {
+
+  /**
+   * Fetches (nested) value w/in provided [[Row]] uniquely identified by the provided nested-field path
+   * previously composed by [[composeNestedFieldPath]]
+   */
+  def getNestedRowValue(row: Row, nestedFieldPath: NestedFieldPath): Any = {

Review Comment:
   This is a brand new code



##########
hudi-common/src/main/java/org/apache/hudi/keygen/KeyGenerator.java:
##########
@@ -52,7 +52,7 @@ protected KeyGenerator(TypedProperties config) {
    * @return list of field names, when concatenated make up the record key.
    */
   @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
-  public List<String> getRecordKeyFieldNames() {

Review Comment:
   Good call, i think we can avoid making this breaking change



##########
hudi-client/hudi-spark-client/src/main/scala/org/apache/hudi/unsafe/UTF8StringBuilder.java:
##########
@@ -0,0 +1,100 @@
+/*
+ * 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.unsafe;
+
+import org.apache.spark.unsafe.Platform;
+import org.apache.spark.unsafe.array.ByteArrayMethods;
+import org.apache.spark.unsafe.types.UTF8String;
+
+/**
+ * A helper class to write {@link UTF8String}s to an internal buffer and build the concatenated
+ * {@link UTF8String} at the end.
+ */
+public class UTF8StringBuilder {
+
+  private static final int ARRAY_MAX = ByteArrayMethods.MAX_ROUNDED_ARRAY_LENGTH;
+
+  private byte[] buffer;
+  private int cursor = Platform.BYTE_ARRAY_OFFSET;
+
+  public UTF8StringBuilder() {

Review Comment:
   This is cloned from Spark



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/CustomKeyGenerator.java:
##########
@@ -46,16 +47,27 @@
  * field in the partition path, use field1:simple 3. If you want your table to be non partitioned, simply leave it as blank.
  *
  * RecordKey is internally generated using either SimpleKeyGenerator or ComplexKeyGenerator.
+ *
+ * @deprecated
  */
+@Deprecated

Review Comment:
   Good call! I think initially i've marked it for deprecation purely from the standpoint that it's implementation isn't really viable (it initializes new key-gen for every call to getRecordKey/getPartitionPath), but didn't offer suggestion to replace it. Will address



##########
hudi-client/hudi-spark-client/src/main/scala/org/apache/spark/sql/HoodieUnsafeRowUtils.scala:
##########
@@ -0,0 +1,122 @@
+/*
+ * 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.spark.sql
+
+import org.apache.spark.sql.catalyst.InternalRow
+import org.apache.spark.sql.types.{StructField, StructType}
+
+import scala.collection.mutable.ArrayBuffer
+
+object HoodieUnsafeRowUtils {
+
+  /**
+   * Fetches (nested) value w/in provided [[Row]] uniquely identified by the provided nested-field path
+   * previously composed by [[composeNestedFieldPath]]
+   */
+  def getNestedRowValue(row: Row, nestedFieldPath: NestedFieldPath): Any = {
+    var curRow = row
+    for (idx <- nestedFieldPath.parts.indices) {
+      val (ord, f) = nestedFieldPath.parts(idx)
+      if (curRow.isNullAt(ord)) {
+        // scalastyle:off return
+        if (f.nullable) return null

Review Comment:
   Structurally they are very similar, goal here was to:
   
   1. Clean up the code, make it more concise (it just needs to do a simple iteration)
   2. Converted to Scala to avoid cumbersome Java <> Scala interactions when working w/ `Row`s



##########
hudi-spark-datasource/hudi-spark-common/src/main/java/org/apache/hudi/internal/BulkInsertDataInternalWriterHelper.java:
##########
@@ -157,7 +152,29 @@ public List<HoodieInternalWriteStatus> getWriteStatuses() throws IOException {
     return writeStatusList;
   }
 
-  public void abort() {
+  public void abort() {}
+
+  public void close() throws IOException {
+    for (HoodieRowCreateHandle rowCreateHandle : handles.values()) {
+      writeStatusList.add(rowCreateHandle.close());
+    }
+    handles.clear();
+    handle = null;
+  }
+
+  private UTF8String extractPartitionPath(InternalRow row) {
+    if (populateMetaFields) {
+      // In case meta-fields are materialized w/in the table itself, we can just simply extract
+      // partition path from there
+      //
+      // NOTE: Helper keeps track of [[lastKnownPartitionPath]] as [[UTF8String]] to avoid
+      //       conversion from Catalyst internal representation into a [[String]]
+      return row.getUTF8String(HoodieRecord.PARTITION_PATH_META_FIELD_POS);
+    } else if (keyGeneratorOpt.isPresent()) {
+      return keyGeneratorOpt.get().getPartitionPath(row, structType);

Review Comment:
   Didn't miss it, it's actually one of the primary premises of this PR to get red of such special handling: special handling duplicates the logic across many places (key-gen, bulk-insert handler, etc), which surely enough leads to bugs induced by code getting out of sync (for ex, broken hive-style partitioning/encoding in bulk-insert path, etc).
   
   Keys/partition-path should be produced by a single SoT which in this case is the KG, and it should be done in a performant (ie engine-specific) way, and that's exactly what this PR tackles.



##########
hudi-client/hudi-spark-client/src/main/scala/org/apache/hudi/unsafe/UTF8StringBuilder.java:
##########
@@ -0,0 +1,100 @@
+/*
+ * 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.unsafe;
+
+import org.apache.spark.unsafe.Platform;
+import org.apache.spark.unsafe.array.ByteArrayMethods;
+import org.apache.spark.unsafe.types.UTF8String;
+
+/**
+ * A helper class to write {@link UTF8String}s to an internal buffer and build the concatenated
+ * {@link UTF8String} at the end.
+ */
+public class UTF8StringBuilder {
+
+  private static final int ARRAY_MAX = ByteArrayMethods.MAX_ROUNDED_ARRAY_LENGTH;
+
+  private byte[] buffer;
+  private int cursor = Platform.BYTE_ARRAY_OFFSET;
+
+  public UTF8StringBuilder() {

Review Comment:
   And it's covered by existing tests, though we don't have dedicated UTs for 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.

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 #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4b608b4a1cb022986e282c404554dd6272588606",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979",
       "triggerID" : "4b608b4a1cb022986e282c404554dd6272588606",
       "triggerType" : "PUSH"
     }, {
       "hash" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10052",
       "triggerID" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10067",
       "triggerID" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10073",
       "triggerID" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * e7a1d6a5699b8d8b759f613c751329dcb27d97b7 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10067) 
   * 567bfb97df6f9cf5630cb925ad778f0d17d4ff88 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10073) 
   
   <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 #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4b608b4a1cb022986e282c404554dd6272588606",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979",
       "triggerID" : "4b608b4a1cb022986e282c404554dd6272588606",
       "triggerType" : "PUSH"
     }, {
       "hash" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10052",
       "triggerID" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10067",
       "triggerID" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10073",
       "triggerID" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10080",
       "triggerID" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a749f666b8b5ee409cef0342532d6c90a6b71a2a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10085",
       "triggerID" : "a749f666b8b5ee409cef0342532d6c90a6b71a2a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1814b10b6bf6e3bc0fe1c483442b8637f929b2b0",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10106",
       "triggerID" : "1814b10b6bf6e3bc0fe1c483442b8637f929b2b0",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1814b10b6bf6e3bc0fe1c483442b8637f929b2b0 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10106) 
   
   <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 #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * cafc6f941ac2f13a71f80c7298b84712e93d16b8 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963) 
   * 5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966) 
   * 80e0b11c890cbb1f6bec082ed04e428772f69694 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] hudi-bot commented on pull request #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4b608b4a1cb022986e282c404554dd6272588606",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979",
       "triggerID" : "4b608b4a1cb022986e282c404554dd6272588606",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 4b608b4a1cb022986e282c404554dd6272588606 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979) 
   
   <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 #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4b608b4a1cb022986e282c404554dd6272588606",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979",
       "triggerID" : "4b608b4a1cb022986e282c404554dd6272588606",
       "triggerType" : "PUSH"
     }, {
       "hash" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10052",
       "triggerID" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10067",
       "triggerID" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10073",
       "triggerID" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10080",
       "triggerID" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a749f666b8b5ee409cef0342532d6c90a6b71a2a",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10085",
       "triggerID" : "a749f666b8b5ee409cef0342532d6c90a6b71a2a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1814b10b6bf6e3bc0fe1c483442b8637f929b2b0",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10106",
       "triggerID" : "1814b10b6bf6e3bc0fe1c483442b8637f929b2b0",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a749f666b8b5ee409cef0342532d6c90a6b71a2a Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10085) 
   * 1814b10b6bf6e3bc0fe1c483442b8637f929b2b0 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10106) 
   
   <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 #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4b608b4a1cb022986e282c404554dd6272588606",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "4b608b4a1cb022986e282c404554dd6272588606",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 80e0b11c890cbb1f6bec082ed04e428772f69694 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969) 
   * 4b608b4a1cb022986e282c404554dd6272588606 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] hudi-bot commented on pull request #5523: [WIP][HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 5a8425e8613610f85af091a9dbc8037c74b7f858 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482) 
   
   <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] vinothchandar commented on a diff in pull request #5523: [HUDI-4039] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/io/storage/row/HoodieRowCreateHandle.java:
##########
@@ -137,47 +135,59 @@ public HoodieRowCreateHandle(HoodieTable table,
    * @throws IOException
    */
   public void write(InternalRow row) throws IOException {
+    if (populateMetaFields) {
+      writeRow(row);
+    } else {
+      writeRowNoMetaFields(row);
+    }
+  }
+
+  private void writeRow(InternalRow row) {
     try {
       // NOTE: PLEASE READ THIS CAREFULLY BEFORE MODIFYING
       //       This code lays in the hot-path, and substantial caution should be
       //       exercised making changes to it to minimize amount of excessive:
-      //          - Conversions b/w Spark internal (low-level) types and JVM native ones (like
-      //         [[UTF8String]] and [[String]])
+      //          - Conversions b/w Spark internal types and JVM native ones (like [[UTF8String]]
+      //          and [[String]])
       //          - Repeated computations (for ex, converting file-path to [[UTF8String]] over and
       //          over again)
-      UTF8String recordKey = row.getUTF8String(RECORD_KEY_META_FIELD_ORD);
-
-      InternalRow updatedRow;
-      // In cases when no meta-fields need to be added we simply relay provided row to
-      // the writer as is
-      if (!populateMetaFields) {
-        updatedRow = row;
-      } else {
-        UTF8String partitionPath = row.getUTF8String(PARTITION_PATH_META_FIELD_ORD);
-        // This is the only meta-field that is generated dynamically, hence conversion b/w
-        // [[String]] and [[UTF8String]] is unavoidable
-        UTF8String seqId = UTF8String.fromString(seqIdGenerator.apply(GLOBAL_SEQ_NO.getAndIncrement()));
-
-        updatedRow = new HoodieInternalRow(commitTime, seqId, recordKey,
-            partitionPath, fileName, row, true);
-      }
+      UTF8String recordKey = row.getUTF8String(HoodieRecord.RECORD_KEY_META_FIELD_ORD);
+      UTF8String partitionPath = row.getUTF8String(HoodieRecord.PARTITION_PATH_META_FIELD_ORD);
+      // This is the only meta-field that is generated dynamically, hence conversion b/w
+      // [[String]] and [[UTF8String]] is unavoidable
+      UTF8String seqId = UTF8String.fromString(seqIdGenerator.apply(GLOBAL_SEQ_NO.getAndIncrement()));
+
+      InternalRow updatedRow = new HoodieInternalRow(commitTime, seqId, recordKey,
+          partitionPath, fileName, row, true);
 
       try {
         fileWriter.writeRow(recordKey, updatedRow);
         // NOTE: To avoid conversion on the hot-path we only convert [[UTF8String]] into [[String]]
         //       in cases when successful records' writes are being tracked
         writeStatus.markSuccess(writeStatus.isTrackingSuccessfulWrites() ? recordKey.toString() : null);
-      } catch (Throwable t) {
+      } catch (Exception t) {

Review Comment:
   why do we reduce this to Exception? Throwable can catch any unexpected runtime errors as well, right



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/io/storage/row/HoodieRowCreateHandle.java:
##########
@@ -137,47 +135,59 @@ public HoodieRowCreateHandle(HoodieTable table,
    * @throws IOException
    */
   public void write(InternalRow row) throws IOException {
+    if (populateMetaFields) {
+      writeRow(row);
+    } else {
+      writeRowNoMetaFields(row);

Review Comment:
   nit: rename to `writeRowWithoutMetaFields`



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/BuiltinKeyGenerator.java:
##########
@@ -19,132 +19,560 @@
 package org.apache.hudi.keygen;
 
 import org.apache.avro.generic.GenericRecord;
-import org.apache.hudi.ApiMaturityLevel;
 import org.apache.hudi.AvroConversionUtils;
-import org.apache.hudi.PublicAPIMethod;
+import org.apache.hudi.HoodieSparkUtils;
+import org.apache.hudi.client.utils.SparkRowSerDe;
 import org.apache.hudi.common.config.TypedProperties;
-import org.apache.hudi.common.util.collection.Pair;
+import org.apache.hudi.common.util.PartitionPathEncodeUtils;
 import org.apache.hudi.exception.HoodieException;
+import org.apache.hudi.exception.HoodieKeyException;
+import org.apache.log4j.LogManager;
+import org.apache.log4j.Logger;
+import org.apache.spark.sql.HoodieUnsafeRowUtils;
+import org.apache.spark.sql.HoodieUnsafeRowUtils$;
 import org.apache.spark.sql.Row;
 import org.apache.spark.sql.catalyst.InternalRow;
 import org.apache.spark.sql.types.DataType;
+import org.apache.spark.sql.types.DateType;
 import org.apache.spark.sql.types.StructType;
+import org.apache.spark.sql.types.TimestampType;
+import org.apache.spark.unsafe.types.UTF8String;
 import scala.Function1;
 
-import java.util.HashMap;
+import javax.annotation.concurrent.ThreadSafe;
+import java.sql.Timestamp;
+import java.time.Instant;
+import java.time.LocalDate;
 import java.util.List;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.function.Function;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+import static org.apache.hudi.common.util.CollectionUtils.tail;
+import static org.apache.hudi.common.util.ValidationUtils.checkState;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_PARTITION_PATH_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_RECORD_KEY_PARTS_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.EMPTY_RECORDKEY_PLACEHOLDER;
+import static org.apache.hudi.keygen.KeyGenUtils.HUDI_DEFAULT_PARTITION_PATH;
+import static org.apache.hudi.keygen.KeyGenUtils.NULL_RECORDKEY_PLACEHOLDER;
 
 /**
- * Base class for the built-in key generators. Contains methods structured for
- * code reuse amongst them.
+ * Base class for all built-in key generators.
+ *
+ * NOTE: By default it implements all the methods of {@link SparkKeyGeneratorInterface}, which
+ *       by default however fallback to Avro implementation. For maximum performance (to avoid
+ *       conversion from Spark's internal data-types to Avro) you should override these methods
+ *       in your implementation.
+ *
+ * TODO rename to AvroFallbackBaseKeyGenerator
  */
+@ThreadSafe
 public abstract class BuiltinKeyGenerator extends BaseKeyGenerator implements SparkKeyGeneratorInterface {
 
-  private static final String STRUCT_NAME = "hoodieRowTopLevelField";
-  private static final String NAMESPACE = "hoodieRow";
-  private Function1<Row, GenericRecord> converterFn = null;
-  private final AtomicBoolean validatePartitionFields = new AtomicBoolean(false);
-  protected StructType structType;
+  private static final Logger LOG = LogManager.getLogger(BuiltinKeyGenerator.class);
+
+  private static final String COMPOSITE_KEY_FIELD_VALUE_INFIX = ":";
+
+  protected static final UTF8String HUDI_DEFAULT_PARTITION_PATH_UTF8 = UTF8String.fromString(HUDI_DEFAULT_PARTITION_PATH);
+  protected static final UTF8String NULL_RECORD_KEY_PLACEHOLDER_UTF8 = UTF8String.fromString(NULL_RECORDKEY_PLACEHOLDER);
+  protected static final UTF8String EMPTY_RECORD_KEY_PLACEHOLDER_UTF8 = UTF8String.fromString(EMPTY_RECORDKEY_PLACEHOLDER);
+
 
-  protected Map<String, Pair<List<Integer>, DataType>> recordKeySchemaInfo = new HashMap<>();
-  protected Map<String, Pair<List<Integer>, DataType>> partitionPathSchemaInfo = new HashMap<>();
+  protected transient volatile SparkRowConverter rowConverter;
+  protected transient volatile SparkRowAccessor rowAccessor;
 
   protected BuiltinKeyGenerator(TypedProperties config) {
     super(config);
   }
 
-  /**
-   * Fetch record key from {@link Row}.
-   *
-   * @param row instance of {@link Row} from which record key is requested.
-   * @return the record key of interest from {@link Row}.
-   */
   @Override
-  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
   public String getRecordKey(Row row) {
-    // TODO avoid conversion to avro
-    //      since converterFn is transient this will be repeatedly initialized over and over again
-    if (null == converterFn) {
-      converterFn = AvroConversionUtils.createConverterToAvro(row.schema(), STRUCT_NAME, NAMESPACE);
-    }
-    return getKey(converterFn.apply(row)).getRecordKey();
+    tryInitRowConverter(row.schema());
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return getRecordKey(rowConverter.convertToAvro(row));
   }
 
   @Override
-  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
-  public String getRecordKey(InternalRow internalRow, StructType schema) {
-    try {
-      // TODO fix
-      buildFieldSchemaInfoIfNeeded(schema);
-      return RowKeyGeneratorHelper.getRecordKeyFromInternalRow(internalRow, getRecordKeyFields(), recordKeySchemaInfo, false);
-    } catch (Exception e) {
-      throw new HoodieException("Conversion of InternalRow to Row failed with exception", e);
+  public UTF8String getRecordKey(InternalRow internalRow, StructType schema) {

Review Comment:
   is this a new API change compared to 0.11.1?. if not and the return type is a breaking change, should be called out loud and clear in release notes. @codope 



##########
hudi-common/src/main/java/org/apache/hudi/common/model/HoodieRecord.java:
##########
@@ -57,9 +57,9 @@
       IntStream.range(0, HOODIE_META_COLUMNS.size()).mapToObj(idx -> Pair.of(HOODIE_META_COLUMNS.get(idx), idx))
           .collect(Collectors.toMap(Pair::getKey, Pair::getValue));
 
-  public static int RECORD_KEY_META_FIELD_POS = HOODIE_META_COLUMNS_NAME_TO_POS.get(RECORD_KEY_METADATA_FIELD);
-  public static int PARTITION_PATH_META_FIELD_POS = HOODIE_META_COLUMNS_NAME_TO_POS.get(PARTITION_PATH_METADATA_FIELD);
-  public static int FILENAME_META_FIELD_POS = HOODIE_META_COLUMNS_NAME_TO_POS.get(FILENAME_METADATA_FIELD);
+  public static int RECORD_KEY_META_FIELD_ORD = HOODIE_META_COLUMNS_NAME_TO_POS.get(RECORD_KEY_METADATA_FIELD);

Review Comment:
   -1 on these renames as well. 



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/BuiltinKeyGenerator.java:
##########
@@ -19,132 +19,560 @@
 package org.apache.hudi.keygen;
 
 import org.apache.avro.generic.GenericRecord;
-import org.apache.hudi.ApiMaturityLevel;
 import org.apache.hudi.AvroConversionUtils;
-import org.apache.hudi.PublicAPIMethod;
+import org.apache.hudi.HoodieSparkUtils;
+import org.apache.hudi.client.utils.SparkRowSerDe;
 import org.apache.hudi.common.config.TypedProperties;
-import org.apache.hudi.common.util.collection.Pair;
+import org.apache.hudi.common.util.PartitionPathEncodeUtils;
 import org.apache.hudi.exception.HoodieException;
+import org.apache.hudi.exception.HoodieKeyException;
+import org.apache.log4j.LogManager;
+import org.apache.log4j.Logger;
+import org.apache.spark.sql.HoodieUnsafeRowUtils;
+import org.apache.spark.sql.HoodieUnsafeRowUtils$;
 import org.apache.spark.sql.Row;
 import org.apache.spark.sql.catalyst.InternalRow;
 import org.apache.spark.sql.types.DataType;
+import org.apache.spark.sql.types.DateType;
 import org.apache.spark.sql.types.StructType;
+import org.apache.spark.sql.types.TimestampType;
+import org.apache.spark.unsafe.types.UTF8String;
 import scala.Function1;
 
-import java.util.HashMap;
+import javax.annotation.concurrent.ThreadSafe;
+import java.sql.Timestamp;
+import java.time.Instant;
+import java.time.LocalDate;
 import java.util.List;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.function.Function;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+import static org.apache.hudi.common.util.CollectionUtils.tail;
+import static org.apache.hudi.common.util.ValidationUtils.checkState;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_PARTITION_PATH_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_RECORD_KEY_PARTS_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.EMPTY_RECORDKEY_PLACEHOLDER;
+import static org.apache.hudi.keygen.KeyGenUtils.HUDI_DEFAULT_PARTITION_PATH;
+import static org.apache.hudi.keygen.KeyGenUtils.NULL_RECORDKEY_PLACEHOLDER;
 
 /**
- * Base class for the built-in key generators. Contains methods structured for
- * code reuse amongst them.
+ * Base class for all built-in key generators.
+ *
+ * NOTE: By default it implements all the methods of {@link SparkKeyGeneratorInterface}, which
+ *       by default however fallback to Avro implementation. For maximum performance (to avoid
+ *       conversion from Spark's internal data-types to Avro) you should override these methods
+ *       in your implementation.
+ *
+ * TODO rename to AvroFallbackBaseKeyGenerator
  */
+@ThreadSafe
 public abstract class BuiltinKeyGenerator extends BaseKeyGenerator implements SparkKeyGeneratorInterface {
 
-  private static final String STRUCT_NAME = "hoodieRowTopLevelField";
-  private static final String NAMESPACE = "hoodieRow";
-  private Function1<Row, GenericRecord> converterFn = null;
-  private final AtomicBoolean validatePartitionFields = new AtomicBoolean(false);
-  protected StructType structType;
+  private static final Logger LOG = LogManager.getLogger(BuiltinKeyGenerator.class);
+
+  private static final String COMPOSITE_KEY_FIELD_VALUE_INFIX = ":";
+
+  protected static final UTF8String HUDI_DEFAULT_PARTITION_PATH_UTF8 = UTF8String.fromString(HUDI_DEFAULT_PARTITION_PATH);
+  protected static final UTF8String NULL_RECORD_KEY_PLACEHOLDER_UTF8 = UTF8String.fromString(NULL_RECORDKEY_PLACEHOLDER);
+  protected static final UTF8String EMPTY_RECORD_KEY_PLACEHOLDER_UTF8 = UTF8String.fromString(EMPTY_RECORDKEY_PLACEHOLDER);
+
 
-  protected Map<String, Pair<List<Integer>, DataType>> recordKeySchemaInfo = new HashMap<>();
-  protected Map<String, Pair<List<Integer>, DataType>> partitionPathSchemaInfo = new HashMap<>();
+  protected transient volatile SparkRowConverter rowConverter;
+  protected transient volatile SparkRowAccessor rowAccessor;
 
   protected BuiltinKeyGenerator(TypedProperties config) {
     super(config);
   }
 
-  /**
-   * Fetch record key from {@link Row}.
-   *
-   * @param row instance of {@link Row} from which record key is requested.
-   * @return the record key of interest from {@link Row}.
-   */
   @Override
-  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
   public String getRecordKey(Row row) {
-    // TODO avoid conversion to avro
-    //      since converterFn is transient this will be repeatedly initialized over and over again
-    if (null == converterFn) {
-      converterFn = AvroConversionUtils.createConverterToAvro(row.schema(), STRUCT_NAME, NAMESPACE);
-    }
-    return getKey(converterFn.apply(row)).getRecordKey();
+    tryInitRowConverter(row.schema());
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return getRecordKey(rowConverter.convertToAvro(row));
   }
 
   @Override
-  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
-  public String getRecordKey(InternalRow internalRow, StructType schema) {
-    try {
-      // TODO fix
-      buildFieldSchemaInfoIfNeeded(schema);
-      return RowKeyGeneratorHelper.getRecordKeyFromInternalRow(internalRow, getRecordKeyFields(), recordKeySchemaInfo, false);
-    } catch (Exception e) {
-      throw new HoodieException("Conversion of InternalRow to Row failed with exception", e);
+  public UTF8String getRecordKey(InternalRow internalRow, StructType schema) {
+    tryInitRowConverter(schema);
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return UTF8String.fromString(getRecordKey(rowConverter.convertToAvro(internalRow)));
+  }
+
+  @Override
+  public String getPartitionPath(Row row) {
+    tryInitRowConverter(row.schema());
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return getPartitionPath(rowConverter.convertToAvro(row));
+  }
+
+  @Override
+  public UTF8String getPartitionPath(InternalRow internalRow, StructType schema) {
+    tryInitRowConverter(schema);
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    GenericRecord avroRecord = rowConverter.convertToAvro(internalRow);
+    return UTF8String.fromString(getPartitionPath(avroRecord));
+  }
+
+  protected void tryInitRowAccessor(StructType schema) {
+    if (this.rowAccessor == null) {
+      synchronized (this) {

Review Comment:
   Does any code path have concurrent access to key generator instance creation, which I assume calls tryInitRowAccessor()?



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/BuiltinKeyGenerator.java:
##########
@@ -19,132 +19,560 @@
 package org.apache.hudi.keygen;
 
 import org.apache.avro.generic.GenericRecord;
-import org.apache.hudi.ApiMaturityLevel;
 import org.apache.hudi.AvroConversionUtils;
-import org.apache.hudi.PublicAPIMethod;
+import org.apache.hudi.HoodieSparkUtils;
+import org.apache.hudi.client.utils.SparkRowSerDe;
 import org.apache.hudi.common.config.TypedProperties;
-import org.apache.hudi.common.util.collection.Pair;
+import org.apache.hudi.common.util.PartitionPathEncodeUtils;
 import org.apache.hudi.exception.HoodieException;
+import org.apache.hudi.exception.HoodieKeyException;
+import org.apache.log4j.LogManager;
+import org.apache.log4j.Logger;
+import org.apache.spark.sql.HoodieUnsafeRowUtils;
+import org.apache.spark.sql.HoodieUnsafeRowUtils$;
 import org.apache.spark.sql.Row;
 import org.apache.spark.sql.catalyst.InternalRow;
 import org.apache.spark.sql.types.DataType;
+import org.apache.spark.sql.types.DateType;
 import org.apache.spark.sql.types.StructType;
+import org.apache.spark.sql.types.TimestampType;
+import org.apache.spark.unsafe.types.UTF8String;
 import scala.Function1;
 
-import java.util.HashMap;
+import javax.annotation.concurrent.ThreadSafe;
+import java.sql.Timestamp;
+import java.time.Instant;
+import java.time.LocalDate;
 import java.util.List;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.function.Function;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+import static org.apache.hudi.common.util.CollectionUtils.tail;
+import static org.apache.hudi.common.util.ValidationUtils.checkState;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_PARTITION_PATH_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_RECORD_KEY_PARTS_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.EMPTY_RECORDKEY_PLACEHOLDER;
+import static org.apache.hudi.keygen.KeyGenUtils.HUDI_DEFAULT_PARTITION_PATH;
+import static org.apache.hudi.keygen.KeyGenUtils.NULL_RECORDKEY_PLACEHOLDER;
 
 /**
- * Base class for the built-in key generators. Contains methods structured for
- * code reuse amongst them.
+ * Base class for all built-in key generators.
+ *
+ * NOTE: By default it implements all the methods of {@link SparkKeyGeneratorInterface}, which
+ *       by default however fallback to Avro implementation. For maximum performance (to avoid
+ *       conversion from Spark's internal data-types to Avro) you should override these methods
+ *       in your implementation.
+ *
+ * TODO rename to AvroFallbackBaseKeyGenerator
  */
+@ThreadSafe
 public abstract class BuiltinKeyGenerator extends BaseKeyGenerator implements SparkKeyGeneratorInterface {
 
-  private static final String STRUCT_NAME = "hoodieRowTopLevelField";
-  private static final String NAMESPACE = "hoodieRow";
-  private Function1<Row, GenericRecord> converterFn = null;
-  private final AtomicBoolean validatePartitionFields = new AtomicBoolean(false);
-  protected StructType structType;
+  private static final Logger LOG = LogManager.getLogger(BuiltinKeyGenerator.class);
+
+  private static final String COMPOSITE_KEY_FIELD_VALUE_INFIX = ":";
+
+  protected static final UTF8String HUDI_DEFAULT_PARTITION_PATH_UTF8 = UTF8String.fromString(HUDI_DEFAULT_PARTITION_PATH);
+  protected static final UTF8String NULL_RECORD_KEY_PLACEHOLDER_UTF8 = UTF8String.fromString(NULL_RECORDKEY_PLACEHOLDER);
+  protected static final UTF8String EMPTY_RECORD_KEY_PLACEHOLDER_UTF8 = UTF8String.fromString(EMPTY_RECORDKEY_PLACEHOLDER);
+
 
-  protected Map<String, Pair<List<Integer>, DataType>> recordKeySchemaInfo = new HashMap<>();
-  protected Map<String, Pair<List<Integer>, DataType>> partitionPathSchemaInfo = new HashMap<>();
+  protected transient volatile SparkRowConverter rowConverter;
+  protected transient volatile SparkRowAccessor rowAccessor;
 
   protected BuiltinKeyGenerator(TypedProperties config) {
     super(config);
   }
 
-  /**
-   * Fetch record key from {@link Row}.
-   *
-   * @param row instance of {@link Row} from which record key is requested.
-   * @return the record key of interest from {@link Row}.
-   */
   @Override
-  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
   public String getRecordKey(Row row) {
-    // TODO avoid conversion to avro
-    //      since converterFn is transient this will be repeatedly initialized over and over again
-    if (null == converterFn) {
-      converterFn = AvroConversionUtils.createConverterToAvro(row.schema(), STRUCT_NAME, NAMESPACE);
-    }
-    return getKey(converterFn.apply(row)).getRecordKey();
+    tryInitRowConverter(row.schema());
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return getRecordKey(rowConverter.convertToAvro(row));
   }
 
   @Override
-  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
-  public String getRecordKey(InternalRow internalRow, StructType schema) {
-    try {
-      // TODO fix
-      buildFieldSchemaInfoIfNeeded(schema);
-      return RowKeyGeneratorHelper.getRecordKeyFromInternalRow(internalRow, getRecordKeyFields(), recordKeySchemaInfo, false);
-    } catch (Exception e) {
-      throw new HoodieException("Conversion of InternalRow to Row failed with exception", e);
+  public UTF8String getRecordKey(InternalRow internalRow, StructType schema) {
+    tryInitRowConverter(schema);
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return UTF8String.fromString(getRecordKey(rowConverter.convertToAvro(internalRow)));
+  }
+
+  @Override
+  public String getPartitionPath(Row row) {
+    tryInitRowConverter(row.schema());
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return getPartitionPath(rowConverter.convertToAvro(row));
+  }
+
+  @Override
+  public UTF8String getPartitionPath(InternalRow internalRow, StructType schema) {
+    tryInitRowConverter(schema);
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    GenericRecord avroRecord = rowConverter.convertToAvro(internalRow);
+    return UTF8String.fromString(getPartitionPath(avroRecord));
+  }
+
+  protected void tryInitRowAccessor(StructType schema) {
+    if (this.rowAccessor == null) {
+      synchronized (this) {

Review Comment:
   +1 on the pattern. We do this also in other places in hudi-common



##########
hudi-spark-datasource/hudi-spark-common/src/main/java/org/apache/hudi/internal/BulkInsertDataInternalWriterHelper.java:
##########
@@ -157,7 +152,29 @@ public List<HoodieInternalWriteStatus> getWriteStatuses() throws IOException {
     return writeStatusList;
   }
 
-  public void abort() {
+  public void abort() {}
+
+  public void close() throws IOException {
+    for (HoodieRowCreateHandle rowCreateHandle : handles.values()) {
+      writeStatusList.add(rowCreateHandle.close());
+    }
+    handles.clear();
+    handle = null;
+  }
+
+  private UTF8String extractPartitionPath(InternalRow row) {
+    if (populateMetaFields) {
+      // In case meta-fields are materialized w/in the table itself, we can just simply extract
+      // partition path from there
+      //
+      // NOTE: Helper keeps track of [[lastKnownPartitionPath]] as [[UTF8String]] to avoid
+      //       conversion from Catalyst internal representation into a [[String]]
+      return row.getUTF8String(HoodieRecord.PARTITION_PATH_META_FIELD_POS);
+    } else if (keyGeneratorOpt.isPresent()) {
+      return keyGeneratorOpt.get().getPartitionPath(row, structType);

Review Comment:
   +1 on the SoT. the if clauses across the code base are hard to maintain. IIRC that was done to avoid UDF overhead in the first place? which may not be needed anymore?
   
   That said, can you both confirm there are no perf side-effects to doing it either way?



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/CustomKeyGenerator.java:
##########
@@ -46,16 +47,27 @@
  * field in the partition path, use field1:simple 3. If you want your table to be non partitioned, simply leave it as blank.
  *
  * RecordKey is internally generated using either SimpleKeyGenerator or ComplexKeyGenerator.
+ *
+ * @deprecated
  */
+@Deprecated

Review Comment:
   Is this addressed?



##########
hudi-client/hudi-spark-client/src/main/scala/org/apache/hudi/unsafe/UTF8StringBuilder.java:
##########
@@ -0,0 +1,100 @@
+/*
+ * 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.unsafe;
+
+import org.apache.spark.unsafe.Platform;
+import org.apache.spark.unsafe.array.ByteArrayMethods;
+import org.apache.spark.unsafe.types.UTF8String;
+
+/**
+ * A helper class to write {@link UTF8String}s to an internal buffer and build the concatenated
+ * {@link UTF8String} at the end.
+ */
+public class UTF8StringBuilder {
+
+  private static final int ARRAY_MAX = ByteArrayMethods.MAX_ROUNDED_ARRAY_LENGTH;
+
+  private byte[] buffer;
+  private int cursor = Platform.BYTE_ARRAY_OFFSET;
+
+  public UTF8StringBuilder() {

Review Comment:
   lets add UTs to help maintain this longer term. and if code is re-used from another project, we need to add a reference to the NOTICE. You ll see other examples there. 



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/BuiltinKeyGenerator.java:
##########
@@ -19,132 +19,560 @@
 package org.apache.hudi.keygen;
 
 import org.apache.avro.generic.GenericRecord;
-import org.apache.hudi.ApiMaturityLevel;
 import org.apache.hudi.AvroConversionUtils;
-import org.apache.hudi.PublicAPIMethod;
+import org.apache.hudi.HoodieSparkUtils;
+import org.apache.hudi.client.utils.SparkRowSerDe;
 import org.apache.hudi.common.config.TypedProperties;
-import org.apache.hudi.common.util.collection.Pair;
+import org.apache.hudi.common.util.PartitionPathEncodeUtils;
 import org.apache.hudi.exception.HoodieException;
+import org.apache.hudi.exception.HoodieKeyException;
+import org.apache.log4j.LogManager;
+import org.apache.log4j.Logger;
+import org.apache.spark.sql.HoodieUnsafeRowUtils;
+import org.apache.spark.sql.HoodieUnsafeRowUtils$;
 import org.apache.spark.sql.Row;
 import org.apache.spark.sql.catalyst.InternalRow;
 import org.apache.spark.sql.types.DataType;
+import org.apache.spark.sql.types.DateType;
 import org.apache.spark.sql.types.StructType;
+import org.apache.spark.sql.types.TimestampType;
+import org.apache.spark.unsafe.types.UTF8String;
 import scala.Function1;
 
-import java.util.HashMap;
+import javax.annotation.concurrent.ThreadSafe;
+import java.sql.Timestamp;
+import java.time.Instant;
+import java.time.LocalDate;
 import java.util.List;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.function.Function;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+import static org.apache.hudi.common.util.CollectionUtils.tail;
+import static org.apache.hudi.common.util.ValidationUtils.checkState;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_PARTITION_PATH_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_RECORD_KEY_PARTS_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.EMPTY_RECORDKEY_PLACEHOLDER;
+import static org.apache.hudi.keygen.KeyGenUtils.HUDI_DEFAULT_PARTITION_PATH;
+import static org.apache.hudi.keygen.KeyGenUtils.NULL_RECORDKEY_PLACEHOLDER;
 
 /**
- * Base class for the built-in key generators. Contains methods structured for
- * code reuse amongst them.
+ * Base class for all built-in key generators.
+ *
+ * NOTE: By default it implements all the methods of {@link SparkKeyGeneratorInterface}, which
+ *       by default however fallback to Avro implementation. For maximum performance (to avoid
+ *       conversion from Spark's internal data-types to Avro) you should override these methods
+ *       in your implementation.
+ *
+ * TODO rename to AvroFallbackBaseKeyGenerator
  */
+@ThreadSafe
 public abstract class BuiltinKeyGenerator extends BaseKeyGenerator implements SparkKeyGeneratorInterface {
 
-  private static final String STRUCT_NAME = "hoodieRowTopLevelField";
-  private static final String NAMESPACE = "hoodieRow";
-  private Function1<Row, GenericRecord> converterFn = null;
-  private final AtomicBoolean validatePartitionFields = new AtomicBoolean(false);
-  protected StructType structType;
+  private static final Logger LOG = LogManager.getLogger(BuiltinKeyGenerator.class);
+
+  private static final String COMPOSITE_KEY_FIELD_VALUE_INFIX = ":";
+
+  protected static final UTF8String HUDI_DEFAULT_PARTITION_PATH_UTF8 = UTF8String.fromString(HUDI_DEFAULT_PARTITION_PATH);
+  protected static final UTF8String NULL_RECORD_KEY_PLACEHOLDER_UTF8 = UTF8String.fromString(NULL_RECORDKEY_PLACEHOLDER);
+  protected static final UTF8String EMPTY_RECORD_KEY_PLACEHOLDER_UTF8 = UTF8String.fromString(EMPTY_RECORDKEY_PLACEHOLDER);
+
 
-  protected Map<String, Pair<List<Integer>, DataType>> recordKeySchemaInfo = new HashMap<>();
-  protected Map<String, Pair<List<Integer>, DataType>> partitionPathSchemaInfo = new HashMap<>();
+  protected transient volatile SparkRowConverter rowConverter;
+  protected transient volatile SparkRowAccessor rowAccessor;
 
   protected BuiltinKeyGenerator(TypedProperties config) {
     super(config);
   }
 
-  /**
-   * Fetch record key from {@link Row}.
-   *
-   * @param row instance of {@link Row} from which record key is requested.
-   * @return the record key of interest from {@link Row}.
-   */
   @Override
-  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
   public String getRecordKey(Row row) {
-    // TODO avoid conversion to avro
-    //      since converterFn is transient this will be repeatedly initialized over and over again
-    if (null == converterFn) {
-      converterFn = AvroConversionUtils.createConverterToAvro(row.schema(), STRUCT_NAME, NAMESPACE);
-    }
-    return getKey(converterFn.apply(row)).getRecordKey();
+    tryInitRowConverter(row.schema());
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return getRecordKey(rowConverter.convertToAvro(row));
   }
 
   @Override
-  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
-  public String getRecordKey(InternalRow internalRow, StructType schema) {
-    try {
-      // TODO fix
-      buildFieldSchemaInfoIfNeeded(schema);
-      return RowKeyGeneratorHelper.getRecordKeyFromInternalRow(internalRow, getRecordKeyFields(), recordKeySchemaInfo, false);
-    } catch (Exception e) {
-      throw new HoodieException("Conversion of InternalRow to Row failed with exception", e);
+  public UTF8String getRecordKey(InternalRow internalRow, StructType schema) {
+    tryInitRowConverter(schema);
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return UTF8String.fromString(getRecordKey(rowConverter.convertToAvro(internalRow)));
+  }
+
+  @Override
+  public String getPartitionPath(Row row) {
+    tryInitRowConverter(row.schema());
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return getPartitionPath(rowConverter.convertToAvro(row));
+  }
+
+  @Override
+  public UTF8String getPartitionPath(InternalRow internalRow, StructType schema) {
+    tryInitRowConverter(schema);
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    GenericRecord avroRecord = rowConverter.convertToAvro(internalRow);
+    return UTF8String.fromString(getPartitionPath(avroRecord));
+  }
+
+  protected void tryInitRowAccessor(StructType schema) {
+    if (this.rowAccessor == null) {
+      synchronized (this) {
+        if (this.rowAccessor == null) {
+          this.rowAccessor = new SparkRowAccessor(schema);
+        }
+      }
     }
   }
+
   /**
-   * Fetch partition path from {@link Row}.
-   *
-   * @param row instance of {@link Row} from which partition path is requested
-   * @return the partition path of interest from {@link Row}.
+   * NOTE: This method has to stay final (so that it's easier for JIT compiler to apply certain
+   *       optimizations, like inlining)
    */
+  protected final String combinePartitionPath(Object... partitionPathParts) {
+    return combinePartitionPathInternal(
+        JavaStringBuilder::new,
+        BuiltinKeyGenerator::toString,
+        this::tryEncodePartitionPath,
+        BuiltinKeyGenerator::handleNullOrEmptyPartitionPathPart,
+        partitionPathParts
+    );
+  }
 
-  @Override
-  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
-  public String getPartitionPath(Row row) {
-    if (null == converterFn) {
-      converterFn = AvroConversionUtils.createConverterToAvro(row.schema(), STRUCT_NAME, NAMESPACE);
+  /**
+   * NOTE: This method has to stay final (so that it's easier for JIT compiler to apply certain
+   *       optimizations, like inlining)
+   */
+  protected final UTF8String combinePartitionPathUnsafe(Object... partitionPathParts) {
+    return combinePartitionPathInternal(
+        UTF8StringBuilder::new,
+        BuiltinKeyGenerator::toUTF8String,
+        this::tryEncodePartitionPathUTF8,
+        BuiltinKeyGenerator::handleNullOrEmptyPartitionPathPartUTF8,
+        partitionPathParts
+    );
+  }
+
+  /**
+   * NOTE: This method has to stay final (so that it's easier for JIT compiler to apply certain
+   *       optimizations, like inlining)
+   */
+  protected final String combineRecordKey(Object... recordKeyParts) {
+    return combineRecordKeyInternal(
+        JavaStringBuilder::new,
+        BuiltinKeyGenerator::toString,
+        BuiltinKeyGenerator::handleNullRecordKey,
+        recordKeyParts
+    );
+  }
+
+  /**
+   * NOTE: This method has to stay final (so that it's easier for JIT compiler to apply certain
+   *       optimizations, like inlining)
+   */
+  protected final UTF8String combineRecordKeyUnsafe(Object... recordKeyParts) {
+    return combineRecordKeyInternal(
+        UTF8StringBuilder::new,
+        BuiltinKeyGenerator::toUTF8String,
+        BuiltinKeyGenerator::handleNullRecordKey,
+        recordKeyParts
+    );
+  }
+
+  /**
+   * NOTE: This method has to stay final (so that it's easier for JIT compiler to apply certain
+   *       optimizations, like inlining)
+   */
+  protected final String combineCompositeRecordKey(Object... recordKeyParts) {
+    return combineCompositeRecordKeyInternal(
+        JavaStringBuilder::new,
+        BuiltinKeyGenerator::toString,
+        BuiltinKeyGenerator::handleNullOrEmptyCompositeKeyPart,
+        BuiltinKeyGenerator::isNullOrEmptyCompositeKeyPart,
+        recordKeyParts
+    );
+  }
+
+  /**
+   * NOTE: This method has to stay final (so that it's easier for JIT compiler to apply certain
+   *       optimizations, like inlining)
+   */
+  protected final UTF8String combineCompositeRecordKeyUnsafe(Object... recordKeyParts) {
+    return combineCompositeRecordKeyInternal(
+        UTF8StringBuilder::new,
+        BuiltinKeyGenerator::toUTF8String,
+        BuiltinKeyGenerator::handleNullOrEmptyCompositeKeyPartUTF8,
+        BuiltinKeyGenerator::isNullOrEmptyCompositeKeyPartUTF8,
+        recordKeyParts
+    );
+  }
+
+  private <S> S combineRecordKeyInternal(
+      Supplier<StringBuilder<S>> builderFactory,
+      Function<Object, S> converter,
+      Function<S, S> emptyKeyPartHandler,
+      Object... recordKeyParts
+  ) {
+    if (recordKeyParts.length == 1) {
+      return emptyKeyPartHandler.apply(converter.apply(recordKeyParts[0]));
     }
-    return getKey(converterFn.apply(row)).getPartitionPath();
+
+    StringBuilder<S> sb = builderFactory.get();
+    for (int i = 0; i < recordKeyParts.length; ++i) {
+      // NOTE: If record-key part has already been a string [[toString]] will be a no-op
+      sb.append(emptyKeyPartHandler.apply(converter.apply(recordKeyParts[i])));
+
+      if (i < recordKeyParts.length - 1) {
+        sb.appendJava(DEFAULT_RECORD_KEY_PARTS_SEPARATOR);
+      }
+    }
+
+    return sb.build();
+  }
+
+  private <S> S combineCompositeRecordKeyInternal(
+      Supplier<StringBuilder<S>> builderFactory,
+      Function<Object, S> converter,
+      Function<S, S> emptyKeyPartHandler,
+      Predicate<S> isNullOrEmptyKeyPartPredicate,
+      Object... recordKeyParts
+  ) {
+    boolean hasNonNullNonEmptyPart = false;
+
+    StringBuilder<S> sb = builderFactory.get();
+    for (int i = 0; i < recordKeyParts.length; ++i) {
+      // NOTE: If record-key part has already been a string [[toString]] will be a no-op
+      S convertedKeyPart = emptyKeyPartHandler.apply(converter.apply(recordKeyParts[i]));
+
+      sb.appendJava(recordKeyFields.get(i));
+      sb.appendJava(COMPOSITE_KEY_FIELD_VALUE_INFIX);
+      sb.append(convertedKeyPart);
+      // This check is to validate that overall composite-key has at least one non-null, non-empty
+      // segment
+      hasNonNullNonEmptyPart |= !isNullOrEmptyKeyPartPredicate.test(convertedKeyPart);
+
+      if (i < recordKeyParts.length - 1) {
+        sb.appendJava(DEFAULT_RECORD_KEY_PARTS_SEPARATOR);
+      }
+    }
+
+    if (hasNonNullNonEmptyPart) {
+      return sb.build();
+    } else {
+      throw new HoodieKeyException(String.format("All of the values for (%s) were either null or empty", recordKeyFields));
+    }
+  }
+
+  private <S> S combinePartitionPathInternal(Supplier<StringBuilder<S>> builderFactory,
+                                             Function<Object, S> converter,
+                                             Function<S, S> encoder,
+                                             Function<S, S> emptyHandler,
+                                             Object... partitionPathParts) {
+    checkState(partitionPathParts.length == partitionPathFields.size());
+    // Avoid creating [[StringBuilder]] in case there's just one partition-path part,
+    // and Hive-style of partitioning is not required
+    if (!hiveStylePartitioning && partitionPathParts.length == 1) {
+      return emptyHandler.apply(converter.apply(partitionPathParts[0]));
+    }
+
+    StringBuilder<S> sb = builderFactory.get();
+    for (int i = 0; i < partitionPathParts.length; ++i) {
+      S partitionPathPartStr = encoder.apply(emptyHandler.apply(converter.apply(partitionPathParts[i])));
+
+      if (hiveStylePartitioning) {
+        sb.appendJava(partitionPathFields.get(i))
+            .appendJava("=")
+            .append(partitionPathPartStr);
+      } else {
+        sb.append(partitionPathPartStr);
+      }
+
+      if (i < partitionPathParts.length - 1) {
+        sb.appendJava(DEFAULT_PARTITION_PATH_SEPARATOR);
+      }
+    }
+
+    return sb.build();
+  }
+
+  private String tryEncodePartitionPath(String partitionPathPart) {
+    return encodePartitionPath ? PartitionPathEncodeUtils.escapePathName(partitionPathPart) : partitionPathPart;
+  }
+
+  private UTF8String tryEncodePartitionPathUTF8(UTF8String partitionPathPart) {
+    // NOTE: This method avoids [[UTF8String]] to [[String]] conversion (and back) unless
+    //       partition-path encoding is enabled
+    return encodePartitionPath ? UTF8String.fromString(PartitionPathEncodeUtils.escapePathName(partitionPathPart.toString())) : partitionPathPart;
+  }
+
+  private void tryInitRowConverter(StructType structType) {
+    if (rowConverter == null) {
+      synchronized (this) {
+        if (rowConverter == null) {
+          rowConverter = new SparkRowConverter(structType);
+        }
+      }
+    }
+  }
+
+  protected static String requireNonNullNonEmptyKey(String key) {
+    if (key != null && key.length() > 0) {
+      return key;
+    } else {
+      throw new HoodieKeyException("Record key has to be non-empty string!");
+    }
+  }
+
+  protected static UTF8String requireNonNullNonEmptyKey(UTF8String key) {
+    if (key != null && key.numChars() > 0) {
+      return key;
+    } else {
+      throw new HoodieKeyException("Record key has to be non-empty string!");
+    }
+  }
+
+  protected static <S> S handleNullRecordKey(S s) {
+    if (s == null || s.toString().isEmpty()) {
+      throw new HoodieKeyException("Record key has to be non-null!");
+    }
+
+    return s;
+  }
+
+  private static UTF8String toUTF8String(Object o) {
+    if (o == null) {
+      return null;
+    } else if (o instanceof UTF8String) {
+      return (UTF8String) o;
+    } else {
+      // NOTE: If object is a [[String]], [[toString]] would be a no-op
+      return UTF8String.fromString(o.toString());
+    }
+  }
+
+  private static String toString(Object o) {
+    return o == null ? null : o.toString();
+  }
+
+  private static String handleNullOrEmptyCompositeKeyPart(Object keyPart) {
+    if (keyPart == null) {
+      return NULL_RECORDKEY_PLACEHOLDER;
+    } else {
+      // NOTE: [[toString]] is a no-op if key-part was already a [[String]]
+      String keyPartStr = keyPart.toString();
+      return !keyPartStr.isEmpty() ? keyPartStr : EMPTY_RECORDKEY_PLACEHOLDER;
+    }
+  }
+
+  private static UTF8String handleNullOrEmptyCompositeKeyPartUTF8(UTF8String keyPart) {
+    if (keyPart == null) {
+      return NULL_RECORD_KEY_PLACEHOLDER_UTF8;
+    } else if (keyPart.numChars() == 0) {
+      return EMPTY_RECORD_KEY_PLACEHOLDER_UTF8;
+    }
+
+    return keyPart;
+  }
+
+  @SuppressWarnings("StringEquality")
+  private static boolean isNullOrEmptyCompositeKeyPart(String keyPart) {
+    // NOTE: Converted key-part is compared against null/empty stub using ref-equality
+    //       for performance reasons (it relies on the fact that we're using internalized
+    //       constants)
+    return keyPart == NULL_RECORDKEY_PLACEHOLDER || keyPart == EMPTY_RECORDKEY_PLACEHOLDER;
+  }
+
+  private static boolean isNullOrEmptyCompositeKeyPartUTF8(UTF8String keyPart) {
+    // NOTE: Converted key-part is compared against null/empty stub using ref-equality
+    //       for performance reasons (it relies on the fact that we're using internalized
+    //       constants)
+    return keyPart == NULL_RECORD_KEY_PLACEHOLDER_UTF8 || keyPart == EMPTY_RECORD_KEY_PLACEHOLDER_UTF8;
+  }
+
+  private static String handleNullOrEmptyPartitionPathPart(Object partitionPathPart) {
+    if (partitionPathPart == null) {
+      return HUDI_DEFAULT_PARTITION_PATH;
+    } else {
+      // NOTE: [[toString]] is a no-op if key-part was already a [[String]]
+      String keyPartStr = partitionPathPart.toString();
+      return keyPartStr.isEmpty() ? HUDI_DEFAULT_PARTITION_PATH : keyPartStr;
+    }
+  }
+
+  private static UTF8String handleNullOrEmptyPartitionPathPartUTF8(UTF8String keyPart) {
+    if (keyPart == null || keyPart.numChars() == 0) {
+      return HUDI_DEFAULT_PARTITION_PATH_UTF8;
+    }
+
+    return keyPart;
   }
 
   /**
-   * Fetch partition path from {@link InternalRow}.
+   * Converts provided (raw) value extracted from the {@link InternalRow} object into a deserialized,
+   * JVM native format (for ex, converting {@code Long} into {@link Instant},
+   * {@code Integer} to {@link LocalDate}, etc)
+   *
+   * This method allows to avoid costly full-row deserialization sequence. Note, that this method
+   * should be maintained in sync w/
+   *
+   * <ol>
+   *   <li>{@code RowEncoder#deserializerFor}, as well as</li>
+   *   <li>{@code HoodieAvroUtils#convertValueForAvroLogicalTypes}</li>
+   * </ol>
    *
-   * @param internalRow {@link InternalRow} instance from which partition path needs to be fetched from.
-   * @param structType  schema of the internalRow.
-   * @return the partition path.
+   * @param dataType target data-type of the given value
+   * @param value target value to be converted
    */
-  @Override
-  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
-  public String getPartitionPath(InternalRow internalRow, StructType structType) {
-    try {
-      buildFieldSchemaInfoIfNeeded(structType);
-      return RowKeyGeneratorHelper.getPartitionPathFromInternalRow(internalRow, getPartitionPathFields(),
-          hiveStylePartitioning, partitionPathSchemaInfo);
-    } catch (Exception e) {
-      throw new HoodieException("Conversion of InternalRow to Row failed with exception", e);
-    }
-  }
-
-  void buildFieldSchemaInfoIfNeeded(StructType structType) {
-    if (this.structType == null) {
-      this.structType = structType;
-      getRecordKeyFields()
-          .stream().filter(f -> !f.isEmpty())
-          .forEach(f -> recordKeySchemaInfo.put(f, RowKeyGeneratorHelper.getFieldSchemaInfo(structType, f, true)));
-      if (getPartitionPathFields() != null) {
-        getPartitionPathFields().stream().filter(f -> !f.isEmpty())
-            .forEach(f -> partitionPathSchemaInfo.put(f, RowKeyGeneratorHelper.getFieldSchemaInfo(structType, f, false)));
+  private static Object convertToLogicalDataType(DataType dataType, Object value) {
+    if (value == null) {
+      return null;
+    } else if (dataType instanceof TimestampType) {
+      // Provided value have to be [[Long]] in this case, representing micros since epoch
+      return new Timestamp((Long) value / 1000);
+    } else if (dataType instanceof DateType) {
+      // Provided value have to be [[Int]] in this case
+      return LocalDate.ofEpochDay((Integer) value);
+    }
+
+    return value;
+  }
+
+  protected static class SparkRowConverter {
+    private static final String STRUCT_NAME = "hoodieRowTopLevelField";
+    private static final String NAMESPACE = "hoodieRow";
+
+    private final Function1<Row, GenericRecord> avroConverter;
+    private final SparkRowSerDe rowSerDe;
+
+    SparkRowConverter(StructType schema) {
+      this.rowSerDe = HoodieSparkUtils.getDeserializer(schema);
+      this.avroConverter = AvroConversionUtils.createConverterToAvro(schema, STRUCT_NAME, NAMESPACE);
+    }
+
+    GenericRecord convertToAvro(Row row) {
+      return avroConverter.apply(row);
+    }
+
+    GenericRecord convertToAvro(InternalRow row) {
+      return avroConverter.apply(rowSerDe.deserializeRow(row));
+    }
+  }
+
+  protected class SparkRowAccessor {

Review Comment:
   does this class have a UT?



##########
hudi-client/hudi-spark-client/src/main/scala/org/apache/hudi/unsafe/UTF8StringBuilder.java:
##########
@@ -0,0 +1,100 @@
+/*
+ * 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.unsafe;
+
+import org.apache.spark.unsafe.Platform;
+import org.apache.spark.unsafe.array.ByteArrayMethods;
+import org.apache.spark.unsafe.types.UTF8String;
+
+/**
+ * A helper class to write {@link UTF8String}s to an internal buffer and build the concatenated
+ * {@link UTF8String} at the end.
+ */
+public class UTF8StringBuilder {
+
+  private static final int ARRAY_MAX = ByteArrayMethods.MAX_ROUNDED_ARRAY_LENGTH;
+
+  private byte[] buffer;
+  private int cursor = Platform.BYTE_ARRAY_OFFSET;
+
+  public UTF8StringBuilder() {

Review Comment:
   cc @xushiyan this probably should we on the PR template checklist too. question on whether PR reuses code from another project



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/SimpleKeyGenerator.java:
##########
@@ -46,11 +46,9 @@ public SimpleKeyGenerator(TypedProperties props) {
 
   SimpleKeyGenerator(TypedProperties props, String recordKeyField, String partitionPathField) {
     super(props);
-    this.recordKeyFields = recordKeyField == null
-        ? Collections.emptyList() : Collections.singletonList(recordKeyField);
-    this.partitionPathFields = partitionPathField == null
-        ? Collections.emptyList() : Collections.singletonList(partitionPathField);
-    simpleAvroKeyGenerator = new SimpleAvroKeyGenerator(props, recordKeyField, partitionPathField);
+    this.recordKeyFields = recordKeyField == null ? Collections.emptyList() : Collections.singletonList(recordKeyField);

Review Comment:
   -1 on these code reformatting in the same PR with a large functionality change



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/io/storage/row/HoodieRowCreateHandle.java:
##########
@@ -137,47 +135,59 @@ public HoodieRowCreateHandle(HoodieTable table,
    * @throws IOException
    */
   public void write(InternalRow row) throws IOException {
+    if (populateMetaFields) {
+      writeRow(row);
+    } else {
+      writeRowNoMetaFields(row);
+    }
+  }
+
+  private void writeRow(InternalRow row) {
     try {
       // NOTE: PLEASE READ THIS CAREFULLY BEFORE MODIFYING
       //       This code lays in the hot-path, and substantial caution should be
       //       exercised making changes to it to minimize amount of excessive:
-      //          - Conversions b/w Spark internal (low-level) types and JVM native ones (like
-      //         [[UTF8String]] and [[String]])
+      //          - Conversions b/w Spark internal types and JVM native ones (like [[UTF8String]]
+      //          and [[String]])
       //          - Repeated computations (for ex, converting file-path to [[UTF8String]] over and
       //          over again)
-      UTF8String recordKey = row.getUTF8String(RECORD_KEY_META_FIELD_ORD);
-
-      InternalRow updatedRow;
-      // In cases when no meta-fields need to be added we simply relay provided row to
-      // the writer as is
-      if (!populateMetaFields) {
-        updatedRow = row;
-      } else {
-        UTF8String partitionPath = row.getUTF8String(PARTITION_PATH_META_FIELD_ORD);
-        // This is the only meta-field that is generated dynamically, hence conversion b/w
-        // [[String]] and [[UTF8String]] is unavoidable
-        UTF8String seqId = UTF8String.fromString(seqIdGenerator.apply(GLOBAL_SEQ_NO.getAndIncrement()));
-
-        updatedRow = new HoodieInternalRow(commitTime, seqId, recordKey,
-            partitionPath, fileName, row, true);
-      }
+      UTF8String recordKey = row.getUTF8String(HoodieRecord.RECORD_KEY_META_FIELD_ORD);
+      UTF8String partitionPath = row.getUTF8String(HoodieRecord.PARTITION_PATH_META_FIELD_ORD);
+      // This is the only meta-field that is generated dynamically, hence conversion b/w
+      // [[String]] and [[UTF8String]] is unavoidable
+      UTF8String seqId = UTF8String.fromString(seqIdGenerator.apply(GLOBAL_SEQ_NO.getAndIncrement()));
+
+      InternalRow updatedRow = new HoodieInternalRow(commitTime, seqId, recordKey,
+          partitionPath, fileName, row, true);
 
       try {
         fileWriter.writeRow(recordKey, updatedRow);
         // NOTE: To avoid conversion on the hot-path we only convert [[UTF8String]] into [[String]]
         //       in cases when successful records' writes are being tracked
         writeStatus.markSuccess(writeStatus.isTrackingSuccessfulWrites() ? recordKey.toString() : null);
-      } catch (Throwable t) {
+      } catch (Exception t) {

Review Comment:
   this will change the failure behavior in general for Spark writes? if yes, lets revert to old way



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/io/storage/row/HoodieRowCreateHandle.java:
##########
@@ -137,47 +135,59 @@ public HoodieRowCreateHandle(HoodieTable table,
    * @throws IOException
    */
   public void write(InternalRow row) throws IOException {
+    if (populateMetaFields) {
+      writeRow(row);
+    } else {
+      writeRowNoMetaFields(row);
+    }
+  }
+
+  private void writeRow(InternalRow row) {
     try {
       // NOTE: PLEASE READ THIS CAREFULLY BEFORE MODIFYING
       //       This code lays in the hot-path, and substantial caution should be
       //       exercised making changes to it to minimize amount of excessive:
-      //          - Conversions b/w Spark internal (low-level) types and JVM native ones (like
-      //         [[UTF8String]] and [[String]])
+      //          - Conversions b/w Spark internal types and JVM native ones (like [[UTF8String]]
+      //          and [[String]])
       //          - Repeated computations (for ex, converting file-path to [[UTF8String]] over and
       //          over again)
-      UTF8String recordKey = row.getUTF8String(RECORD_KEY_META_FIELD_ORD);
-
-      InternalRow updatedRow;
-      // In cases when no meta-fields need to be added we simply relay provided row to
-      // the writer as is
-      if (!populateMetaFields) {
-        updatedRow = row;
-      } else {
-        UTF8String partitionPath = row.getUTF8String(PARTITION_PATH_META_FIELD_ORD);
-        // This is the only meta-field that is generated dynamically, hence conversion b/w
-        // [[String]] and [[UTF8String]] is unavoidable
-        UTF8String seqId = UTF8String.fromString(seqIdGenerator.apply(GLOBAL_SEQ_NO.getAndIncrement()));
-
-        updatedRow = new HoodieInternalRow(commitTime, seqId, recordKey,
-            partitionPath, fileName, row, true);
-      }
+      UTF8String recordKey = row.getUTF8String(HoodieRecord.RECORD_KEY_META_FIELD_ORD);
+      UTF8String partitionPath = row.getUTF8String(HoodieRecord.PARTITION_PATH_META_FIELD_ORD);
+      // This is the only meta-field that is generated dynamically, hence conversion b/w
+      // [[String]] and [[UTF8String]] is unavoidable
+      UTF8String seqId = UTF8String.fromString(seqIdGenerator.apply(GLOBAL_SEQ_NO.getAndIncrement()));
+
+      InternalRow updatedRow = new HoodieInternalRow(commitTime, seqId, recordKey,
+          partitionPath, fileName, row, true);
 
       try {
         fileWriter.writeRow(recordKey, updatedRow);
         // NOTE: To avoid conversion on the hot-path we only convert [[UTF8String]] into [[String]]
         //       in cases when successful records' writes are being tracked
         writeStatus.markSuccess(writeStatus.isTrackingSuccessfulWrites() ? recordKey.toString() : null);
-      } catch (Throwable t) {
+      } catch (Exception t) {
         writeStatus.markFailure(recordKey.toString(), t);
       }
-    } catch (Throwable ge) {
-      writeStatus.setGlobalError(ge);
-      throw ge;
+    } catch (Exception e) {
+      writeStatus.setGlobalError(e);
+      throw e;
+    }
+  }
+
+  private void writeRowNoMetaFields(InternalRow row) {
+    try {
+      // TODO make sure writing w/ and w/o meta fields is consistent (currently writing w/o
+      //      meta-fields would fail if any record will, while when writing w/ meta-fields it won't)
+      fileWriter.writeRow(row);
+      writeStatus.markSuccess();
+    } catch (Exception e) {

Review Comment:
   same comment here



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/SparkKeyGeneratorInterface.java:
##########
@@ -18,20 +18,65 @@
 
 package org.apache.hudi.keygen;
 
+import org.apache.hudi.ApiMaturityLevel;
+import org.apache.hudi.PublicAPIMethod;
 import org.apache.spark.sql.Row;
 import org.apache.spark.sql.catalyst.InternalRow;
 import org.apache.spark.sql.types.StructType;
+import org.apache.spark.unsafe.types.UTF8String;
 
 /**
- * Spark key generator interface.
+ * Spark-specific {@link KeyGenerator} interface extension allowing implementation to
+ * specifically implement record-key, partition-path generation w/o the need for (expensive)
+ * conversion from Spark internal representation (for ex, to Avro)
  */
 public interface SparkKeyGeneratorInterface extends KeyGeneratorInterface {
 
+  /**
+   * Extracts record key from Spark's {@link Row}
+   *
+   * @param row instance of {@link Row} from which record-key is extracted
+   * @return record's (primary) key
+   */
+  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
   String getRecordKey(Row row);
 
-  String getRecordKey(InternalRow row, StructType schema);
+  /**
+   * Extracts record key from Spark's {@link InternalRow}
+   *
+   * NOTE: Difference b/w {@link Row} and {@link InternalRow} is that {@link InternalRow} could
+   *       internally hold just a binary representation of the data, while {@link Row} has it
+   *       deserialized into JVM-native representation (like {@code Integer}, {@code Long},
+   *       {@code String}, etc)
+   *
+   * @param row instance of {@link InternalRow} from which record-key is extracted
+   * @param schema schema {@link InternalRow} is adhering to
+   * @return record-key as instance of {@link UTF8String}
+   */
+  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
+  UTF8String getRecordKey(InternalRow row, StructType schema);
 
+  /**
+   * Extracts partition-path from {@link Row}
+   *
+   * @param row instance of {@link Row} from which partition-path is extracted
+   * @return record's partition-path
+   */
+  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
   String getPartitionPath(Row row);
 
-  String getPartitionPath(InternalRow internalRow, StructType structType);
+  /**
+   * Extracts partition-path from Spark's {@link InternalRow}
+   *
+   * NOTE: Difference b/w {@link Row} and {@link InternalRow} is that {@link InternalRow} could
+   *       internally hold just a binary representation of the data, while {@link Row} has it
+   *       deserialized into JVM-native representation (like {@code Integer}, {@code Long},
+   *       {@code String}, etc)
+   *
+   * @param row instance of {@link InternalRow} from which record-key is extracted
+   * @param schema schema {@link InternalRow} is adhering to
+   * @return partition-path as instance of {@link UTF8String}
+   */
+  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
+  UTF8String getPartitionPath(InternalRow row, StructType schema);

Review Comment:
   this is a breaking API change to be called out. cc @codope 



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/client/model/HoodieInternalRow.java:
##########
@@ -50,22 +51,27 @@ public class HoodieInternalRow extends InternalRow {
 
   /**
    * Collection of meta-fields as defined by {@link HoodieRecord#HOODIE_META_COLUMNS}
+   *
+   * NOTE: {@code HoodieInternalRow} *always* overlays its own meta-fields even in case
+   *       when source row also contains them, to make sure these fields are mutable and
+   *       can be updated (for ex, {@link UnsafeRow} doesn't support mutations due to
+   *       its memory layout, as it persists field offsets)
    */
   private final UTF8String[] metaFields;
-  private final InternalRow row;
+  private final InternalRow sourceRow;
 
   /**
-   * Specifies whether source {@link #row} contains meta-fields
+   * Specifies whether source {@link #sourceRow} contains meta-fields
    */
-  private final boolean containsMetaFields;
+  private final boolean sourceContainsMetaFields;

Review Comment:
   +1 this is already part of guidelines. https://hudi.apache.org/contribute/developer-setup#coding-guidelines next time, lets not land any PRs violating this, until resolved. 



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/BuiltinKeyGenerator.java:
##########
@@ -19,132 +19,560 @@
 package org.apache.hudi.keygen;
 
 import org.apache.avro.generic.GenericRecord;
-import org.apache.hudi.ApiMaturityLevel;
 import org.apache.hudi.AvroConversionUtils;
-import org.apache.hudi.PublicAPIMethod;
+import org.apache.hudi.HoodieSparkUtils;
+import org.apache.hudi.client.utils.SparkRowSerDe;
 import org.apache.hudi.common.config.TypedProperties;
-import org.apache.hudi.common.util.collection.Pair;
+import org.apache.hudi.common.util.PartitionPathEncodeUtils;
 import org.apache.hudi.exception.HoodieException;
+import org.apache.hudi.exception.HoodieKeyException;
+import org.apache.log4j.LogManager;
+import org.apache.log4j.Logger;
+import org.apache.spark.sql.HoodieUnsafeRowUtils;
+import org.apache.spark.sql.HoodieUnsafeRowUtils$;
 import org.apache.spark.sql.Row;
 import org.apache.spark.sql.catalyst.InternalRow;
 import org.apache.spark.sql.types.DataType;
+import org.apache.spark.sql.types.DateType;
 import org.apache.spark.sql.types.StructType;
+import org.apache.spark.sql.types.TimestampType;
+import org.apache.spark.unsafe.types.UTF8String;
 import scala.Function1;
 
-import java.util.HashMap;
+import javax.annotation.concurrent.ThreadSafe;
+import java.sql.Timestamp;
+import java.time.Instant;
+import java.time.LocalDate;
 import java.util.List;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.function.Function;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+import static org.apache.hudi.common.util.CollectionUtils.tail;
+import static org.apache.hudi.common.util.ValidationUtils.checkState;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_PARTITION_PATH_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_RECORD_KEY_PARTS_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.EMPTY_RECORDKEY_PLACEHOLDER;
+import static org.apache.hudi.keygen.KeyGenUtils.HUDI_DEFAULT_PARTITION_PATH;
+import static org.apache.hudi.keygen.KeyGenUtils.NULL_RECORDKEY_PLACEHOLDER;
 
 /**
- * Base class for the built-in key generators. Contains methods structured for
- * code reuse amongst them.
+ * Base class for all built-in key generators.
+ *
+ * NOTE: By default it implements all the methods of {@link SparkKeyGeneratorInterface}, which
+ *       by default however fallback to Avro implementation. For maximum performance (to avoid
+ *       conversion from Spark's internal data-types to Avro) you should override these methods
+ *       in your implementation.
+ *
+ * TODO rename to AvroFallbackBaseKeyGenerator
  */
+@ThreadSafe
 public abstract class BuiltinKeyGenerator extends BaseKeyGenerator implements SparkKeyGeneratorInterface {
 
-  private static final String STRUCT_NAME = "hoodieRowTopLevelField";
-  private static final String NAMESPACE = "hoodieRow";
-  private Function1<Row, GenericRecord> converterFn = null;
-  private final AtomicBoolean validatePartitionFields = new AtomicBoolean(false);
-  protected StructType structType;
+  private static final Logger LOG = LogManager.getLogger(BuiltinKeyGenerator.class);
+
+  private static final String COMPOSITE_KEY_FIELD_VALUE_INFIX = ":";
+
+  protected static final UTF8String HUDI_DEFAULT_PARTITION_PATH_UTF8 = UTF8String.fromString(HUDI_DEFAULT_PARTITION_PATH);
+  protected static final UTF8String NULL_RECORD_KEY_PLACEHOLDER_UTF8 = UTF8String.fromString(NULL_RECORDKEY_PLACEHOLDER);
+  protected static final UTF8String EMPTY_RECORD_KEY_PLACEHOLDER_UTF8 = UTF8String.fromString(EMPTY_RECORDKEY_PLACEHOLDER);
+
 
-  protected Map<String, Pair<List<Integer>, DataType>> recordKeySchemaInfo = new HashMap<>();
-  protected Map<String, Pair<List<Integer>, DataType>> partitionPathSchemaInfo = new HashMap<>();
+  protected transient volatile SparkRowConverter rowConverter;
+  protected transient volatile SparkRowAccessor rowAccessor;
 
   protected BuiltinKeyGenerator(TypedProperties config) {
     super(config);
   }
 
-  /**
-   * Fetch record key from {@link Row}.
-   *
-   * @param row instance of {@link Row} from which record key is requested.
-   * @return the record key of interest from {@link Row}.
-   */
   @Override
-  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
   public String getRecordKey(Row row) {
-    // TODO avoid conversion to avro
-    //      since converterFn is transient this will be repeatedly initialized over and over again
-    if (null == converterFn) {
-      converterFn = AvroConversionUtils.createConverterToAvro(row.schema(), STRUCT_NAME, NAMESPACE);
-    }
-    return getKey(converterFn.apply(row)).getRecordKey();
+    tryInitRowConverter(row.schema());
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return getRecordKey(rowConverter.convertToAvro(row));
   }
 
   @Override
-  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
-  public String getRecordKey(InternalRow internalRow, StructType schema) {
-    try {
-      // TODO fix
-      buildFieldSchemaInfoIfNeeded(schema);
-      return RowKeyGeneratorHelper.getRecordKeyFromInternalRow(internalRow, getRecordKeyFields(), recordKeySchemaInfo, false);
-    } catch (Exception e) {
-      throw new HoodieException("Conversion of InternalRow to Row failed with exception", e);
+  public UTF8String getRecordKey(InternalRow internalRow, StructType schema) {

Review Comment:
   cc @xushiyan Could we update PR  template to get authors to write out any breaking changes to API, or table version changes in the PR description.



-- 
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 #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/client/model/HoodieInternalRow.java:
##########
@@ -50,22 +51,27 @@ public class HoodieInternalRow extends InternalRow {
 
   /**
    * Collection of meta-fields as defined by {@link HoodieRecord#HOODIE_META_COLUMNS}
+   *
+   * NOTE: {@code HoodieInternalRow} *always* overlays its own meta-fields even in case
+   *       when source row also contains them, to make sure these fields are mutable and
+   *       can be updated (for ex, {@link UnsafeRow} doesn't support mutations due to
+   *       its memory layout, as it persists field offsets)
    */
   private final UTF8String[] metaFields;
-  private final InternalRow row;
+  private final InternalRow sourceRow;
 
   /**
-   * Specifies whether source {@link #row} contains meta-fields
+   * Specifies whether source {@link #sourceRow} contains meta-fields
    */
-  private final boolean containsMetaFields;
+  private final boolean sourceContainsMetaFields;

Review Comment:
   Are these renaming necessary in this PR?  Next time, I would prefer to have them in a separate PR to avoid reviewing overhead.



##########
hudi-kafka-connect/src/main/java/org/apache/hudi/connect/utils/KafkaConnectUtils.java:
##########
@@ -174,7 +174,9 @@ public static Configuration getDefaultHadoopConf(KafkaConnectConfigs connectConf
    * @return Returns the record key columns separated by comma.
    */
   public static String getRecordKeyColumns(KeyGenerator keyGenerator) {
-    return String.join(",", keyGenerator.getRecordKeyFieldNames());
+    return keyGenerator.getRecordKeyFieldNames().stream()
+        .map(HoodieAvroUtils::getRootLevelFieldName)

Review Comment:
   What is the reason to get root-level fields for Kafka Connect?



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/BuiltinKeyGenerator.java:
##########
@@ -19,132 +19,560 @@
 package org.apache.hudi.keygen;
 
 import org.apache.avro.generic.GenericRecord;
-import org.apache.hudi.ApiMaturityLevel;
 import org.apache.hudi.AvroConversionUtils;
-import org.apache.hudi.PublicAPIMethod;
+import org.apache.hudi.HoodieSparkUtils;
+import org.apache.hudi.client.utils.SparkRowSerDe;
 import org.apache.hudi.common.config.TypedProperties;
-import org.apache.hudi.common.util.collection.Pair;
+import org.apache.hudi.common.util.PartitionPathEncodeUtils;
 import org.apache.hudi.exception.HoodieException;
+import org.apache.hudi.exception.HoodieKeyException;
+import org.apache.log4j.LogManager;
+import org.apache.log4j.Logger;
+import org.apache.spark.sql.HoodieUnsafeRowUtils;
+import org.apache.spark.sql.HoodieUnsafeRowUtils$;
 import org.apache.spark.sql.Row;
 import org.apache.spark.sql.catalyst.InternalRow;
 import org.apache.spark.sql.types.DataType;
+import org.apache.spark.sql.types.DateType;
 import org.apache.spark.sql.types.StructType;
+import org.apache.spark.sql.types.TimestampType;
+import org.apache.spark.unsafe.types.UTF8String;
 import scala.Function1;
 
-import java.util.HashMap;
+import javax.annotation.concurrent.ThreadSafe;
+import java.sql.Timestamp;
+import java.time.Instant;
+import java.time.LocalDate;
 import java.util.List;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.function.Function;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+import static org.apache.hudi.common.util.CollectionUtils.tail;
+import static org.apache.hudi.common.util.ValidationUtils.checkState;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_PARTITION_PATH_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_RECORD_KEY_PARTS_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.EMPTY_RECORDKEY_PLACEHOLDER;
+import static org.apache.hudi.keygen.KeyGenUtils.HUDI_DEFAULT_PARTITION_PATH;
+import static org.apache.hudi.keygen.KeyGenUtils.NULL_RECORDKEY_PLACEHOLDER;
 
 /**
- * Base class for the built-in key generators. Contains methods structured for
- * code reuse amongst them.
+ * Base class for all built-in key generators.
+ *
+ * NOTE: By default it implements all the methods of {@link SparkKeyGeneratorInterface}, which
+ *       by default however fallback to Avro implementation. For maximum performance (to avoid
+ *       conversion from Spark's internal data-types to Avro) you should override these methods
+ *       in your implementation.
+ *
+ * TODO rename to AvroFallbackBaseKeyGenerator
  */
+@ThreadSafe
 public abstract class BuiltinKeyGenerator extends BaseKeyGenerator implements SparkKeyGeneratorInterface {
 
-  private static final String STRUCT_NAME = "hoodieRowTopLevelField";
-  private static final String NAMESPACE = "hoodieRow";
-  private Function1<Row, GenericRecord> converterFn = null;
-  private final AtomicBoolean validatePartitionFields = new AtomicBoolean(false);
-  protected StructType structType;
+  private static final Logger LOG = LogManager.getLogger(BuiltinKeyGenerator.class);
+
+  private static final String COMPOSITE_KEY_FIELD_VALUE_INFIX = ":";
+
+  protected static final UTF8String HUDI_DEFAULT_PARTITION_PATH_UTF8 = UTF8String.fromString(HUDI_DEFAULT_PARTITION_PATH);
+  protected static final UTF8String NULL_RECORD_KEY_PLACEHOLDER_UTF8 = UTF8String.fromString(NULL_RECORDKEY_PLACEHOLDER);
+  protected static final UTF8String EMPTY_RECORD_KEY_PLACEHOLDER_UTF8 = UTF8String.fromString(EMPTY_RECORDKEY_PLACEHOLDER);
+
 
-  protected Map<String, Pair<List<Integer>, DataType>> recordKeySchemaInfo = new HashMap<>();
-  protected Map<String, Pair<List<Integer>, DataType>> partitionPathSchemaInfo = new HashMap<>();
+  protected transient volatile SparkRowConverter rowConverter;
+  protected transient volatile SparkRowAccessor rowAccessor;
 
   protected BuiltinKeyGenerator(TypedProperties config) {
     super(config);
   }
 
-  /**
-   * Fetch record key from {@link Row}.
-   *
-   * @param row instance of {@link Row} from which record key is requested.
-   * @return the record key of interest from {@link Row}.
-   */
   @Override
-  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
   public String getRecordKey(Row row) {
-    // TODO avoid conversion to avro
-    //      since converterFn is transient this will be repeatedly initialized over and over again
-    if (null == converterFn) {
-      converterFn = AvroConversionUtils.createConverterToAvro(row.schema(), STRUCT_NAME, NAMESPACE);
-    }
-    return getKey(converterFn.apply(row)).getRecordKey();
+    tryInitRowConverter(row.schema());
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return getRecordKey(rowConverter.convertToAvro(row));
   }
 
   @Override
-  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
-  public String getRecordKey(InternalRow internalRow, StructType schema) {
-    try {
-      // TODO fix
-      buildFieldSchemaInfoIfNeeded(schema);
-      return RowKeyGeneratorHelper.getRecordKeyFromInternalRow(internalRow, getRecordKeyFields(), recordKeySchemaInfo, false);
-    } catch (Exception e) {
-      throw new HoodieException("Conversion of InternalRow to Row failed with exception", e);
+  public UTF8String getRecordKey(InternalRow internalRow, StructType schema) {
+    tryInitRowConverter(schema);
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return UTF8String.fromString(getRecordKey(rowConverter.convertToAvro(internalRow)));
+  }
+
+  @Override
+  public String getPartitionPath(Row row) {
+    tryInitRowConverter(row.schema());
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return getPartitionPath(rowConverter.convertToAvro(row));
+  }
+
+  @Override
+  public UTF8String getPartitionPath(InternalRow internalRow, StructType schema) {
+    tryInitRowConverter(schema);
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    GenericRecord avroRecord = rowConverter.convertToAvro(internalRow);
+    return UTF8String.fromString(getPartitionPath(avroRecord));
+  }
+
+  protected void tryInitRowAccessor(StructType schema) {
+    if (this.rowAccessor == null) {
+      synchronized (this) {
+        if (this.rowAccessor == null) {
+          this.rowAccessor = new SparkRowAccessor(schema);
+        }
+      }
     }
   }
+
   /**
-   * Fetch partition path from {@link Row}.
-   *
-   * @param row instance of {@link Row} from which partition path is requested
-   * @return the partition path of interest from {@link Row}.
+   * NOTE: This method has to stay final (so that it's easier for JIT compiler to apply certain
+   *       optimizations, like inlining)
    */
+  protected final String combinePartitionPath(Object... partitionPathParts) {

Review Comment:
   Should these util methods be static?



##########
hudi-common/src/main/java/org/apache/hudi/common/util/HoodieTimer.java:
##########
@@ -79,4 +83,12 @@ public long endTimer() {
     }
     return timeInfoDeque.pop().stop();
   }
+
+  public static HoodieTimer start() {

Review Comment:
   +1



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/io/storage/row/HoodieInternalRowFileWriterFactory.java:
##########
@@ -42,32 +41,34 @@ public class HoodieInternalRowFileWriterFactory {
    * Factory method to assist in instantiating an instance of {@link HoodieInternalRowFileWriter}.
    * @param path path of the RowFileWriter.
    * @param hoodieTable instance of {@link HoodieTable} in use.
-   * @param config instance of {@link HoodieWriteConfig} to use.
+   * @param writeConfig instance of {@link HoodieWriteConfig} to use.
    * @param schema schema of the dataset in use.
    * @return the instantiated {@link HoodieInternalRowFileWriter}.
    * @throws IOException if format is not supported or if any exception during instantiating the RowFileWriter.
    *
    */
-  public static HoodieInternalRowFileWriter getInternalRowFileWriter(
-      Path path, HoodieTable hoodieTable, HoodieWriteConfig config, StructType schema)
+  public static HoodieInternalRowFileWriter getInternalRowFileWriter(Path path,
+                                                                     HoodieTable hoodieTable,
+                                                                     HoodieWriteConfig writeConfig,
+                                                                     StructType schema)
       throws IOException {
     final String extension = FSUtils.getFileExtension(path.getName());
     if (PARQUET.getFileExtension().equals(extension)) {
-      return newParquetInternalRowFileWriter(path, config, schema, hoodieTable);
+      return newParquetInternalRowFileWriter(path, hoodieTable, writeConfig, schema, tryInstantiateBloomFilter(writeConfig));
     }
     throw new UnsupportedOperationException(extension + " format not supported yet.");
   }
 
-  private static HoodieInternalRowFileWriter newParquetInternalRowFileWriter(
-      Path path, HoodieWriteConfig writeConfig, StructType structType, HoodieTable table)
+  private static HoodieInternalRowFileWriter newParquetInternalRowFileWriter(Path path,
+                                                                             HoodieTable table,
+                                                                             HoodieWriteConfig writeConfig,
+                                                                             StructType structType,
+                                                                             Option<BloomFilter> bloomFilterOpt
+  )
       throws IOException {
-    BloomFilter filter = BloomFilterFactory.createBloomFilter(
-            writeConfig.getBloomFilterNumEntries(),
-            writeConfig.getBloomFilterFPP(),
-            writeConfig.getDynamicBloomFilterMaxNumEntries(),
-            writeConfig.getBloomFilterType());

Review Comment:
   Why not try to instantiate the bloom filter here instead since write config is passed in, to avoid unnecessary changes?



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/SparkKeyGeneratorInterface.java:
##########
@@ -18,20 +18,65 @@
 
 package org.apache.hudi.keygen;
 
+import org.apache.hudi.ApiMaturityLevel;
+import org.apache.hudi.PublicAPIMethod;
 import org.apache.spark.sql.Row;
 import org.apache.spark.sql.catalyst.InternalRow;
 import org.apache.spark.sql.types.StructType;
+import org.apache.spark.unsafe.types.UTF8String;
 
 /**
- * Spark key generator interface.
+ * Spark-specific {@link KeyGenerator} interface extension allowing implementation to
+ * specifically implement record-key, partition-path generation w/o the need for (expensive)
+ * conversion from Spark internal representation (for ex, to Avro)
  */
 public interface SparkKeyGeneratorInterface extends KeyGeneratorInterface {
 
+  /**
+   * Extracts record key from Spark's {@link Row}
+   *
+   * @param row instance of {@link Row} from which record-key is extracted
+   * @return record's (primary) key
+   */
+  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
   String getRecordKey(Row row);
 
-  String getRecordKey(InternalRow row, StructType schema);
+  /**
+   * Extracts record key from Spark's {@link InternalRow}
+   *
+   * NOTE: Difference b/w {@link Row} and {@link InternalRow} is that {@link InternalRow} could
+   *       internally hold just a binary representation of the data, while {@link Row} has it
+   *       deserialized into JVM-native representation (like {@code Integer}, {@code Long},
+   *       {@code String}, etc)
+   *
+   * @param row instance of {@link InternalRow} from which record-key is extracted
+   * @param schema schema {@link InternalRow} is adhering to
+   * @return record-key as instance of {@link UTF8String}
+   */
+  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
+  UTF8String getRecordKey(InternalRow row, StructType schema);

Review Comment:
   We need to call out breaking public API changes in release notes and docs (in this case the changes are unavoidable).  @alexeykudinkin could you create a Jira ticket for that?  cc @codope @xushiyan 



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/BuiltinKeyGenerator.java:
##########
@@ -19,132 +19,560 @@
 package org.apache.hudi.keygen;
 
 import org.apache.avro.generic.GenericRecord;
-import org.apache.hudi.ApiMaturityLevel;
 import org.apache.hudi.AvroConversionUtils;
-import org.apache.hudi.PublicAPIMethod;
+import org.apache.hudi.HoodieSparkUtils;
+import org.apache.hudi.client.utils.SparkRowSerDe;
 import org.apache.hudi.common.config.TypedProperties;
-import org.apache.hudi.common.util.collection.Pair;
+import org.apache.hudi.common.util.PartitionPathEncodeUtils;
 import org.apache.hudi.exception.HoodieException;
+import org.apache.hudi.exception.HoodieKeyException;
+import org.apache.log4j.LogManager;
+import org.apache.log4j.Logger;
+import org.apache.spark.sql.HoodieUnsafeRowUtils;
+import org.apache.spark.sql.HoodieUnsafeRowUtils$;
 import org.apache.spark.sql.Row;
 import org.apache.spark.sql.catalyst.InternalRow;
 import org.apache.spark.sql.types.DataType;
+import org.apache.spark.sql.types.DateType;
 import org.apache.spark.sql.types.StructType;
+import org.apache.spark.sql.types.TimestampType;
+import org.apache.spark.unsafe.types.UTF8String;
 import scala.Function1;
 
-import java.util.HashMap;
+import javax.annotation.concurrent.ThreadSafe;
+import java.sql.Timestamp;
+import java.time.Instant;
+import java.time.LocalDate;
 import java.util.List;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.function.Function;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+import static org.apache.hudi.common.util.CollectionUtils.tail;
+import static org.apache.hudi.common.util.ValidationUtils.checkState;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_PARTITION_PATH_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_RECORD_KEY_PARTS_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.EMPTY_RECORDKEY_PLACEHOLDER;
+import static org.apache.hudi.keygen.KeyGenUtils.HUDI_DEFAULT_PARTITION_PATH;
+import static org.apache.hudi.keygen.KeyGenUtils.NULL_RECORDKEY_PLACEHOLDER;
 
 /**
- * Base class for the built-in key generators. Contains methods structured for
- * code reuse amongst them.
+ * Base class for all built-in key generators.
+ *
+ * NOTE: By default it implements all the methods of {@link SparkKeyGeneratorInterface}, which
+ *       by default however fallback to Avro implementation. For maximum performance (to avoid
+ *       conversion from Spark's internal data-types to Avro) you should override these methods
+ *       in your implementation.
+ *
+ * TODO rename to AvroFallbackBaseKeyGenerator
  */
+@ThreadSafe
 public abstract class BuiltinKeyGenerator extends BaseKeyGenerator implements SparkKeyGeneratorInterface {
 
-  private static final String STRUCT_NAME = "hoodieRowTopLevelField";
-  private static final String NAMESPACE = "hoodieRow";
-  private Function1<Row, GenericRecord> converterFn = null;
-  private final AtomicBoolean validatePartitionFields = new AtomicBoolean(false);
-  protected StructType structType;
+  private static final Logger LOG = LogManager.getLogger(BuiltinKeyGenerator.class);
+
+  private static final String COMPOSITE_KEY_FIELD_VALUE_INFIX = ":";
+
+  protected static final UTF8String HUDI_DEFAULT_PARTITION_PATH_UTF8 = UTF8String.fromString(HUDI_DEFAULT_PARTITION_PATH);
+  protected static final UTF8String NULL_RECORD_KEY_PLACEHOLDER_UTF8 = UTF8String.fromString(NULL_RECORDKEY_PLACEHOLDER);
+  protected static final UTF8String EMPTY_RECORD_KEY_PLACEHOLDER_UTF8 = UTF8String.fromString(EMPTY_RECORDKEY_PLACEHOLDER);
+
 
-  protected Map<String, Pair<List<Integer>, DataType>> recordKeySchemaInfo = new HashMap<>();
-  protected Map<String, Pair<List<Integer>, DataType>> partitionPathSchemaInfo = new HashMap<>();
+  protected transient volatile SparkRowConverter rowConverter;
+  protected transient volatile SparkRowAccessor rowAccessor;
 
   protected BuiltinKeyGenerator(TypedProperties config) {
     super(config);
   }
 
-  /**
-   * Fetch record key from {@link Row}.
-   *
-   * @param row instance of {@link Row} from which record key is requested.
-   * @return the record key of interest from {@link Row}.
-   */
   @Override
-  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)

Review Comment:
   Why removing the annotation?  already reflected in the interface?



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/BuiltinKeyGenerator.java:
##########
@@ -19,132 +19,560 @@
 package org.apache.hudi.keygen;
 
 import org.apache.avro.generic.GenericRecord;
-import org.apache.hudi.ApiMaturityLevel;
 import org.apache.hudi.AvroConversionUtils;
-import org.apache.hudi.PublicAPIMethod;
+import org.apache.hudi.HoodieSparkUtils;
+import org.apache.hudi.client.utils.SparkRowSerDe;
 import org.apache.hudi.common.config.TypedProperties;
-import org.apache.hudi.common.util.collection.Pair;
+import org.apache.hudi.common.util.PartitionPathEncodeUtils;
 import org.apache.hudi.exception.HoodieException;
+import org.apache.hudi.exception.HoodieKeyException;
+import org.apache.log4j.LogManager;
+import org.apache.log4j.Logger;
+import org.apache.spark.sql.HoodieUnsafeRowUtils;
+import org.apache.spark.sql.HoodieUnsafeRowUtils$;
 import org.apache.spark.sql.Row;
 import org.apache.spark.sql.catalyst.InternalRow;
 import org.apache.spark.sql.types.DataType;
+import org.apache.spark.sql.types.DateType;
 import org.apache.spark.sql.types.StructType;
+import org.apache.spark.sql.types.TimestampType;
+import org.apache.spark.unsafe.types.UTF8String;
 import scala.Function1;
 
-import java.util.HashMap;
+import javax.annotation.concurrent.ThreadSafe;
+import java.sql.Timestamp;
+import java.time.Instant;
+import java.time.LocalDate;
 import java.util.List;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.function.Function;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+import static org.apache.hudi.common.util.CollectionUtils.tail;
+import static org.apache.hudi.common.util.ValidationUtils.checkState;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_PARTITION_PATH_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_RECORD_KEY_PARTS_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.EMPTY_RECORDKEY_PLACEHOLDER;
+import static org.apache.hudi.keygen.KeyGenUtils.HUDI_DEFAULT_PARTITION_PATH;
+import static org.apache.hudi.keygen.KeyGenUtils.NULL_RECORDKEY_PLACEHOLDER;
 
 /**
- * Base class for the built-in key generators. Contains methods structured for
- * code reuse amongst them.
+ * Base class for all built-in key generators.
+ *
+ * NOTE: By default it implements all the methods of {@link SparkKeyGeneratorInterface}, which
+ *       by default however fallback to Avro implementation. For maximum performance (to avoid
+ *       conversion from Spark's internal data-types to Avro) you should override these methods
+ *       in your implementation.
+ *
+ * TODO rename to AvroFallbackBaseKeyGenerator
  */
+@ThreadSafe
 public abstract class BuiltinKeyGenerator extends BaseKeyGenerator implements SparkKeyGeneratorInterface {
 
-  private static final String STRUCT_NAME = "hoodieRowTopLevelField";
-  private static final String NAMESPACE = "hoodieRow";
-  private Function1<Row, GenericRecord> converterFn = null;
-  private final AtomicBoolean validatePartitionFields = new AtomicBoolean(false);
-  protected StructType structType;
+  private static final Logger LOG = LogManager.getLogger(BuiltinKeyGenerator.class);
+
+  private static final String COMPOSITE_KEY_FIELD_VALUE_INFIX = ":";
+
+  protected static final UTF8String HUDI_DEFAULT_PARTITION_PATH_UTF8 = UTF8String.fromString(HUDI_DEFAULT_PARTITION_PATH);
+  protected static final UTF8String NULL_RECORD_KEY_PLACEHOLDER_UTF8 = UTF8String.fromString(NULL_RECORDKEY_PLACEHOLDER);
+  protected static final UTF8String EMPTY_RECORD_KEY_PLACEHOLDER_UTF8 = UTF8String.fromString(EMPTY_RECORDKEY_PLACEHOLDER);
+
 
-  protected Map<String, Pair<List<Integer>, DataType>> recordKeySchemaInfo = new HashMap<>();
-  protected Map<String, Pair<List<Integer>, DataType>> partitionPathSchemaInfo = new HashMap<>();
+  protected transient volatile SparkRowConverter rowConverter;
+  protected transient volatile SparkRowAccessor rowAccessor;
 
   protected BuiltinKeyGenerator(TypedProperties config) {
     super(config);
   }
 
-  /**
-   * Fetch record key from {@link Row}.
-   *
-   * @param row instance of {@link Row} from which record key is requested.
-   * @return the record key of interest from {@link Row}.
-   */
   @Override
-  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
   public String getRecordKey(Row row) {
-    // TODO avoid conversion to avro
-    //      since converterFn is transient this will be repeatedly initialized over and over again
-    if (null == converterFn) {
-      converterFn = AvroConversionUtils.createConverterToAvro(row.schema(), STRUCT_NAME, NAMESPACE);
-    }
-    return getKey(converterFn.apply(row)).getRecordKey();
+    tryInitRowConverter(row.schema());
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return getRecordKey(rowConverter.convertToAvro(row));
   }
 
   @Override
-  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
-  public String getRecordKey(InternalRow internalRow, StructType schema) {
-    try {
-      // TODO fix
-      buildFieldSchemaInfoIfNeeded(schema);
-      return RowKeyGeneratorHelper.getRecordKeyFromInternalRow(internalRow, getRecordKeyFields(), recordKeySchemaInfo, false);
-    } catch (Exception e) {
-      throw new HoodieException("Conversion of InternalRow to Row failed with exception", e);
+  public UTF8String getRecordKey(InternalRow internalRow, StructType schema) {
+    tryInitRowConverter(schema);
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return UTF8String.fromString(getRecordKey(rowConverter.convertToAvro(internalRow)));
+  }
+
+  @Override
+  public String getPartitionPath(Row row) {
+    tryInitRowConverter(row.schema());
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return getPartitionPath(rowConverter.convertToAvro(row));
+  }
+
+  @Override
+  public UTF8String getPartitionPath(InternalRow internalRow, StructType schema) {
+    tryInitRowConverter(schema);
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    GenericRecord avroRecord = rowConverter.convertToAvro(internalRow);
+    return UTF8String.fromString(getPartitionPath(avroRecord));
+  }
+
+  protected void tryInitRowAccessor(StructType schema) {
+    if (this.rowAccessor == null) {
+      synchronized (this) {

Review Comment:
   Should the order be the opposite, i.e., first lock then check and assign?  Otherwise, in a slight chance, the `rowAccessor` is going to be assigned twice.



-- 
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 #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4b608b4a1cb022986e282c404554dd6272588606",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979",
       "triggerID" : "4b608b4a1cb022986e282c404554dd6272588606",
       "triggerType" : "PUSH"
     }, {
       "hash" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10052",
       "triggerID" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10067",
       "triggerID" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * e7a1d6a5699b8d8b759f613c751329dcb27d97b7 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10067) 
   
   <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 commented on a diff in pull request #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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


##########
hudi-kafka-connect/src/main/java/org/apache/hudi/connect/utils/KafkaConnectUtils.java:
##########
@@ -174,7 +174,9 @@ public static Configuration getDefaultHadoopConf(KafkaConnectConfigs connectConf
    * @return Returns the record key columns separated by comma.
    */
   public static String getRecordKeyColumns(KeyGenerator keyGenerator) {
-    return String.join(",", keyGenerator.getRecordKeyFieldNames());
+    return keyGenerator.getRecordKeyFieldNames().stream()
+        .map(HoodieAvroUtils::getRootLevelFieldName)

Review Comment:
   Got 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.

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 #5523: [HUDI-4039] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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


-- 
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] alexeykudinkin commented on a diff in pull request #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/BuiltinKeyGenerator.java:
##########
@@ -19,132 +19,560 @@
 package org.apache.hudi.keygen;
 
 import org.apache.avro.generic.GenericRecord;
-import org.apache.hudi.ApiMaturityLevel;
 import org.apache.hudi.AvroConversionUtils;
-import org.apache.hudi.PublicAPIMethod;
+import org.apache.hudi.HoodieSparkUtils;
+import org.apache.hudi.client.utils.SparkRowSerDe;
 import org.apache.hudi.common.config.TypedProperties;
-import org.apache.hudi.common.util.collection.Pair;
+import org.apache.hudi.common.util.PartitionPathEncodeUtils;
 import org.apache.hudi.exception.HoodieException;
+import org.apache.hudi.exception.HoodieKeyException;
+import org.apache.log4j.LogManager;
+import org.apache.log4j.Logger;
+import org.apache.spark.sql.HoodieUnsafeRowUtils;
+import org.apache.spark.sql.HoodieUnsafeRowUtils$;
 import org.apache.spark.sql.Row;
 import org.apache.spark.sql.catalyst.InternalRow;
 import org.apache.spark.sql.types.DataType;
+import org.apache.spark.sql.types.DateType;
 import org.apache.spark.sql.types.StructType;
+import org.apache.spark.sql.types.TimestampType;
+import org.apache.spark.unsafe.types.UTF8String;
 import scala.Function1;
 
-import java.util.HashMap;
+import javax.annotation.concurrent.ThreadSafe;
+import java.sql.Timestamp;
+import java.time.Instant;
+import java.time.LocalDate;
 import java.util.List;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.function.Function;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+import static org.apache.hudi.common.util.CollectionUtils.tail;
+import static org.apache.hudi.common.util.ValidationUtils.checkState;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_PARTITION_PATH_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_RECORD_KEY_PARTS_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.EMPTY_RECORDKEY_PLACEHOLDER;
+import static org.apache.hudi.keygen.KeyGenUtils.HUDI_DEFAULT_PARTITION_PATH;
+import static org.apache.hudi.keygen.KeyGenUtils.NULL_RECORDKEY_PLACEHOLDER;
 
 /**
- * Base class for the built-in key generators. Contains methods structured for
- * code reuse amongst them.
+ * Base class for all built-in key generators.
+ *
+ * NOTE: By default it implements all the methods of {@link SparkKeyGeneratorInterface}, which
+ *       by default however fallback to Avro implementation. For maximum performance (to avoid
+ *       conversion from Spark's internal data-types to Avro) you should override these methods
+ *       in your implementation.
+ *
+ * TODO rename to AvroFallbackBaseKeyGenerator
  */
+@ThreadSafe
 public abstract class BuiltinKeyGenerator extends BaseKeyGenerator implements SparkKeyGeneratorInterface {
 
-  private static final String STRUCT_NAME = "hoodieRowTopLevelField";
-  private static final String NAMESPACE = "hoodieRow";
-  private Function1<Row, GenericRecord> converterFn = null;
-  private final AtomicBoolean validatePartitionFields = new AtomicBoolean(false);
-  protected StructType structType;
+  private static final Logger LOG = LogManager.getLogger(BuiltinKeyGenerator.class);
+
+  private static final String COMPOSITE_KEY_FIELD_VALUE_INFIX = ":";
+
+  protected static final UTF8String HUDI_DEFAULT_PARTITION_PATH_UTF8 = UTF8String.fromString(HUDI_DEFAULT_PARTITION_PATH);
+  protected static final UTF8String NULL_RECORD_KEY_PLACEHOLDER_UTF8 = UTF8String.fromString(NULL_RECORDKEY_PLACEHOLDER);
+  protected static final UTF8String EMPTY_RECORD_KEY_PLACEHOLDER_UTF8 = UTF8String.fromString(EMPTY_RECORDKEY_PLACEHOLDER);
+
 
-  protected Map<String, Pair<List<Integer>, DataType>> recordKeySchemaInfo = new HashMap<>();
-  protected Map<String, Pair<List<Integer>, DataType>> partitionPathSchemaInfo = new HashMap<>();
+  protected transient volatile SparkRowConverter rowConverter;
+  protected transient volatile SparkRowAccessor rowAccessor;
 
   protected BuiltinKeyGenerator(TypedProperties config) {
     super(config);
   }
 
-  /**
-   * Fetch record key from {@link Row}.
-   *
-   * @param row instance of {@link Row} from which record key is requested.
-   * @return the record key of interest from {@link Row}.
-   */
   @Override
-  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)

Review Comment:
   Correct. Should just be part of the interface not impl



-- 
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 #5523: [WIP][HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 5a8425e8613610f85af091a9dbc8037c74b7f858 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] hudi-bot commented on pull request #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * cafc6f941ac2f13a71f80c7298b84712e93d16b8 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963) 
   * 5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2 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] hudi-bot commented on pull request #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4b608b4a1cb022986e282c404554dd6272588606",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979",
       "triggerID" : "4b608b4a1cb022986e282c404554dd6272588606",
       "triggerType" : "PUSH"
     }, {
       "hash" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10052",
       "triggerID" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10067",
       "triggerID" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10073",
       "triggerID" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 567bfb97df6f9cf5630cb925ad778f0d17d4ff88 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10073) 
   
   <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 #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4b608b4a1cb022986e282c404554dd6272588606",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979",
       "triggerID" : "4b608b4a1cb022986e282c404554dd6272588606",
       "triggerType" : "PUSH"
     }, {
       "hash" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10052",
       "triggerID" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10067",
       "triggerID" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10073",
       "triggerID" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 567bfb97df6f9cf5630cb925ad778f0d17d4ff88 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10073) 
   * c7faef9c1c5f12303cd94c51ff4e6fe71473c16f 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] hudi-bot commented on pull request #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4b608b4a1cb022986e282c404554dd6272588606",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979",
       "triggerID" : "4b608b4a1cb022986e282c404554dd6272588606",
       "triggerType" : "PUSH"
     }, {
       "hash" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10052",
       "triggerID" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10067",
       "triggerID" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 53f3b3f251e59d9d1d83a0d0f25589748a53d299 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10052) 
   * e7a1d6a5699b8d8b759f613c751329dcb27d97b7 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10067) 
   
   <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 #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4b608b4a1cb022986e282c404554dd6272588606",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979",
       "triggerID" : "4b608b4a1cb022986e282c404554dd6272588606",
       "triggerType" : "PUSH"
     }, {
       "hash" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10052",
       "triggerID" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10067",
       "triggerID" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10073",
       "triggerID" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10080",
       "triggerID" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a749f666b8b5ee409cef0342532d6c90a6b71a2a",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10085",
       "triggerID" : "a749f666b8b5ee409cef0342532d6c90a6b71a2a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c7faef9c1c5f12303cd94c51ff4e6fe71473c16f Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10080) 
   * a749f666b8b5ee409cef0342532d6c90a6b71a2a Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10085) 
   
   <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 commented on pull request #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   IT failure is not related.  Landing this PR.


-- 
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 #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4b608b4a1cb022986e282c404554dd6272588606",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979",
       "triggerID" : "4b608b4a1cb022986e282c404554dd6272588606",
       "triggerType" : "PUSH"
     }, {
       "hash" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10052",
       "triggerID" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10067",
       "triggerID" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10073",
       "triggerID" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10080",
       "triggerID" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a749f666b8b5ee409cef0342532d6c90a6b71a2a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10085",
       "triggerID" : "a749f666b8b5ee409cef0342532d6c90a6b71a2a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1814b10b6bf6e3bc0fe1c483442b8637f929b2b0",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10106",
       "triggerID" : "1814b10b6bf6e3bc0fe1c483442b8637f929b2b0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bd922449d1756895a5e1cd8c3c85e33fcc3dd809",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10150",
       "triggerID" : "bd922449d1756895a5e1cd8c3c85e33fcc3dd809",
       "triggerType" : "PUSH"
     }, {
       "hash" : "24da4bb8af969e5c0706c91eb4ae5e64ecb5d1dc",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "24da4bb8af969e5c0706c91eb4ae5e64ecb5d1dc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "dbaafef2a8cfe013976422897ddd18bf0038a7dc",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10176",
       "triggerID" : "dbaafef2a8cfe013976422897ddd18bf0038a7dc",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * bd922449d1756895a5e1cd8c3c85e33fcc3dd809 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10150) 
   * 24da4bb8af969e5c0706c91eb4ae5e64ecb5d1dc UNKNOWN
   * dbaafef2a8cfe013976422897ddd18bf0038a7dc Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10176) 
   
   <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 #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966) 
   * 80e0b11c890cbb1f6bec082ed04e428772f69694 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969) 
   
   <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 #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4b608b4a1cb022986e282c404554dd6272588606",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979",
       "triggerID" : "4b608b4a1cb022986e282c404554dd6272588606",
       "triggerType" : "PUSH"
     }, {
       "hash" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10052",
       "triggerID" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 53f3b3f251e59d9d1d83a0d0f25589748a53d299 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10052) 
   
   <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 #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4b608b4a1cb022986e282c404554dd6272588606",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979",
       "triggerID" : "4b608b4a1cb022986e282c404554dd6272588606",
       "triggerType" : "PUSH"
     }, {
       "hash" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10052",
       "triggerID" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 53f3b3f251e59d9d1d83a0d0f25589748a53d299 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10052) 
   * e7a1d6a5699b8d8b759f613c751329dcb27d97b7 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] hudi-bot commented on pull request #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4b608b4a1cb022986e282c404554dd6272588606",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979",
       "triggerID" : "4b608b4a1cb022986e282c404554dd6272588606",
       "triggerType" : "PUSH"
     }, {
       "hash" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10052",
       "triggerID" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10067",
       "triggerID" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10073",
       "triggerID" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10080",
       "triggerID" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c7faef9c1c5f12303cd94c51ff4e6fe71473c16f Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10080) 
   
   <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 #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4b608b4a1cb022986e282c404554dd6272588606",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979",
       "triggerID" : "4b608b4a1cb022986e282c404554dd6272588606",
       "triggerType" : "PUSH"
     }, {
       "hash" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10052",
       "triggerID" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 4b608b4a1cb022986e282c404554dd6272588606 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979) 
   * 53f3b3f251e59d9d1d83a0d0f25589748a53d299 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10052) 
   
   <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 #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4b608b4a1cb022986e282c404554dd6272588606",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979",
       "triggerID" : "4b608b4a1cb022986e282c404554dd6272588606",
       "triggerType" : "PUSH"
     }, {
       "hash" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 4b608b4a1cb022986e282c404554dd6272588606 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979) 
   * 53f3b3f251e59d9d1d83a0d0f25589748a53d299 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] hudi-bot commented on pull request #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4b608b4a1cb022986e282c404554dd6272588606",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979",
       "triggerID" : "4b608b4a1cb022986e282c404554dd6272588606",
       "triggerType" : "PUSH"
     }, {
       "hash" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10052",
       "triggerID" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10067",
       "triggerID" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10073",
       "triggerID" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10080",
       "triggerID" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a749f666b8b5ee409cef0342532d6c90a6b71a2a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10085",
       "triggerID" : "a749f666b8b5ee409cef0342532d6c90a6b71a2a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1814b10b6bf6e3bc0fe1c483442b8637f929b2b0",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10106",
       "triggerID" : "1814b10b6bf6e3bc0fe1c483442b8637f929b2b0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bd922449d1756895a5e1cd8c3c85e33fcc3dd809",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10150",
       "triggerID" : "bd922449d1756895a5e1cd8c3c85e33fcc3dd809",
       "triggerType" : "PUSH"
     }, {
       "hash" : "24da4bb8af969e5c0706c91eb4ae5e64ecb5d1dc",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "24da4bb8af969e5c0706c91eb4ae5e64ecb5d1dc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "dbaafef2a8cfe013976422897ddd18bf0038a7dc",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10176",
       "triggerID" : "dbaafef2a8cfe013976422897ddd18bf0038a7dc",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 24da4bb8af969e5c0706c91eb4ae5e64ecb5d1dc UNKNOWN
   * dbaafef2a8cfe013976422897ddd18bf0038a7dc Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10176) 
   
   <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 #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4b608b4a1cb022986e282c404554dd6272588606",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979",
       "triggerID" : "4b608b4a1cb022986e282c404554dd6272588606",
       "triggerType" : "PUSH"
     }, {
       "hash" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10052",
       "triggerID" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10067",
       "triggerID" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10073",
       "triggerID" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10080",
       "triggerID" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a749f666b8b5ee409cef0342532d6c90a6b71a2a",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10085",
       "triggerID" : "a749f666b8b5ee409cef0342532d6c90a6b71a2a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a749f666b8b5ee409cef0342532d6c90a6b71a2a Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10085) 
   
   <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 #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9966",
       "triggerID" : "5b8c09fe7b6b26ea79b07b2c36ddcc66c8faadf2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9969",
       "triggerID" : "80e0b11c890cbb1f6bec082ed04e428772f69694",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4b608b4a1cb022986e282c404554dd6272588606",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9979",
       "triggerID" : "4b608b4a1cb022986e282c404554dd6272588606",
       "triggerType" : "PUSH"
     }, {
       "hash" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10052",
       "triggerID" : "53f3b3f251e59d9d1d83a0d0f25589748a53d299",
       "triggerType" : "PUSH"
     }, {
       "hash" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10067",
       "triggerID" : "e7a1d6a5699b8d8b759f613c751329dcb27d97b7",
       "triggerType" : "PUSH"
     }, {
       "hash" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10073",
       "triggerID" : "567bfb97df6f9cf5630cb925ad778f0d17d4ff88",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10080",
       "triggerID" : "c7faef9c1c5f12303cd94c51ff4e6fe71473c16f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a749f666b8b5ee409cef0342532d6c90a6b71a2a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10085",
       "triggerID" : "a749f666b8b5ee409cef0342532d6c90a6b71a2a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "1814b10b6bf6e3bc0fe1c483442b8637f929b2b0",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10106",
       "triggerID" : "1814b10b6bf6e3bc0fe1c483442b8637f929b2b0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bd922449d1756895a5e1cd8c3c85e33fcc3dd809",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "bd922449d1756895a5e1cd8c3c85e33fcc3dd809",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1814b10b6bf6e3bc0fe1c483442b8637f929b2b0 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=10106) 
   * bd922449d1756895a5e1cd8c3c85e33fcc3dd809 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] alexeykudinkin commented on a diff in pull request #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/BuiltinKeyGenerator.java:
##########
@@ -18,121 +18,334 @@
 
 package org.apache.hudi.keygen;
 
-import org.apache.hudi.ApiMaturityLevel;
+import org.apache.avro.generic.GenericRecord;
 import org.apache.hudi.AvroConversionUtils;
-import org.apache.hudi.PublicAPIMethod;
+import org.apache.hudi.HoodieSparkUtils;
+import org.apache.hudi.client.utils.SparkRowSerDe;
 import org.apache.hudi.common.config.TypedProperties;
-import org.apache.hudi.common.util.collection.Pair;
-import org.apache.hudi.exception.HoodieIOException;
-
-import org.apache.avro.generic.GenericRecord;
+import org.apache.hudi.common.util.PartitionPathEncodeUtils;
+import org.apache.hudi.exception.HoodieKeyException;
+import org.apache.hudi.unsafe.UTF8StringBuilder;
+import org.apache.spark.sql.HoodieUnsafeRowUtils;
+import org.apache.spark.sql.HoodieUnsafeRowUtils$;
 import org.apache.spark.sql.Row;
 import org.apache.spark.sql.catalyst.InternalRow;
-import org.apache.spark.sql.types.DataType;
 import org.apache.spark.sql.types.StructType;
+import org.apache.spark.unsafe.types.UTF8String;
+import scala.Function1;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
+import javax.annotation.concurrent.ThreadSafe;
 
-import scala.Function1;
+import static org.apache.hudi.common.util.ValidationUtils.checkState;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_PARTITION_PATH_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_RECORD_KEY_PARTS_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.HUDI_DEFAULT_PARTITION_PATH;
 
 /**
- * Base class for the built-in key generators. Contains methods structured for
- * code reuse amongst them.
+ * Base class for all built-in key generators.
+ *
+ * NOTE: By default it implements all the methods of {@link SparkKeyGeneratorInterface}, which
+ *       by default however fallback to Avro implementation. For maximum performance (to avoid
+ *       conversion from Spark's internal data-types to Avro) you should override these methods
+ *       in your implementation.
+ *
+ * TODO rename to AvroFallbackBaseKeyGenerator
  */
+@ThreadSafe
 public abstract class BuiltinKeyGenerator extends BaseKeyGenerator implements SparkKeyGeneratorInterface {
 
-  private static final String STRUCT_NAME = "hoodieRowTopLevelField";
-  private static final String NAMESPACE = "hoodieRow";
-  private Function1<Row, GenericRecord> converterFn = null;
-  private final AtomicBoolean validatePartitionFields = new AtomicBoolean(false);
-  protected StructType structType;
+  protected static final UTF8String HUDI_DEFAULT_PARTITION_PATH_UTF8 = UTF8String.fromString(HUDI_DEFAULT_PARTITION_PATH);
 
-  protected Map<String, Pair<List<Integer>, DataType>> recordKeySchemaInfo = new HashMap<>();
-  protected Map<String, Pair<List<Integer>, DataType>> partitionPathSchemaInfo = new HashMap<>();
+  protected transient volatile SparkRowConverter rowConverter;
+  protected transient volatile SparkRowAccessor rowAccessor;
 
   protected BuiltinKeyGenerator(TypedProperties config) {
     super(config);
   }
 
-  /**
-   * Fetch record key from {@link Row}.
-   *
-   * @param row instance of {@link Row} from which record key is requested.
-   * @return the record key of interest from {@link Row}.
-   */
   @Override
-  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
   public String getRecordKey(Row row) {
-    if (null == converterFn) {
-      converterFn = AvroConversionUtils.createConverterToAvro(row.schema(), STRUCT_NAME, NAMESPACE);
+    tryInitRowConverter(row.schema());

Review Comment:
   It's already annotated in the interface



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/BuiltinKeyGenerator.java:
##########
@@ -19,132 +19,560 @@
 package org.apache.hudi.keygen;
 
 import org.apache.avro.generic.GenericRecord;
-import org.apache.hudi.ApiMaturityLevel;
 import org.apache.hudi.AvroConversionUtils;
-import org.apache.hudi.PublicAPIMethod;
+import org.apache.hudi.HoodieSparkUtils;
+import org.apache.hudi.client.utils.SparkRowSerDe;
 import org.apache.hudi.common.config.TypedProperties;
-import org.apache.hudi.common.util.collection.Pair;
+import org.apache.hudi.common.util.PartitionPathEncodeUtils;
 import org.apache.hudi.exception.HoodieException;
+import org.apache.hudi.exception.HoodieKeyException;
+import org.apache.log4j.LogManager;
+import org.apache.log4j.Logger;
+import org.apache.spark.sql.HoodieUnsafeRowUtils;
+import org.apache.spark.sql.HoodieUnsafeRowUtils$;
 import org.apache.spark.sql.Row;
 import org.apache.spark.sql.catalyst.InternalRow;
 import org.apache.spark.sql.types.DataType;
+import org.apache.spark.sql.types.DateType;
 import org.apache.spark.sql.types.StructType;
+import org.apache.spark.sql.types.TimestampType;
+import org.apache.spark.unsafe.types.UTF8String;
 import scala.Function1;
 
-import java.util.HashMap;
+import javax.annotation.concurrent.ThreadSafe;
+import java.sql.Timestamp;
+import java.time.Instant;
+import java.time.LocalDate;
 import java.util.List;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.function.Function;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+import static org.apache.hudi.common.util.CollectionUtils.tail;
+import static org.apache.hudi.common.util.ValidationUtils.checkState;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_PARTITION_PATH_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_RECORD_KEY_PARTS_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.EMPTY_RECORDKEY_PLACEHOLDER;
+import static org.apache.hudi.keygen.KeyGenUtils.HUDI_DEFAULT_PARTITION_PATH;
+import static org.apache.hudi.keygen.KeyGenUtils.NULL_RECORDKEY_PLACEHOLDER;
 
 /**
- * Base class for the built-in key generators. Contains methods structured for
- * code reuse amongst them.
+ * Base class for all built-in key generators.
+ *
+ * NOTE: By default it implements all the methods of {@link SparkKeyGeneratorInterface}, which
+ *       by default however fallback to Avro implementation. For maximum performance (to avoid
+ *       conversion from Spark's internal data-types to Avro) you should override these methods
+ *       in your implementation.
+ *
+ * TODO rename to AvroFallbackBaseKeyGenerator
  */
+@ThreadSafe
 public abstract class BuiltinKeyGenerator extends BaseKeyGenerator implements SparkKeyGeneratorInterface {
 
-  private static final String STRUCT_NAME = "hoodieRowTopLevelField";
-  private static final String NAMESPACE = "hoodieRow";
-  private Function1<Row, GenericRecord> converterFn = null;
-  private final AtomicBoolean validatePartitionFields = new AtomicBoolean(false);
-  protected StructType structType;
+  private static final Logger LOG = LogManager.getLogger(BuiltinKeyGenerator.class);
+
+  private static final String COMPOSITE_KEY_FIELD_VALUE_INFIX = ":";
+
+  protected static final UTF8String HUDI_DEFAULT_PARTITION_PATH_UTF8 = UTF8String.fromString(HUDI_DEFAULT_PARTITION_PATH);
+  protected static final UTF8String NULL_RECORD_KEY_PLACEHOLDER_UTF8 = UTF8String.fromString(NULL_RECORDKEY_PLACEHOLDER);
+  protected static final UTF8String EMPTY_RECORD_KEY_PLACEHOLDER_UTF8 = UTF8String.fromString(EMPTY_RECORDKEY_PLACEHOLDER);
+
 
-  protected Map<String, Pair<List<Integer>, DataType>> recordKeySchemaInfo = new HashMap<>();
-  protected Map<String, Pair<List<Integer>, DataType>> partitionPathSchemaInfo = new HashMap<>();
+  protected transient volatile SparkRowConverter rowConverter;
+  protected transient volatile SparkRowAccessor rowAccessor;
 
   protected BuiltinKeyGenerator(TypedProperties config) {
     super(config);
   }
 
-  /**
-   * Fetch record key from {@link Row}.
-   *
-   * @param row instance of {@link Row} from which record key is requested.
-   * @return the record key of interest from {@link Row}.
-   */
   @Override
-  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
   public String getRecordKey(Row row) {
-    // TODO avoid conversion to avro
-    //      since converterFn is transient this will be repeatedly initialized over and over again
-    if (null == converterFn) {
-      converterFn = AvroConversionUtils.createConverterToAvro(row.schema(), STRUCT_NAME, NAMESPACE);
-    }
-    return getKey(converterFn.apply(row)).getRecordKey();
+    tryInitRowConverter(row.schema());
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return getRecordKey(rowConverter.convertToAvro(row));
   }
 
   @Override
-  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
-  public String getRecordKey(InternalRow internalRow, StructType schema) {
-    try {
-      // TODO fix
-      buildFieldSchemaInfoIfNeeded(schema);
-      return RowKeyGeneratorHelper.getRecordKeyFromInternalRow(internalRow, getRecordKeyFields(), recordKeySchemaInfo, false);
-    } catch (Exception e) {
-      throw new HoodieException("Conversion of InternalRow to Row failed with exception", e);
+  public UTF8String getRecordKey(InternalRow internalRow, StructType schema) {
+    tryInitRowConverter(schema);
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return UTF8String.fromString(getRecordKey(rowConverter.convertToAvro(internalRow)));
+  }
+
+  @Override
+  public String getPartitionPath(Row row) {
+    tryInitRowConverter(row.schema());
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return getPartitionPath(rowConverter.convertToAvro(row));
+  }
+
+  @Override
+  public UTF8String getPartitionPath(InternalRow internalRow, StructType schema) {
+    tryInitRowConverter(schema);
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    GenericRecord avroRecord = rowConverter.convertToAvro(internalRow);
+    return UTF8String.fromString(getPartitionPath(avroRecord));
+  }
+
+  protected void tryInitRowAccessor(StructType schema) {
+    if (this.rowAccessor == null) {
+      synchronized (this) {
+        if (this.rowAccessor == null) {
+          this.rowAccessor = new SparkRowAccessor(schema);
+        }
+      }
     }
   }
+
   /**
-   * Fetch partition path from {@link Row}.
-   *
-   * @param row instance of {@link Row} from which partition path is requested
-   * @return the partition path of interest from {@link Row}.
+   * NOTE: This method has to stay final (so that it's easier for JIT compiler to apply certain
+   *       optimizations, like inlining)
    */
+  protected final String combinePartitionPath(Object... partitionPathParts) {

Review Comment:
   They actually access KG fields (partitionPathFields, hiveStylePartitioning)



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/io/storage/row/HoodieInternalRowFileWriterFactory.java:
##########
@@ -42,32 +41,34 @@ public class HoodieInternalRowFileWriterFactory {
    * Factory method to assist in instantiating an instance of {@link HoodieInternalRowFileWriter}.
    * @param path path of the RowFileWriter.
    * @param hoodieTable instance of {@link HoodieTable} in use.
-   * @param config instance of {@link HoodieWriteConfig} to use.
+   * @param writeConfig instance of {@link HoodieWriteConfig} to use.
    * @param schema schema of the dataset in use.
    * @return the instantiated {@link HoodieInternalRowFileWriter}.
    * @throws IOException if format is not supported or if any exception during instantiating the RowFileWriter.
    *
    */
-  public static HoodieInternalRowFileWriter getInternalRowFileWriter(
-      Path path, HoodieTable hoodieTable, HoodieWriteConfig config, StructType schema)
+  public static HoodieInternalRowFileWriter getInternalRowFileWriter(Path path,
+                                                                     HoodieTable hoodieTable,
+                                                                     HoodieWriteConfig writeConfig,
+                                                                     StructType schema)
       throws IOException {
     final String extension = FSUtils.getFileExtension(path.getName());
     if (PARQUET.getFileExtension().equals(extension)) {
-      return newParquetInternalRowFileWriter(path, config, schema, hoodieTable);
+      return newParquetInternalRowFileWriter(path, hoodieTable, writeConfig, schema, tryInstantiateBloomFilter(writeConfig));
     }
     throw new UnsupportedOperationException(extension + " format not supported yet.");
   }
 
-  private static HoodieInternalRowFileWriter newParquetInternalRowFileWriter(
-      Path path, HoodieWriteConfig writeConfig, StructType structType, HoodieTable table)
+  private static HoodieInternalRowFileWriter newParquetInternalRowFileWriter(Path path,
+                                                                             HoodieTable table,
+                                                                             HoodieWriteConfig writeConfig,
+                                                                             StructType structType,
+                                                                             Option<BloomFilter> bloomFilterOpt
+  )
       throws IOException {
-    BloomFilter filter = BloomFilterFactory.createBloomFilter(
-            writeConfig.getBloomFilterNumEntries(),
-            writeConfig.getBloomFilterFPP(),
-            writeConfig.getDynamicBloomFilterMaxNumEntries(),
-            writeConfig.getBloomFilterType());

Review Comment:
   Extracting to a method makes things cleaner IMO



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/SparkKeyGeneratorInterface.java:
##########
@@ -18,20 +18,65 @@
 
 package org.apache.hudi.keygen;
 
+import org.apache.hudi.ApiMaturityLevel;
+import org.apache.hudi.PublicAPIMethod;
 import org.apache.spark.sql.Row;
 import org.apache.spark.sql.catalyst.InternalRow;
 import org.apache.spark.sql.types.StructType;
+import org.apache.spark.unsafe.types.UTF8String;
 
 /**
- * Spark key generator interface.
+ * Spark-specific {@link KeyGenerator} interface extension allowing implementation to
+ * specifically implement record-key, partition-path generation w/o the need for (expensive)
+ * conversion from Spark internal representation (for ex, to Avro)
  */
 public interface SparkKeyGeneratorInterface extends KeyGeneratorInterface {
 
+  /**
+   * Extracts record key from Spark's {@link Row}
+   *
+   * @param row instance of {@link Row} from which record-key is extracted
+   * @return record's (primary) key
+   */
+  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
   String getRecordKey(Row row);
 
-  String getRecordKey(InternalRow row, StructType schema);
+  /**
+   * Extracts record key from Spark's {@link InternalRow}
+   *
+   * NOTE: Difference b/w {@link Row} and {@link InternalRow} is that {@link InternalRow} could
+   *       internally hold just a binary representation of the data, while {@link Row} has it
+   *       deserialized into JVM-native representation (like {@code Integer}, {@code Long},
+   *       {@code String}, etc)
+   *
+   * @param row instance of {@link InternalRow} from which record-key is extracted
+   * @param schema schema {@link InternalRow} is adhering to
+   * @return record-key as instance of {@link UTF8String}
+   */
+  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
+  UTF8String getRecordKey(InternalRow row, StructType schema);

Review Comment:
   Created HUDI-4446. Do we annotate them somehow? 



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/BuiltinKeyGenerator.java:
##########
@@ -19,132 +19,560 @@
 package org.apache.hudi.keygen;
 
 import org.apache.avro.generic.GenericRecord;
-import org.apache.hudi.ApiMaturityLevel;
 import org.apache.hudi.AvroConversionUtils;
-import org.apache.hudi.PublicAPIMethod;
+import org.apache.hudi.HoodieSparkUtils;
+import org.apache.hudi.client.utils.SparkRowSerDe;
 import org.apache.hudi.common.config.TypedProperties;
-import org.apache.hudi.common.util.collection.Pair;
+import org.apache.hudi.common.util.PartitionPathEncodeUtils;
 import org.apache.hudi.exception.HoodieException;
+import org.apache.hudi.exception.HoodieKeyException;
+import org.apache.log4j.LogManager;
+import org.apache.log4j.Logger;
+import org.apache.spark.sql.HoodieUnsafeRowUtils;
+import org.apache.spark.sql.HoodieUnsafeRowUtils$;
 import org.apache.spark.sql.Row;
 import org.apache.spark.sql.catalyst.InternalRow;
 import org.apache.spark.sql.types.DataType;
+import org.apache.spark.sql.types.DateType;
 import org.apache.spark.sql.types.StructType;
+import org.apache.spark.sql.types.TimestampType;
+import org.apache.spark.unsafe.types.UTF8String;
 import scala.Function1;
 
-import java.util.HashMap;
+import javax.annotation.concurrent.ThreadSafe;
+import java.sql.Timestamp;
+import java.time.Instant;
+import java.time.LocalDate;
 import java.util.List;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.function.Function;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+
+import static org.apache.hudi.common.util.CollectionUtils.tail;
+import static org.apache.hudi.common.util.ValidationUtils.checkState;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_PARTITION_PATH_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.DEFAULT_RECORD_KEY_PARTS_SEPARATOR;
+import static org.apache.hudi.keygen.KeyGenUtils.EMPTY_RECORDKEY_PLACEHOLDER;
+import static org.apache.hudi.keygen.KeyGenUtils.HUDI_DEFAULT_PARTITION_PATH;
+import static org.apache.hudi.keygen.KeyGenUtils.NULL_RECORDKEY_PLACEHOLDER;
 
 /**
- * Base class for the built-in key generators. Contains methods structured for
- * code reuse amongst them.
+ * Base class for all built-in key generators.
+ *
+ * NOTE: By default it implements all the methods of {@link SparkKeyGeneratorInterface}, which
+ *       by default however fallback to Avro implementation. For maximum performance (to avoid
+ *       conversion from Spark's internal data-types to Avro) you should override these methods
+ *       in your implementation.
+ *
+ * TODO rename to AvroFallbackBaseKeyGenerator
  */
+@ThreadSafe
 public abstract class BuiltinKeyGenerator extends BaseKeyGenerator implements SparkKeyGeneratorInterface {
 
-  private static final String STRUCT_NAME = "hoodieRowTopLevelField";
-  private static final String NAMESPACE = "hoodieRow";
-  private Function1<Row, GenericRecord> converterFn = null;
-  private final AtomicBoolean validatePartitionFields = new AtomicBoolean(false);
-  protected StructType structType;
+  private static final Logger LOG = LogManager.getLogger(BuiltinKeyGenerator.class);
+
+  private static final String COMPOSITE_KEY_FIELD_VALUE_INFIX = ":";
+
+  protected static final UTF8String HUDI_DEFAULT_PARTITION_PATH_UTF8 = UTF8String.fromString(HUDI_DEFAULT_PARTITION_PATH);
+  protected static final UTF8String NULL_RECORD_KEY_PLACEHOLDER_UTF8 = UTF8String.fromString(NULL_RECORDKEY_PLACEHOLDER);
+  protected static final UTF8String EMPTY_RECORD_KEY_PLACEHOLDER_UTF8 = UTF8String.fromString(EMPTY_RECORDKEY_PLACEHOLDER);
+
 
-  protected Map<String, Pair<List<Integer>, DataType>> recordKeySchemaInfo = new HashMap<>();
-  protected Map<String, Pair<List<Integer>, DataType>> partitionPathSchemaInfo = new HashMap<>();
+  protected transient volatile SparkRowConverter rowConverter;
+  protected transient volatile SparkRowAccessor rowAccessor;
 
   protected BuiltinKeyGenerator(TypedProperties config) {
     super(config);
   }
 
-  /**
-   * Fetch record key from {@link Row}.
-   *
-   * @param row instance of {@link Row} from which record key is requested.
-   * @return the record key of interest from {@link Row}.
-   */
   @Override
-  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
   public String getRecordKey(Row row) {
-    // TODO avoid conversion to avro
-    //      since converterFn is transient this will be repeatedly initialized over and over again
-    if (null == converterFn) {
-      converterFn = AvroConversionUtils.createConverterToAvro(row.schema(), STRUCT_NAME, NAMESPACE);
-    }
-    return getKey(converterFn.apply(row)).getRecordKey();
+    tryInitRowConverter(row.schema());
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return getRecordKey(rowConverter.convertToAvro(row));
   }
 
   @Override
-  @PublicAPIMethod(maturity = ApiMaturityLevel.EVOLVING)
-  public String getRecordKey(InternalRow internalRow, StructType schema) {
-    try {
-      // TODO fix
-      buildFieldSchemaInfoIfNeeded(schema);
-      return RowKeyGeneratorHelper.getRecordKeyFromInternalRow(internalRow, getRecordKeyFields(), recordKeySchemaInfo, false);
-    } catch (Exception e) {
-      throw new HoodieException("Conversion of InternalRow to Row failed with exception", e);
+  public UTF8String getRecordKey(InternalRow internalRow, StructType schema) {
+    tryInitRowConverter(schema);
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return UTF8String.fromString(getRecordKey(rowConverter.convertToAvro(internalRow)));
+  }
+
+  @Override
+  public String getPartitionPath(Row row) {
+    tryInitRowConverter(row.schema());
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    return getPartitionPath(rowConverter.convertToAvro(row));
+  }
+
+  @Override
+  public UTF8String getPartitionPath(InternalRow internalRow, StructType schema) {
+    tryInitRowConverter(schema);
+    // NOTE: This implementation has considerable computational overhead and has to be overridden
+    //       to provide for optimal performance on Spark. This implementation provided exclusively
+    //       for compatibility reasons.
+    GenericRecord avroRecord = rowConverter.convertToAvro(internalRow);
+    return UTF8String.fromString(getPartitionPath(avroRecord));
+  }
+
+  protected void tryInitRowAccessor(StructType schema) {
+    if (this.rowAccessor == null) {
+      synchronized (this) {

Review Comment:
   It won't: if 2 threads will try to assign, they will mutex on a lock and only 1 will enter 2d condition
   
   . It's a classic [double-checked locking](https://en.wikipedia.org/wiki/Double-checked_locking) pattern -- we're avoiding taking locks in the hot-path by taking them only in case the field has not been init'd yet (which will happen at most twice.



##########
hudi-kafka-connect/src/main/java/org/apache/hudi/connect/utils/KafkaConnectUtils.java:
##########
@@ -174,7 +174,9 @@ public static Configuration getDefaultHadoopConf(KafkaConnectConfigs connectConf
    * @return Returns the record key columns separated by comma.
    */
   public static String getRecordKeyColumns(KeyGenerator keyGenerator) {
-    return String.join(",", keyGenerator.getRecordKeyFieldNames());
+    return keyGenerator.getRecordKeyFieldNames().stream()
+        .map(HoodieAvroUtils::getRootLevelFieldName)

Review Comment:
   Accidental blanket-refactoring. Reverted



-- 
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] alexeykudinkin commented on a diff in pull request #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/client/model/HoodieInternalRow.java:
##########
@@ -50,22 +51,27 @@ public class HoodieInternalRow extends InternalRow {
 
   /**
    * Collection of meta-fields as defined by {@link HoodieRecord#HOODIE_META_COLUMNS}
+   *
+   * NOTE: {@code HoodieInternalRow} *always* overlays its own meta-fields even in case
+   *       when source row also contains them, to make sure these fields are mutable and
+   *       can be updated (for ex, {@link UnsafeRow} doesn't support mutations due to
+   *       its memory layout, as it persists field offsets)
    */
   private final UTF8String[] metaFields;
-  private final InternalRow row;
+  private final InternalRow sourceRow;
 
   /**
-   * Specifies whether source {@link #row} contains meta-fields
+   * Specifies whether source {@link #sourceRow} contains meta-fields
    */
-  private final boolean containsMetaFields;
+  private final boolean sourceContainsMetaFields;

Review Comment:
   Agreed, renamed to resolve confusion that arose in our previous discussion regarding the scope of these fields



-- 
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] alexeykudinkin commented on pull request #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   @nsivabalan yes #5523 and #5470 bring about 20% improvement on just the bare-bone bulk-insert (no meta-fields, no de-duping, etc)
   
   It's gonna be even more w/ meta-fields.


-- 
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] alexeykudinkin commented on a diff in pull request #5523: [HUDI-4039] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/io/storage/row/HoodieRowCreateHandle.java:
##########
@@ -137,47 +135,59 @@ public HoodieRowCreateHandle(HoodieTable table,
    * @throws IOException
    */
   public void write(InternalRow row) throws IOException {
+    if (populateMetaFields) {
+      writeRow(row);
+    } else {
+      writeRowNoMetaFields(row);
+    }
+  }
+
+  private void writeRow(InternalRow row) {
     try {
       // NOTE: PLEASE READ THIS CAREFULLY BEFORE MODIFYING
       //       This code lays in the hot-path, and substantial caution should be
       //       exercised making changes to it to minimize amount of excessive:
-      //          - Conversions b/w Spark internal (low-level) types and JVM native ones (like
-      //         [[UTF8String]] and [[String]])
+      //          - Conversions b/w Spark internal types and JVM native ones (like [[UTF8String]]
+      //          and [[String]])
       //          - Repeated computations (for ex, converting file-path to [[UTF8String]] over and
       //          over again)
-      UTF8String recordKey = row.getUTF8String(RECORD_KEY_META_FIELD_ORD);
-
-      InternalRow updatedRow;
-      // In cases when no meta-fields need to be added we simply relay provided row to
-      // the writer as is
-      if (!populateMetaFields) {
-        updatedRow = row;
-      } else {
-        UTF8String partitionPath = row.getUTF8String(PARTITION_PATH_META_FIELD_ORD);
-        // This is the only meta-field that is generated dynamically, hence conversion b/w
-        // [[String]] and [[UTF8String]] is unavoidable
-        UTF8String seqId = UTF8String.fromString(seqIdGenerator.apply(GLOBAL_SEQ_NO.getAndIncrement()));
-
-        updatedRow = new HoodieInternalRow(commitTime, seqId, recordKey,
-            partitionPath, fileName, row, true);
-      }
+      UTF8String recordKey = row.getUTF8String(HoodieRecord.RECORD_KEY_META_FIELD_ORD);
+      UTF8String partitionPath = row.getUTF8String(HoodieRecord.PARTITION_PATH_META_FIELD_ORD);
+      // This is the only meta-field that is generated dynamically, hence conversion b/w
+      // [[String]] and [[UTF8String]] is unavoidable
+      UTF8String seqId = UTF8String.fromString(seqIdGenerator.apply(GLOBAL_SEQ_NO.getAndIncrement()));
+
+      InternalRow updatedRow = new HoodieInternalRow(commitTime, seqId, recordKey,
+          partitionPath, fileName, row, true);
 
       try {
         fileWriter.writeRow(recordKey, updatedRow);
         // NOTE: To avoid conversion on the hot-path we only convert [[UTF8String]] into [[String]]
         //       in cases when successful records' writes are being tracked
         writeStatus.markSuccess(writeStatus.isTrackingSuccessfulWrites() ? recordKey.toString() : null);
-      } catch (Throwable t) {
+      } catch (Exception t) {

Review Comment:
   It's not gonna change it in the unexpected way: any application level are inheriting from `Exception`, the only things that do inherit from `Throwable` but not from `Exception` are the terminal ones (ie ones you can't recover from) like 
   `OutOfMemory`, etc



-- 
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 #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 5a8425e8613610f85af091a9dbc8037c74b7f858 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482) 
   * a01447ba4b2d720d362be8fd963fca781747b0d3 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] hudi-bot commented on pull request #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a01447ba4b2d720d362be8fd963fca781747b0d3 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944) 
   * cafc6f941ac2f13a71f80c7298b84712e93d16b8 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] hudi-bot commented on pull request #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a01447ba4b2d720d362be8fd963fca781747b0d3 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944) 
   
   <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 #5523: [HUDI-4039][Stacked on 5470] Make sure all builtin `KeyGenerator`s properly implement Spark specific APIs

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8482",
       "triggerID" : "5a8425e8613610f85af091a9dbc8037c74b7f858",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9944",
       "triggerID" : "a01447ba4b2d720d362be8fd963fca781747b0d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963",
       "triggerID" : "cafc6f941ac2f13a71f80c7298b84712e93d16b8",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * cafc6f941ac2f13a71f80c7298b84712e93d16b8 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9963) 
   
   <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