hudi
hudi copied to clipboard
how to get primary key from one hoodie table
is there any to get primary key from one existing hoodie table
did you mean to get the record key field name or value?
@danny0405 get the record key field name
It's located in the .hoodie/hoodie.properties file, you can build the table meta client and fetch it through the table config.
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.
We're now closing this issue as the solutions provided will help you retrieve the primary key column.