Skip to content

Commit

Permalink
Hudi fixes (#272)
Browse files Browse the repository at this point in the history
* #OBS-I330 : Using dataset v2 export api while publishing

* #OBS-I330 : removed print statement

* #OBS-I330 : Replacing - with _ for datasource_ref and adding partition key and primary key and timestamp key in column spec of ingestion spec
  • Loading branch information
yashashkumar authored Nov 11, 2024
1 parent e29622f commit 7dfee90
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions api-service/src/services/TableGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ class TableGenerator extends BaseTableGenerator {
return {
dataset: dataset.dataset_id,
schema: {
table: datasourceRef,
table: _.includes(datasourceRef, '-')
? _.replace(datasourceRef, /-/g, '_')
: datasourceRef,
partitionColumn: partitionKey,
timestampColumn: timestampKey,
primaryKey: primaryKey,
Expand Down Expand Up @@ -201,9 +203,6 @@ class TableGenerator extends BaseTableGenerator {
private getHudiColumnSpec = (allFields: Record<string, any>[], primaryKey: string, partitionKey: string, timestampKey: string): Record<string, any>[] => {

const dataFields = _.cloneDeep(allFields);
_.remove(dataFields, { name: primaryKey })
_.remove(dataFields, { name: partitionKey })
_.remove(dataFields, { name: timestampKey })
let index = 1;
const transformFields = _.map(dataFields, (field) => {
return {
Expand Down

0 comments on commit 7dfee90

Please sign in to comment.