Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onClick={() => {
onQueryChange(
parsedQuery.addFunctionToGroupBy(
'TIME_FLOOR',
[' '],
[stringFactory(columnName, `"`), stringFactory('PT1H', `'`)],
aliasFactory(`${columnName}_time_floor`),
),
true,
);
}}
/>
'COUNT',
aliasFactory(`${columnName}_filtered_count`),
false,
new FilterClause({
keyword: 'FILTER',
spacing: [' '],
ex: new WhereClause({
keyword: 'WHERE',
spacing: [' '],
filter: new ComparisonExpression({
parens: [],
ex: stringFactory(columnName, '"'),
rhs: new ComparisonExpressionRhs({
parens: [],
op: '=',
rhs: stringFactory('xxx', `'`),
spacing: [' ', ' '],
}),
}),
}),
}),
),
);
}}
/>
onClick={() => {
onQueryChange(
parsedQuery.addFunctionToGroupBy(
'TIME_FLOOR',
[' '],
[stringFactory(columnName, `"`), stringFactory('P1D', `'`)],
aliasFactory(`${columnName}_time_floor`),
),
true,
);
}}
/>
onClick={() => {
onQueryChange(
parsedQuery.addFunctionToGroupBy(
'TIME_FLOOR',
[' '],
[stringFactory(columnName, `"`), stringFactory('P7D', `'`)],
aliasFactory(`${columnName}_time_floor`),
),
true,
);
}}
/>
onClick={() => {
const hourStart = floorHour(now);
onQueryChange(
parsedQuery
.removeFilter(columnName)
.filterRow(dateToTimestamp(hourStart), stringFactory(columnName, `"`), '<=')
.filterRow(columnName, dateToTimestamp(nextHour(hourStart)), '<'),
true,
);
}}
/>
onClick={() => {
onQueryChange(
parsedQuery.addAggregateColumn(
refExpressionFactory('*'),
'COUNT',
aliasFactory(`${columnName}_filtered_count`),
false,
new FilterClause({
keyword: 'FILTER',
spacing: [' '],
ex: new WhereClause({
keyword: 'WHERE',
spacing: [' '],
filter: new ComparisonExpression({
parens: [],
ex: stringFactory(columnName, '"'),
rhs: new ComparisonExpressionRhs({
parens: [],
op: '=',
rhs: stringFactory('xxx', `'`),
spacing: [' ', ' '],
}),
}),
}),
}),
),
);
}}
/>
onClick={() => {
onQueryChange(
parsedQuery.addFunctionToGroupBy(
'SUBSTRING',
[' ', ' '],
[stringFactory(columnName, `"`), 1, 2],
aliasFactory(`${columnName}_substring`),
),
true,
);
}}
/>