Skip to content

Commit e087c39

Browse files
twou12031travilyu
authored andcommitted
[bugfix] deepflow querier datasource, throw error when reusing tag from SELECT
**Phenomenon and reproduction steps** none **Root cause and solution** none **Impactions** none **Test method** none **Affected branch(es)** - main **Checklist** - [ ] Dependencies update required - [ ] Common bug (similar problem in other repo)
1 parent b5744cf commit e087c39

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

deepflow-querier-datasource/src/QueryEditor.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import {
2424
SERVICE_MAP_SUPPORT_DB,
2525
SERVICE_MAP_SUPPORT_TABLE,
2626
TAG_METRIC_TYPE_NUM,
27-
TAG_TAG_TYPE,
2827
TIME_TAG_TYPE
2928
} from 'consts'
3029
import { DATA_SOURCE_SETTINGS, getTagMapCache, SQL_CACHE } from 'utils/cache'
@@ -224,7 +223,7 @@ export class QueryEditor extends PureComponent<Props> {
224223
}
225224
const result = select
226225
.filter(e => {
227-
return ![TAG_TAG_TYPE, TIME_TAG_TYPE].includes(e.type) && !!e.key && e.as !== ''
226+
return e.type === 'tag' && !!e.key && e.as !== ''
228227
})
229228
.map((e, i) => {
230229
const orgOpt = tagOpts.find(opt => {
@@ -240,6 +239,7 @@ export class QueryEditor extends PureComponent<Props> {
240239
fromSelect: e
241240
}
242241
})
242+
.filter(e => !!e)
243243
return result
244244
}
245245

@@ -1110,11 +1110,9 @@ export class QueryEditor extends PureComponent<Props> {
11101110
) && extra
11111111
)
11121112
})
1113-
: this.tagsFromSelect.concat(
1114-
tagOpts.filter(tag => {
1115-
return ![MAP_TAG_TYPE, TIME_TAG_TYPE].includes(tag.type as string)
1116-
})
1117-
)
1113+
: this.tagsFromSelect.concat(tagOpts).filter(tag => {
1114+
return ![MAP_TAG_TYPE, TIME_TAG_TYPE].includes(tag.type as string)
1115+
})
11181116
}
11191117
metricOpts={
11201118
conf.targetDataKey === 'orderBy'

deepflow-querier-datasource/src/consts.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export const TAG_METRIC_TYPE_NUM = 6
1414
export const MAP_METRIC_TYPE_NUM = 7
1515

1616
export const TIME_TAG_TYPE = 'time'
17-
export const TAG_TAG_TYPE = 'tag'
1817
export const MAP_TAG_TYPE = 'map'
1918
export const IP_ARRAY_TAG_TYPE = 'ip_array'
2019
export const RESOURCE_ARRAY_TAG_TYPE = 'resource_array'

0 commit comments

Comments
 (0)