Skip to content

Commit 72971b8

Browse files
committed
fix: build errors
1 parent c4e1a3b commit 72971b8

File tree

2 files changed

+0
-49
lines changed

2 files changed

+0
-49
lines changed

src/features/log/queryResponseBuilder.ts

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,6 @@ export const getGraphDataFrame = (data: any, target: MyQuery, app: string, times
4141

4242
let fields = ['zo_sql_key', 'zo_sql_num'];
4343

44-
// if (app !== 'explore') {
45-
// const columns = getColumnsFromQuery(target.query);
46-
47-
// if (columns.length) {
48-
// fields = columns;
49-
// }
50-
// }
51-
5244
for (let i = 0; i < fields.length; i++) {
5345
if (isTimeField(fields[i], timestampColumn)) {
5446
graphData.addField({
@@ -111,43 +103,3 @@ export const getDefaultDataFrame = (refId: string, visualisationType: PreferredV
111103
fields: [],
112104
});
113105
};
114-
115-
const getColumnsFromQuery = (query: string) => {
116-
// Regular expression pattern to find the select column statements with optional alias
117-
let pattern = /\bselect\b(.+?)\bfrom\b/i;
118-
119-
// Get the selected columns
120-
let match = pattern.exec(query);
121-
122-
// If there's no select statement, return an empty list
123-
if (!match) {
124-
return [];
125-
}
126-
127-
// Split the selected columns by comma, then trim extra whitespace
128-
let selectedColumns = match[1].split(',').map(function (column) {
129-
return column.trim();
130-
});
131-
132-
// Prepare array to store final column names or aliases
133-
let columnNames: any = [];
134-
135-
// Iterate over selected columns
136-
selectedColumns.forEach(function (column) {
137-
// Regular expression pattern to find alias
138-
let aliasPattern = /\s+as\s+(.+)$/i;
139-
140-
// Get the alias
141-
let aliasMatch = aliasPattern.exec(column);
142-
143-
// If alias exists, use that, otherwise use column name
144-
if (aliasMatch) {
145-
// SQL alias may have quotes, strip those.
146-
let stripped = aliasMatch[1].replace(/^['"]|['"]$/g, '');
147-
columnNames.push(stripped);
148-
} else {
149-
columnNames.push(column);
150-
}
151-
});
152-
return columnNames;
153-
};

src/features/query/queryBuilder.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { MyQuery, TimeRange } from 'types';
2-
import { b64EncodeUnicode } from 'utils/zincutils';
32

43
export const buildQuery = (
54
queryData: MyQuery,

0 commit comments

Comments
 (0)