Skip to content

Commit

Permalink
[bugfix] querier datasource, Derivative can use and not use in `HAV…
Browse files Browse the repository at this point in the history
…ING`

**Phenomenon and reproduction steps**

none

**Root cause and solution**

none

**Impactions**

none

**Test method**

none

**Affected branch(es)**

- main
- v6.4

**Checklist**

- [ ] Dependencies update required
- [ ] Common bug (similar problem in other repo)
  • Loading branch information
twou12031 committed Jan 11, 2024
1 parent 4de123c commit c19a9b3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions deepflow-querier-datasource/src/QueryEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -525,9 +525,9 @@ export class QueryEditor extends PureComponent<Props> {
}
}

derivativeChecker(select: BasicData[]) {
const _select = select.filter((e: BasicData) => {
return e.type === 'metric' && e.key
derivativeChecker(select: BasicData[], having: BasicData[]) {
const _select = [...select, ...having].filter((e: BasicData) => {
return e.type === 'metric' && e.key && e.func
})
if (select.length >= 2) {
const hasDerivative = _select.find((e: BasicData) => {
Expand Down Expand Up @@ -563,7 +563,7 @@ export class QueryEditor extends PureComponent<Props> {
dataObj.having = queryCondsFilter(dataObj?.having, 'metric')
const { appType, groupBy, select, interval, where, having, orderBy } = dataObj
if (!stopQuery) {
this.derivativeChecker(select as BasicDataWithId[])
this.derivativeChecker(select as BasicDataWithId[], dataObj.having)
const groupByKeys = (groupBy as BasicDataWithId[])
.filter((item: any) => {
return item.key
Expand Down

0 comments on commit c19a9b3

Please sign in to comment.