You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "xiaochen zhou (Jira)" <ji...@apache.org> on 2023/04/03 13:37:00 UTC

[jira] [Comment Edited] (HUDI-5761) Create "Type" configs for current configs that take in classes

    [ https://issues.apache.org/jira/browse/HUDI-5761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17707972#comment-17707972 ] 

xiaochen zhou edited comment on HUDI-5761 at 4/3/23 1:36 PM:
-------------------------------------------------------------

Hi, I am trying to complete this issue, but there is some confusion in the process of completing the issue, how to get the "*_type" value elegantly, the implementation method I can think of now is to correspond to a method for each "_type" Value, like this


```JAVA
    switch (keyGeneratorTypeEnum) {
      case SIMPLE:
        return new SimpleAvroKeyGenerator(props);
      case COMPLEX:
        return new ComplexAvroKeyGenerator(props);
      case TIMESTAMP:
        return new TimestampBasedAvroKeyGenerator(props);
      case CUSTOM:
        return new CustomAvroKeyGenerator(props);
      case NON_PARTITION:
        return new NonpartitionedAvroKeyGenerator(props);
      case GLOBAL_DELETE:
        return new GlobalAvroDeleteKeyGenerator(props);
      default:
        throw new HoodieKeyGeneratorException("Unsupported keyGenerator Type " + keyGeneratorType);
    }
```

By the way, can you assign this ticket to me? I will try my best to complete it


was (Author: zxcoccer):
Hi, I am trying to complete this issue, but there is some confusion in the process of completing the issue, how to get the "*_type" value elegantly, the implementation method I can think of now is to correspond to a method for each "_type" Value, like this
     switch (keyGeneratorTypeEnum) {
       case SIMPLE:
         return new SimpleAvroKeyGenerator(props);
       case COMPLEX:
         return new ComplexAvroKeyGenerator(props);
       case TIMESTAMP:
         return new TimestampBasedAvroKeyGenerator(props);
       case CUSTOM:
         return new CustomAvroKeyGenerator(props);
       case NON_PARTITION:
         return new NonpartitionedAvroKeyGenerator(props);
       case GLOBAL_DELETE:
         return new GlobalAvroDeleteKeyGenerator(props);
       default:
         throw new HoodieKeyGeneratorException("Unsupported keyGenerator Type " + keyGeneratorType);
     }
By the way, can you assign this ticket to me? I will try my best to complete it

> Create "Type" configs for current configs that take in classes
> --------------------------------------------------------------
>
>                 Key: HUDI-5761
>                 URL: https://issues.apache.org/jira/browse/HUDI-5761
>             Project: Apache Hudi
>          Issue Type: Improvement
>          Components: configs
>            Reporter: Jonathan Vexler
>            Priority: Major
>             Fix For: 0.14.0
>
>
> Take for example `hoodie.datasource.write.keygenerator.type` and its counterpart `hoodie.datasource.write.keygenerator.class`. We should make configs like keygenerator.type for configs currently like keygenerator.class. Take for example `hoodie.datasource.write.record.merger.impls`. If you want HoodieAvroRecordMerger you need to set the value to org.apache.hudi.common.model.HoodieAvroRecordMerger. However, if you want HoodieSparkRecordMerger, the full class path is org.apache.hudi.HoodieSparkRecordMerger. Differences like this are an easy cause for mistakes.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)