Skip to content

[DOCS] Update Key generation page#9486

Merged
nsivabalan merged 2 commits intoapache:asf-sitefrom
bhasudha:asf-site-keygenerator
Sep 12, 2023
Merged

[DOCS] Update Key generation page#9486
nsivabalan merged 2 commits intoapache:asf-sitefrom
bhasudha:asf-site-keygenerator

Conversation

@bhasudha
Copy link
Contributor

@bhasudha bhasudha commented Aug 20, 2023

Change Logs

doc changes for Key generator page

Impact

doc changes

Risk level (write none, low medium or high below)

low

Documentation Update

Describe any necessary documentation update if there is any new feature, config, or user-facing change

  • The config description must be updated if new configs are added or the default value of the configs are changed
  • Any new feature or user-facing change requires updating the Hudi website. Please create a Jira ticket, attach the
    ticket number here and follow the instruction to make
    changes to the website.

Contributor's checklist

  • Read through contributor's guide
  • Change Logs and Impact were stated clearly
  • Adequate tests were added if applicable
  • CI passed

| ---------------------------------------------------------------------------------------- |------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| hoodie.datasource.write.recordkey.field | N/A (Optional) | Record key field. Value to be used as the `recordKey` component of `HoodieKey`. <ul><li>When configured, actual value will be obtained by invoking .toString() on the field value. Nested fields can be specified using the dot notation eg: `a.b.c`. </li><li>When not configured record key will be automatically generated by Hudi.</li></ul> <br />`Config Param: RECORDKEY_FIELD_NAME` |
| hoodie.datasource.write.partitionpath.field | N/A (Optional) | Partition path field. Value to be used at the partitionPath component of HoodieKey. This needs to be specified if a partitioned table is desired. Actual value obtained by invoking .toString()<br />`Config Param: PARTITIONPATH_FIELD_NAME` |
| hoodie.datasource.write.keygenerator.class | N/A (Optional) | Key generator class, that implements `org.apache.hudi.keygen.KeyGenerator` extract a key out of incoming records. <ul><li>When set, the configured value takes precedence to be in effect and automatic inference is not triggered.</li><li>When not configured, if `hoodie.datasource.write.keygenerator.type` is set, the configured value is used else automatic inference is triggered.</li><li>In case of auto generated record keys. the key generator type is automatically inferred.</li></ul> <br />`Config Param: KEYGENERATOR_CLASS_NAME` |
Copy link
Contributor Author

@bhasudha bhasudha Aug 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nsivabalan please review and suggest edits on this part. I have edited it to cover for the auto key generation and auto inferencing part as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good.
minor suggestion

In case of auto generated record keys, the configure key generator class/type will be used to determine the partition path generation. So, users can still configure a key generator class and skip configuring record key field (on which case, hudi will auto generate record keys). 

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nsivabalan For specifying partition path, the users should still configure the keygen class/type correct ? Or is it assumed to be non-partitioned if the key gen class is not provided ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hudi will auto infer partition path.
for eg, if not configured, hudi will assume its non-partitioned.
So, the key gen class is not strictly a mandatory field.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for clarifying. Edited the smae. ptal

@bhasudha
Copy link
Contributor Author

Tested locally!
Screenshot 2023-08-20 at 3 27 14 AM
Screenshot 2023-08-20 at 3 27 27 AM
Screenshot 2023-08-20 at 3 27 45 AM

@bhasudha bhasudha force-pushed the asf-site-keygenerator branch 2 times, most recently from aaf56f2 to 9790ac9 Compare August 29, 2023 17:41
@bhasudha bhasudha force-pushed the asf-site-keygenerator branch 2 times, most recently from f3cdc62 to 3bd0ea2 Compare September 4, 2023 22:22
| ---------------------------------------------------------------------------------------- |------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| hoodie.datasource.write.recordkey.field | N/A (Optional) | Record key field. Value to be used as the `recordKey` component of `HoodieKey`. <ul><li>When configured, actual value will be obtained by invoking .toString() on the field value. Nested fields can be specified using the dot notation eg: `a.b.c`. </li><li>When not configured record key will be automatically generated by Hudi.</li></ul> <br />`Config Param: RECORDKEY_FIELD_NAME` |
| hoodie.datasource.write.partitionpath.field | N/A (Optional) | Partition path field. Value to be used at the partitionPath component of HoodieKey. This needs to be specified if a partitioned table is desired. Actual value obtained by invoking .toString()<br />`Config Param: PARTITIONPATH_FIELD_NAME` |
| hoodie.datasource.write.keygenerator.class | N/A (Optional) | Key generator class, that implements `org.apache.hudi.keygen.KeyGenerator` extract a key out of incoming records. <ul><li>When set, the configured value takes precedence to be in effect and automatic inference is not triggered.</li><li>When not configured, if `hoodie.datasource.write.keygenerator.type` is set, the configured value is used else automatic inference is triggered.</li><li>In case of auto generated record keys. the key generator type is automatically inferred.</li></ul> <br />`Config Param: KEYGENERATOR_CLASS_NAME` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good.
minor suggestion

In case of auto generated record keys, the configure key generator class/type will be used to determine the partition path generation. So, users can still configure a key generator class and skip configuring record key field (on which case, hudi will auto generate record keys). 

@bhasudha bhasudha force-pushed the asf-site-keygenerator branch from 3bd0ea2 to 208d6c8 Compare September 11, 2023 13:43
@bhasudha bhasudha requested a review from nsivabalan September 11, 2023 22:51
@bhasudha bhasudha force-pushed the asf-site-keygenerator branch from 208d6c8 to 0acf760 Compare September 12, 2023 00:07
@bhasudha bhasudha force-pushed the asf-site-keygenerator branch from 0acf760 to 66f5920 Compare September 12, 2023 16:59
@nsivabalan nsivabalan merged commit 22f4a7f into apache:asf-site Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants