Skip to content

Commit

Permalink
[bugfix] deepflow querier datasource, throw error when reusing tag fr…
Browse files Browse the repository at this point in the history
…om 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)
  • Loading branch information
twou12031 authored and travilyu committed Nov 10, 2022
1 parent b5744cf commit e087c39
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
12 changes: 5 additions & 7 deletions deepflow-querier-datasource/src/QueryEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
SERVICE_MAP_SUPPORT_DB,
SERVICE_MAP_SUPPORT_TABLE,
TAG_METRIC_TYPE_NUM,
TAG_TAG_TYPE,
TIME_TAG_TYPE
} from 'consts'
import { DATA_SOURCE_SETTINGS, getTagMapCache, SQL_CACHE } from 'utils/cache'
Expand Down Expand Up @@ -224,7 +223,7 @@ export class QueryEditor extends PureComponent<Props> {
}
const result = select
.filter(e => {
return ![TAG_TAG_TYPE, TIME_TAG_TYPE].includes(e.type) && !!e.key && e.as !== ''
return e.type === 'tag' && !!e.key && e.as !== ''
})
.map((e, i) => {
const orgOpt = tagOpts.find(opt => {
Expand All @@ -240,6 +239,7 @@ export class QueryEditor extends PureComponent<Props> {
fromSelect: e
}
})
.filter(e => !!e)
return result
}

Expand Down Expand Up @@ -1110,11 +1110,9 @@ export class QueryEditor extends PureComponent<Props> {
) && extra
)
})
: this.tagsFromSelect.concat(
tagOpts.filter(tag => {
return ![MAP_TAG_TYPE, TIME_TAG_TYPE].includes(tag.type as string)
})
)
: this.tagsFromSelect.concat(tagOpts).filter(tag => {
return ![MAP_TAG_TYPE, TIME_TAG_TYPE].includes(tag.type as string)
})
}
metricOpts={
conf.targetDataKey === 'orderBy'
Expand Down
1 change: 0 additions & 1 deletion deepflow-querier-datasource/src/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export const TAG_METRIC_TYPE_NUM = 6
export const MAP_METRIC_TYPE_NUM = 7

export const TIME_TAG_TYPE = 'time'
export const TAG_TAG_TYPE = 'tag'
export const MAP_TAG_TYPE = 'map'
export const IP_ARRAY_TAG_TYPE = 'ip_array'
export const RESOURCE_ARRAY_TAG_TYPE = 'resource_array'
Expand Down

0 comments on commit e087c39

Please sign in to comment.