Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
describe('time menu', () => {
const parser = sqlParserFactory(['COUNT']);
it('matches snapshot when menu is opened for column not inside group by', () => {
const timeMenu = (
{}}
/>
);
const { container } = render(timeMenu);
expect(container).toMatchSnapshot();
});
it('matches snapshot when menu is opened for column inside group by', () => {
const timeMenu = (
it('matches snapshot', () => {
const parser = sqlParserFactory(SQL_FUNCTIONS.map(sqlFunction => sqlFunction.name));
const parsedQuery = parser(`SELECT
"language",
COUNT(*) AS "Count", COUNT(DISTINCT "language") AS "dist_language", COUNT(*) FILTER (WHERE "language"= 'xxx') AS "language_filtered_count"
FROM "github"
WHERE "__time" >= CURRENT_TIMESTAMP - INTERVAL '1' DAY AND "language" != 'TypeScript'
GROUP BY 1
HAVING "Count" != 37392
ORDER BY "Count" DESC`);
const queryOutput = (
describe('number menu', () => {
const parser = sqlParserFactory(['COUNT']);
it('matches snapshot when menu is opened for column not inside group by', () => {
const numberMenu = (
{}}
/>
);
const { container } = render(numberMenu);
expect(container).toMatchSnapshot();
});
it('matches snapshot when menu is opened for column inside group by', () => {
const numberMenu = (
describe('string menu', () => {
const parser = sqlParserFactory(['COUNT']);
it('matches snapshot when menu is opened for column not inside group by', () => {
const stringMenu = (
{}}
/>
);
const { container } = render(stringMenu);
expect(container).toMatchSnapshot();
});
it('matches snapshot when menu is opened for column inside group by', () => {
const stringMenu = (
describe('column tree', () => {
const parser = sqlParserFactory(['COUNT']);
it('matches snapshot', () => {
const columnTree = (
{
return parser(`SELECT channel, count(*) as cnt FROM wikipedia GROUP BY 1`);
}}
defaultSchema="druid"
defaultTable="wikipedia"
columnMetadataLoading={false}
columnMetadata={
[
{
TABLE_SCHEMA: 'druid',
TABLE_NAME: 'wikipedia',
COLUMN_NAME: '__time',
QueryManager,
SemiJoinQueryExplanation,
} from '../../utils';
import { ColumnMetadata } from '../../utils/column-metadata';
import { isEmptyContext, QueryContext } from '../../utils/query-context';
import { QueryRecord, QueryRecordUtil } from '../../utils/query-history';
import { ColumnTree } from './column-tree/column-tree';
import { QueryExtraInfo, QueryExtraInfoData } from './query-extra-info/query-extra-info';
import { QueryInput } from './query-input/query-input';
import { QueryOutput } from './query-output/query-output';
import { RunButton } from './run-button/run-button';
import './query-view.scss';
const parserRaw = sqlParserFactory(SQL_FUNCTIONS.map(sqlFunction => sqlFunction.name));
const parser = memoizeOne((sql: string) => {
try {
return parserRaw(sql);
} catch {
return;
}
});
interface QueryWithContext {
queryString: string;
queryContext: QueryContext;
wrapQueryLimit: number | undefined;
}
export interface QueryViewProps {