Skip to content

Commit 8bf15d9

Browse files
committed
fix: added full sql mode
1 parent 9568342 commit 8bf15d9

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/datasource.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ export class DataSource
6767
this.resetQueryCache();
6868
});
6969
}
70+
71+
if (target?.refId?.includes(REF_ID_STARTER_LOG_VOLUME) && target.sqlMode) {
72+
return getGraphDataFrame({}, target);
73+
}
74+
7075
this.cachedQuery.requestQuery = JSON.stringify(reqData);
7176
this.cachedQuery.isFetching = true;
7277
return this.doRequest(target, reqData)

src/features/query/queryBuilder.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ export const buildQuery = (queryData: MyQuery, timestamps: TimeRange, streamFiel
6666

6767
if (queryData.sqlMode) {
6868
req.query.sql = queryData.query;
69+
req.query['sql_mode'] = 'full';
70+
delete req.aggs;
6971
}
7072

7173
if (!queryData.sqlMode) {
@@ -105,7 +107,9 @@ export const buildQuery = (queryData: MyQuery, timestamps: TimeRange, streamFiel
105107

106108
req['encoding'] = 'base64';
107109
req.query.sql = b64EncodeUnicode(req.query.sql);
108-
req.aggs.histogram = b64EncodeUnicode(req.aggs.histogram);
110+
if (!queryData.sqlMode) {
111+
req.aggs.histogram = b64EncodeUnicode(req.aggs.histogram);
112+
}
109113

110114
return req;
111115
} catch (e) {

0 commit comments

Comments
 (0)