hudi icon indicating copy to clipboard operation
hudi copied to clipboard

how to get primary key from one hoodie table

Open njalan opened this issue 6 months ago • 4 comments

is there any to get primary key from one existing hoodie table

njalan avatar May 19 '25 01:05 njalan

did you mean to get the record key field name or value?

danny0405 avatar May 19 '25 03:05 danny0405

@danny0405 get the record key field name

njalan avatar May 19 '25 06:05 njalan

It's located in the .hoodie/hoodie.properties file, you can build the table meta client and fetch it through the table config.

danny0405 avatar May 19 '25 23:05 danny0405

Hi @njalan

In order to get the primary key, pre-combined key or partition key we need to read the <$TABLE_PATH>/.hoodie/hoodie.properties file.

Example:

hoodie.table.precombine.field=comb
hoodie.table.partition.fields=par
hoodie.table.recordkey.fields=id

Please let me know if any other information is required.

rangareddy avatar May 23 '25 12:05 rangareddy

We're now closing this issue as the solutions provided will help you retrieve the primary key column.

ad1happy2go avatar Aug 25 '25 08:08 ad1happy2go