Compare commits

...
Author SHA1 Message Date
Rafael Santana f4c9226ef9 Merge pull request #458 from dadosfera/force-deploy
FIX: rename-tables proxy path and ES lookup
2026-03-13 18:29:53 -03:00
RafaelandClaude Opus 4.6 12c61d9b5d FIX: rename-tables proxy path and ES lookup
- Fix proxy path: /jobs/jdbc/:jobId/rename-tables → /jobs/:jobId/rename-tables
- Remove pipeline_id from ES data asset lookup, search by table_name + table_schema only

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 18:08:39 -03:00
2 changed files with 5 additions and 8 deletions
@@ -1066,8 +1066,8 @@ export class PlatformApiController {
const rollbackSteps: Array<() => Promise<void>> = [];
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) {
@@ -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;
}
}