Skip to content

Commit

Permalink
Fix Postgres Application listing (#16600)
Browse files Browse the repository at this point in the history
* Fix Postgres Application listing

* Fix Listing
  • Loading branch information
mohityadav766 authored Jun 11, 2024
1 parent a3524e1 commit 77dfe1f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
ALTER TABLE ingestion_pipeline_entity ADD COLUMN appType VARCHAR(256) GENERATED ALWAYS AS (json ->> '$.sourceConfig.config.appConfig.type') STORED NULL;
ALTER TABLE ingestion_pipeline_entity ADD COLUMN appType VARCHAR(256) GENERATED ALWAYS AS (json ->> '$.sourceConfig.config.appConfig.type') STORED NULL;
ALTER TABLE ingestion_pipeline_entity ADD COLUMN pipelineType VARCHAR(256) GENERATED ALWAYS AS (json ->> '$.pipelineType') STORED NULL;
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
ALTER TABLE ingestion_pipeline_entity ADD COLUMN appType VARCHAR(256) GENERATED ALWAYS AS (json -> 'sourceConfig' -> 'config' -> 'appConfig' ->> 'type') STORED NULL;
ALTER TABLE ingestion_pipeline_entity ADD COLUMN appType VARCHAR(256) GENERATED ALWAYS AS (json -> 'sourceConfig' -> 'config' -> 'appConfig' ->> 'type') STORED NULL;
ALTER TABLE ingestion_pipeline_entity ADD COLUMN pipelineType VARCHAR(256) GENERATED ALWAYS AS (json ->> 'pipelineType') STORED NULL;
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,7 @@ public String getApplicationTypeCondition() {
if (applicationType == null) {
return "";
}
if (Boolean.TRUE.equals(DatasourceConfig.getInstance().isMySQL())) {
return String.format(
"(JSON_UNQUOTE(JSON_EXTRACT(ingestion_pipeline_entity.json, '$.sourceConfig.config.appConfig.type')) = '%s')",
applicationType);
}
return String.format(
"(ingestion_pipeline_entity.json ->> '{sourceConfig,config,appConfig,type}' = '%s')",
applicationType);
return String.format("(appType = '%s')", applicationType);
}

private String getTestCaseCondition() {
Expand Down Expand Up @@ -279,15 +272,13 @@ private String getPipelineTypePrefixCondition(String tableName, String pipelineT
String inCondition = getInConditionFromString(pipelineType);
if (Boolean.TRUE.equals(DatasourceConfig.getInstance().isMySQL())) {
return tableName == null
? String.format(
"JSON_UNQUOTE(JSON_EXTRACT(ingestion_pipeline_entity.json, '$.pipelineType')) IN (%s)",
inCondition)
? String.format("pipelineType IN (%s)", inCondition)
: String.format(
"%s.JSON_UNQUOTE(JSON_EXTRACT(ingestion_pipeline_entity.json, '$.pipelineType')) IN (%s)",
tableName, inCondition);
}
return tableName == null
? String.format("ingestion_pipeline_entity.json->>'pipelineType' IN (%s)", inCondition)
? String.format("pipelineType IN (%s)", inCondition)
: String.format("%s.json->>'pipelineType' IN (%s)", tableName, inCondition);
}

Expand Down

0 comments on commit 77dfe1f

Please sign in to comment.