diff --git a/src/modules/platform-api/platform-api.controller.ts b/src/modules/platform-api/platform-api.controller.ts index 97b0a08..31bf1c3 100644 --- a/src/modules/platform-api/platform-api.controller.ts +++ b/src/modules/platform-api/platform-api.controller.ts @@ -1066,8 +1066,8 @@ export class PlatformApiController { const rollbackSteps: Array<() => Promise> = []; try { - const dataAsset = await this.elasticsearchService.findDataAssetByPipelineAndTable( - user.customer_name, pipelineId, oldTableName, oldTableSchema, + const dataAsset = await this.elasticsearchService.findDataAssetByTable( + user.customer_name, oldTableName, oldTableSchema, ); if (!dataAsset) { diff --git a/src/services/elasticsearch/elasticsearch.service.ts b/src/services/elasticsearch/elasticsearch.service.ts index 8fff83e..8e2dfe7 100644 --- a/src/services/elasticsearch/elasticsearch.service.ts +++ b/src/services/elasticsearch/elasticsearch.service.ts @@ -362,9 +362,8 @@ export class ElasticsearchService { return `${customerName}_data_assets_catalog`; } - async findDataAssetByPipelineAndTable( + async findDataAssetByTable( customerName: string, - pipelineId: string, tableName: string, tableSchema: string, ): Promise<{ id: string; nimbus_id: number | null; [key: string]: any } | null> { @@ -372,7 +371,6 @@ export class ElasticsearchService { this.logger.info('Elasticsearch: Searching data asset', { index, - pipelineId, tableName, tableSchema, }); @@ -382,7 +380,6 @@ export class ElasticsearchService { query: { bool: { must: [ - { term: { 'pipeline_id.keyword': pipelineId } }, { term: { 'table_name.keyword': tableName } }, { term: { 'table_schema.keyword': tableSchema } }, ], @@ -393,13 +390,13 @@ export class ElasticsearchService { const hits = response.data.hits?.hits || []; if (hits.length === 0) { - this.logger.warn('Elasticsearch: Data asset not found', { pipelineId, tableName, tableSchema, index }); + this.logger.warn('Elasticsearch: Data asset not found', { tableName, tableSchema, index }); return null; } return { ...hits[0]._source, _es_id: hits[0]._id }; } catch (error) { - this.handleError('findDataAssetByPipelineAndTable', error, { pipelineId, tableName, tableSchema, index }); + this.handleError('findDataAssetByTable', error, { tableName, tableSchema, index }); throw error; } }