chroe: devops (#180)
* ci: add dependencies about lint tool * ci: replace eslint with prettier * ci: add husky, cz and commitlint * style: lint fix via prettier * ci: add prettier and check-types to github workflow '
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
import { ParseTreeListener } from 'antlr4ts/tree';
|
||||
import { ProgramContext } from '../../../src/lib/hive/HiveSqlParser';
|
||||
import { HiveSqlParserListener } from '../../../src/lib/hive/HiveSqlParserListener';
|
||||
import HiveSQL from '../../../src/parser/hive';
|
||||
|
||||
|
||||
describe('HiveSQL Listener Tests', () => {
|
||||
const parser = new HiveSQL();
|
||||
test('Listener enterSelectList', async () => {
|
||||
@ -16,9 +16,9 @@ describe('HiveSQL Listener Tests', () => {
|
||||
result = ctx.text;
|
||||
}
|
||||
}
|
||||
const listenTableName: any = new MyListener();
|
||||
const listenTableName = new MyListener();
|
||||
|
||||
await parser.listen(listenTableName, parserTree as ProgramContext);
|
||||
await parser.listen(listenTableName as ParseTreeListener, parserTree as ProgramContext);
|
||||
expect(result).toBe(expectTableName.toUpperCase());
|
||||
});
|
||||
test('Listener enterCreateTable', async () => {
|
||||
@ -30,9 +30,9 @@ describe('HiveSQL Listener Tests', () => {
|
||||
result = ctx.text;
|
||||
}
|
||||
}
|
||||
const listenTableName: any = new MyListener();
|
||||
const listenTableName = new MyListener();
|
||||
|
||||
await parser.listen(listenTableName, parserTree as ProgramContext);
|
||||
await parser.listen(listenTableName as ParseTreeListener, parserTree as ProgramContext);
|
||||
expect(result).toBe('DROPTABLETABLE_NAME');
|
||||
});
|
||||
});
|
||||
|
@ -1,9 +1,12 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { CaretPosition, SyntaxContextType } from '../../../../src/parser/common/basic-parser-types';
|
||||
import HiveSQL from '../../../../src/parser/hive'
|
||||
import HiveSQL from '../../../../src/parser/hive';
|
||||
|
||||
const syntaxSql = fs.readFileSync(path.join(__dirname, 'fixtures', 'syntaxSuggestion.sql'), 'utf-8');
|
||||
const syntaxSql = fs.readFileSync(
|
||||
path.join(__dirname, 'fixtures', 'syntaxSuggestion.sql'),
|
||||
'utf-8'
|
||||
);
|
||||
|
||||
describe('Hive SQL Syntax Suggestion', () => {
|
||||
const parser = new HiveSQL();
|
||||
@ -17,131 +20,140 @@ describe('Hive SQL Syntax Suggestion', () => {
|
||||
test('Insert table ', () => {
|
||||
const pos: CaretPosition = {
|
||||
lineNumber: 1,
|
||||
column: 18
|
||||
}
|
||||
column: 18,
|
||||
};
|
||||
const syntaxes = parser.getSuggestionAtCaretPosition(syntaxSql, pos)?.syntax;
|
||||
const suggestion = syntaxes?.find(syn => syn.syntaxContextType === SyntaxContextType.TABLE);
|
||||
const suggestion = syntaxes?.find(
|
||||
(syn) => syn.syntaxContextType === SyntaxContextType.TABLE
|
||||
);
|
||||
|
||||
expect(suggestion).not.toBeUndefined();
|
||||
expect(suggestion?.wordRanges.map(token => token.text))
|
||||
.toEqual([ 'db', '.', 'tb' ])
|
||||
expect(suggestion?.wordRanges.map((token) => token.text)).toEqual(['db', '.', 'tb']);
|
||||
});
|
||||
|
||||
test('Select table ', () => {
|
||||
const pos: CaretPosition = {
|
||||
lineNumber: 3,
|
||||
column: 18
|
||||
}
|
||||
column: 18,
|
||||
};
|
||||
const syntaxes = parser.getSuggestionAtCaretPosition(syntaxSql, pos)?.syntax;
|
||||
const suggestion = syntaxes?.find(syn => syn.syntaxContextType === SyntaxContextType.TABLE);
|
||||
const suggestion = syntaxes?.find(
|
||||
(syn) => syn.syntaxContextType === SyntaxContextType.TABLE
|
||||
);
|
||||
|
||||
expect(suggestion).not.toBeUndefined();
|
||||
expect(suggestion?.wordRanges.map(token => token.text))
|
||||
.toEqual([ 'db', '.' ])
|
||||
expect(suggestion?.wordRanges.map((token) => token.text)).toEqual(['db', '.']);
|
||||
});
|
||||
|
||||
test('Create table ', () => {
|
||||
const pos: CaretPosition = {
|
||||
lineNumber: 5,
|
||||
column: 17
|
||||
}
|
||||
column: 17,
|
||||
};
|
||||
const syntaxes = parser.getSuggestionAtCaretPosition(syntaxSql, pos)?.syntax;
|
||||
const suggestion = syntaxes?.find(syn => syn.syntaxContextType === SyntaxContextType.TABLE_CREATE);
|
||||
const suggestion = syntaxes?.find(
|
||||
(syn) => syn.syntaxContextType === SyntaxContextType.TABLE_CREATE
|
||||
);
|
||||
|
||||
expect(suggestion).not.toBeUndefined();
|
||||
expect(suggestion?.wordRanges.map(token => token.text))
|
||||
.toEqual([ 'db', '.' ])
|
||||
expect(suggestion?.wordRanges.map((token) => token.text)).toEqual(['db', '.']);
|
||||
});
|
||||
|
||||
test('DROP table ', () => {
|
||||
const pos: CaretPosition = {
|
||||
lineNumber: 7,
|
||||
column: 26
|
||||
}
|
||||
column: 26,
|
||||
};
|
||||
const syntaxes = parser.getSuggestionAtCaretPosition(syntaxSql, pos)?.syntax;
|
||||
const suggestion = syntaxes?.find(syn => syn.syntaxContextType === SyntaxContextType.TABLE);
|
||||
const suggestion = syntaxes?.find(
|
||||
(syn) => syn.syntaxContextType === SyntaxContextType.TABLE
|
||||
);
|
||||
|
||||
expect(suggestion).not.toBeUndefined();
|
||||
expect(suggestion?.wordRanges.map(token => token.text))
|
||||
.toEqual([ 'db', '.', 'a' ])
|
||||
expect(suggestion?.wordRanges.map((token) => token.text)).toEqual(['db', '.', 'a']);
|
||||
});
|
||||
|
||||
test('Create view ', () => {
|
||||
const pos: CaretPosition = {
|
||||
lineNumber: 9,
|
||||
column: 28
|
||||
}
|
||||
column: 28,
|
||||
};
|
||||
const syntaxes = parser.getSuggestionAtCaretPosition(syntaxSql, pos)?.syntax;
|
||||
const suggestion = syntaxes?.find(syn => syn.syntaxContextType === SyntaxContextType.VIEW_CREATE);
|
||||
const suggestion = syntaxes?.find(
|
||||
(syn) => syn.syntaxContextType === SyntaxContextType.VIEW_CREATE
|
||||
);
|
||||
|
||||
expect(suggestion).not.toBeUndefined();
|
||||
expect(suggestion?.wordRanges.map(token => token.text))
|
||||
.toEqual([ 'db', '.', 'v' ])
|
||||
expect(suggestion?.wordRanges.map((token) => token.text)).toEqual(['db', '.', 'v']);
|
||||
});
|
||||
|
||||
test('Drop view ', () => {
|
||||
const pos: CaretPosition = {
|
||||
lineNumber: 11,
|
||||
column: 15
|
||||
}
|
||||
column: 15,
|
||||
};
|
||||
const syntaxes = parser.getSuggestionAtCaretPosition(syntaxSql, pos)?.syntax;
|
||||
const suggestion = syntaxes?.find(syn => syn.syntaxContextType === SyntaxContextType.VIEW);
|
||||
const suggestion = syntaxes?.find(
|
||||
(syn) => syn.syntaxContextType === SyntaxContextType.VIEW
|
||||
);
|
||||
|
||||
expect(suggestion).not.toBeUndefined();
|
||||
expect(suggestion?.wordRanges.map(token => token.text))
|
||||
.toEqual([ 'db', '.', 'v' ])
|
||||
expect(suggestion?.wordRanges.map((token) => token.text)).toEqual(['db', '.', 'v']);
|
||||
});
|
||||
|
||||
test('Create function ', () => {
|
||||
const pos: CaretPosition = {
|
||||
lineNumber: 13,
|
||||
column: 20
|
||||
}
|
||||
column: 20,
|
||||
};
|
||||
const syntaxes = parser.getSuggestionAtCaretPosition(syntaxSql, pos)?.syntax;
|
||||
const suggestion = syntaxes?.find(syn => syn.syntaxContextType === SyntaxContextType.FUNCTION_CREATE);
|
||||
const suggestion = syntaxes?.find(
|
||||
(syn) => syn.syntaxContextType === SyntaxContextType.FUNCTION_CREATE
|
||||
);
|
||||
|
||||
expect(suggestion).not.toBeUndefined();
|
||||
expect(suggestion?.wordRanges.map(token => token.text))
|
||||
.toEqual([ 'fn1' ])
|
||||
expect(suggestion?.wordRanges.map((token) => token.text)).toEqual(['fn1']);
|
||||
});
|
||||
|
||||
test('Use function', () => {
|
||||
const pos: CaretPosition = {
|
||||
lineNumber: 15,
|
||||
column: 27
|
||||
}
|
||||
column: 27,
|
||||
};
|
||||
const syntaxes = parser.getSuggestionAtCaretPosition(syntaxSql, pos)?.syntax;
|
||||
const suggestion = syntaxes?.find(syn => syn.syntaxContextType === SyntaxContextType.FUNCTION);
|
||||
const suggestion = syntaxes?.find(
|
||||
(syn) => syn.syntaxContextType === SyntaxContextType.FUNCTION
|
||||
);
|
||||
|
||||
expect(suggestion).not.toBeUndefined();
|
||||
expect(suggestion?.wordRanges.map(token => token.text))
|
||||
.toEqual([ 'calculate_age' ])
|
||||
expect(suggestion?.wordRanges.map((token) => token.text)).toEqual(['calculate_age']);
|
||||
});
|
||||
|
||||
test('Create database', () => {
|
||||
const pos: CaretPosition = {
|
||||
lineNumber: 17,
|
||||
column: 19
|
||||
}
|
||||
column: 19,
|
||||
};
|
||||
const syntaxes = parser.getSuggestionAtCaretPosition(syntaxSql, pos)?.syntax;
|
||||
const suggestion = syntaxes?.find(syn => syn.syntaxContextType === SyntaxContextType.DATABASE_CREATE);
|
||||
const suggestion = syntaxes?.find(
|
||||
(syn) => syn.syntaxContextType === SyntaxContextType.DATABASE_CREATE
|
||||
);
|
||||
|
||||
expect(suggestion).not.toBeUndefined();
|
||||
expect(suggestion?.wordRanges.map(token => token.text))
|
||||
.toEqual([ 'db' ])
|
||||
expect(suggestion?.wordRanges.map((token) => token.text)).toEqual(['db']);
|
||||
});
|
||||
|
||||
test('Drop database', () => {
|
||||
const pos: CaretPosition = {
|
||||
lineNumber: 19,
|
||||
column: 26
|
||||
}
|
||||
column: 26,
|
||||
};
|
||||
const syntaxes = parser.getSuggestionAtCaretPosition(syntaxSql, pos)?.syntax;
|
||||
const suggestion = syntaxes?.find(syn => syn.syntaxContextType === SyntaxContextType.DATABASE);
|
||||
const suggestion = syntaxes?.find(
|
||||
(syn) => syn.syntaxContextType === SyntaxContextType.DATABASE
|
||||
);
|
||||
|
||||
expect(suggestion).not.toBeUndefined();
|
||||
expect(suggestion?.wordRanges.map(token => token.text))
|
||||
.toEqual([ 'sch' ])
|
||||
expect(suggestion?.wordRanges.map((token) => token.text)).toEqual(['sch']);
|
||||
});
|
||||
|
||||
})
|
||||
});
|
||||
|
@ -1,232 +1,191 @@
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
import { CaretPosition } from "../../../../src/parser/common/basic-parser-types";
|
||||
import HiveSQL from "../../../../src/parser/hive";
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { CaretPosition } from '../../../../src/parser/common/basic-parser-types';
|
||||
import HiveSQL from '../../../../src/parser/hive';
|
||||
|
||||
const tokenSql = fs.readFileSync(
|
||||
path.join(__dirname, "fixtures", "tokenSuggestion.sql"),
|
||||
"utf-8"
|
||||
);
|
||||
const tokenSql = fs.readFileSync(path.join(__dirname, 'fixtures', 'tokenSuggestion.sql'), 'utf-8');
|
||||
|
||||
describe("Hive SQL Syntax Suggestion", () => {
|
||||
describe('Hive SQL Syntax Suggestion', () => {
|
||||
const parser = new HiveSQL();
|
||||
|
||||
test("After ALTER", () => {
|
||||
test('After ALTER', () => {
|
||||
const pos: CaretPosition = {
|
||||
lineNumber: 1,
|
||||
column: 7,
|
||||
};
|
||||
const suggestion = parser.getSuggestionAtCaretPosition(
|
||||
tokenSql,
|
||||
pos
|
||||
)?.keywords;
|
||||
const suggestion = parser.getSuggestionAtCaretPosition(tokenSql, pos)?.keywords;
|
||||
expect(suggestion).toEqual([
|
||||
"APPLICATION",
|
||||
"GROUP",
|
||||
"USER",
|
||||
"POOL",
|
||||
"TRIGGER",
|
||||
"RESOURCE",
|
||||
"SCHEDULED",
|
||||
"INDEX",
|
||||
"CONNECTOR",
|
||||
"DATABASE",
|
||||
"SCHEMA",
|
||||
"MATERIALIZED",
|
||||
"VIEW",
|
||||
"TABLE",
|
||||
'APPLICATION',
|
||||
'GROUP',
|
||||
'USER',
|
||||
'POOL',
|
||||
'TRIGGER',
|
||||
'RESOURCE',
|
||||
'SCHEDULED',
|
||||
'INDEX',
|
||||
'CONNECTOR',
|
||||
'DATABASE',
|
||||
'SCHEMA',
|
||||
'MATERIALIZED',
|
||||
'VIEW',
|
||||
'TABLE',
|
||||
]);
|
||||
});
|
||||
|
||||
test("After CREATE", () => {
|
||||
test('After CREATE', () => {
|
||||
const pos: CaretPosition = {
|
||||
lineNumber: 3,
|
||||
column: 8,
|
||||
};
|
||||
const suggestion = parser.getSuggestionAtCaretPosition(
|
||||
tokenSql,
|
||||
pos
|
||||
)?.keywords;
|
||||
const suggestion = parser.getSuggestionAtCaretPosition(tokenSql, pos)?.keywords;
|
||||
expect(suggestion).toEqual([
|
||||
"CONNECTOR",
|
||||
"APPLICATION",
|
||||
"GROUP",
|
||||
"USER",
|
||||
"POOL",
|
||||
"TRIGGER",
|
||||
"RESOURCE",
|
||||
"ROLE",
|
||||
"INDEX",
|
||||
"TEMPORARY",
|
||||
"FUNCTION",
|
||||
"SCHEDULED",
|
||||
"MATERIALIZED",
|
||||
"VIEW",
|
||||
"OR",
|
||||
"MANAGED",
|
||||
"TABLE",
|
||||
"EXTERNAL",
|
||||
"TRANSACTIONAL",
|
||||
"REMOTE",
|
||||
"DATABASE",
|
||||
"SCHEMA",
|
||||
'CONNECTOR',
|
||||
'APPLICATION',
|
||||
'GROUP',
|
||||
'USER',
|
||||
'POOL',
|
||||
'TRIGGER',
|
||||
'RESOURCE',
|
||||
'ROLE',
|
||||
'INDEX',
|
||||
'TEMPORARY',
|
||||
'FUNCTION',
|
||||
'SCHEDULED',
|
||||
'MATERIALIZED',
|
||||
'VIEW',
|
||||
'OR',
|
||||
'MANAGED',
|
||||
'TABLE',
|
||||
'EXTERNAL',
|
||||
'TRANSACTIONAL',
|
||||
'REMOTE',
|
||||
'DATABASE',
|
||||
'SCHEMA',
|
||||
]);
|
||||
});
|
||||
|
||||
test("After DELETE", () => {
|
||||
test('After DELETE', () => {
|
||||
const pos: CaretPosition = {
|
||||
lineNumber: 5,
|
||||
column: 8,
|
||||
};
|
||||
const suggestion = parser.getSuggestionAtCaretPosition(
|
||||
tokenSql,
|
||||
pos
|
||||
)?.keywords;
|
||||
const suggestion = parser.getSuggestionAtCaretPosition(tokenSql, pos)?.keywords;
|
||||
expect(suggestion).toEqual(['FROM']);
|
||||
});
|
||||
|
||||
test("After DESCRIBE", () => {
|
||||
test('After DESCRIBE', () => {
|
||||
const pos: CaretPosition = {
|
||||
lineNumber: 7,
|
||||
column: 10,
|
||||
};
|
||||
const suggestion = parser.getSuggestionAtCaretPosition(
|
||||
tokenSql,
|
||||
pos
|
||||
)?.keywords;
|
||||
const suggestion = parser.getSuggestionAtCaretPosition(tokenSql, pos)?.keywords;
|
||||
expect(suggestion).toEqual([
|
||||
"EXTENDED",
|
||||
"FORMATTED",
|
||||
"FUNCTION",
|
||||
"CONNECTOR",
|
||||
"DATABASE",
|
||||
"SCHEMA",
|
||||
'EXTENDED',
|
||||
'FORMATTED',
|
||||
'FUNCTION',
|
||||
'CONNECTOR',
|
||||
'DATABASE',
|
||||
'SCHEMA',
|
||||
]);
|
||||
});
|
||||
|
||||
test("After DROP", () => {
|
||||
test('After DROP', () => {
|
||||
const pos: CaretPosition = {
|
||||
lineNumber: 9,
|
||||
column: 6,
|
||||
};
|
||||
const suggestion = parser.getSuggestionAtCaretPosition(
|
||||
tokenSql,
|
||||
pos
|
||||
)?.keywords;
|
||||
const suggestion = parser.getSuggestionAtCaretPosition(tokenSql, pos)?.keywords;
|
||||
expect(suggestion).toEqual([
|
||||
"CONNECTOR",
|
||||
"APPLICATION",
|
||||
"GROUP",
|
||||
"USER",
|
||||
"POOL",
|
||||
"TRIGGER",
|
||||
"RESOURCE",
|
||||
"ROLE",
|
||||
"INDEX",
|
||||
"TEMPORARY",
|
||||
"FUNCTION",
|
||||
"MATERIALIZED",
|
||||
"VIEW",
|
||||
"SCHEDULED",
|
||||
"TABLE",
|
||||
"DATABASE",
|
||||
"SCHEMA",
|
||||
'CONNECTOR',
|
||||
'APPLICATION',
|
||||
'GROUP',
|
||||
'USER',
|
||||
'POOL',
|
||||
'TRIGGER',
|
||||
'RESOURCE',
|
||||
'ROLE',
|
||||
'INDEX',
|
||||
'TEMPORARY',
|
||||
'FUNCTION',
|
||||
'MATERIALIZED',
|
||||
'VIEW',
|
||||
'SCHEDULED',
|
||||
'TABLE',
|
||||
'DATABASE',
|
||||
'SCHEMA',
|
||||
]);
|
||||
});
|
||||
|
||||
test("After EXPORT", () => {
|
||||
test('After EXPORT', () => {
|
||||
const pos: CaretPosition = {
|
||||
lineNumber: 11,
|
||||
column: 8,
|
||||
};
|
||||
const suggestion = parser.getSuggestionAtCaretPosition(
|
||||
tokenSql,
|
||||
pos
|
||||
)?.keywords;
|
||||
const suggestion = parser.getSuggestionAtCaretPosition(tokenSql, pos)?.keywords;
|
||||
expect(suggestion).toEqual(['TABLE']);
|
||||
});
|
||||
|
||||
test("After IMPORT", () => {
|
||||
test('After IMPORT', () => {
|
||||
const pos: CaretPosition = {
|
||||
lineNumber: 13,
|
||||
column: 8,
|
||||
};
|
||||
const suggestion = parser.getSuggestionAtCaretPosition(
|
||||
tokenSql,
|
||||
pos
|
||||
)?.keywords;
|
||||
expect(suggestion).toEqual([
|
||||
"FROM",
|
||||
"TABLE",
|
||||
"EXTERNAL",
|
||||
]);
|
||||
const suggestion = parser.getSuggestionAtCaretPosition(tokenSql, pos)?.keywords;
|
||||
expect(suggestion).toEqual(['FROM', 'TABLE', 'EXTERNAL']);
|
||||
});
|
||||
|
||||
test("After INSERT", () => {
|
||||
test('After INSERT', () => {
|
||||
const pos: CaretPosition = {
|
||||
lineNumber: 15,
|
||||
column: 8,
|
||||
};
|
||||
const suggestion = parser.getSuggestionAtCaretPosition(
|
||||
tokenSql,
|
||||
pos
|
||||
)?.keywords;
|
||||
expect(suggestion).toEqual([
|
||||
"INTO",
|
||||
"OVERWRITE",
|
||||
]);
|
||||
const suggestion = parser.getSuggestionAtCaretPosition(tokenSql, pos)?.keywords;
|
||||
expect(suggestion).toEqual(['INTO', 'OVERWRITE']);
|
||||
});
|
||||
|
||||
test("After LOAD", () => {
|
||||
test('After LOAD', () => {
|
||||
const pos: CaretPosition = {
|
||||
lineNumber: 17,
|
||||
column: 6,
|
||||
};
|
||||
const suggestion = parser.getSuggestionAtCaretPosition(
|
||||
tokenSql,
|
||||
pos
|
||||
)?.keywords;
|
||||
expect(suggestion).toEqual(["DATA"
|
||||
]);
|
||||
const suggestion = parser.getSuggestionAtCaretPosition(tokenSql, pos)?.keywords;
|
||||
expect(suggestion).toEqual(['DATA']);
|
||||
});
|
||||
|
||||
test("After SHOW", () => {
|
||||
test('After SHOW', () => {
|
||||
const pos: CaretPosition = {
|
||||
lineNumber: 19,
|
||||
column: 6,
|
||||
};
|
||||
const suggestion = parser.getSuggestionAtCaretPosition(
|
||||
tokenSql,
|
||||
pos
|
||||
)?.keywords;
|
||||
const suggestion = parser.getSuggestionAtCaretPosition(tokenSql, pos)?.keywords;
|
||||
expect(suggestion).toEqual([
|
||||
"CURRENT",
|
||||
"ROLES",
|
||||
"PRINCIPALS",
|
||||
"ROLE",
|
||||
"GRANT",
|
||||
"INDEX",
|
||||
"INDEXES",
|
||||
"FORMATTED",
|
||||
"CONNECTORS",
|
||||
"RESOURCE",
|
||||
"CONF",
|
||||
"TRANSACTIONS",
|
||||
"COMPACTIONS",
|
||||
"LOCKS",
|
||||
"TBLPROPERTIES",
|
||||
"TABLE",
|
||||
"CREATE",
|
||||
"PARTITIONS",
|
||||
"FUNCTIONS",
|
||||
"COLUMNS",
|
||||
"SORTED",
|
||||
"MATERIALIZED",
|
||||
"VIEWS",
|
||||
"TABLES",
|
||||
"EXTENDED",
|
||||
"DATABASES",
|
||||
"SCHEMAS",
|
||||
'CURRENT',
|
||||
'ROLES',
|
||||
'PRINCIPALS',
|
||||
'ROLE',
|
||||
'GRANT',
|
||||
'INDEX',
|
||||
'INDEXES',
|
||||
'FORMATTED',
|
||||
'CONNECTORS',
|
||||
'RESOURCE',
|
||||
'CONF',
|
||||
'TRANSACTIONS',
|
||||
'COMPACTIONS',
|
||||
'LOCKS',
|
||||
'TBLPROPERTIES',
|
||||
'TABLE',
|
||||
'CREATE',
|
||||
'PARTITIONS',
|
||||
'FUNCTIONS',
|
||||
'COLUMNS',
|
||||
'SORTED',
|
||||
'MATERIALIZED',
|
||||
'VIEWS',
|
||||
'TABLES',
|
||||
'EXTENDED',
|
||||
'DATABASES',
|
||||
'SCHEMAS',
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
@ -12,7 +12,7 @@ const features = {
|
||||
indexes: readSQL(__dirname, 'createIndex.sql'),
|
||||
macros: readSQL(__dirname, 'createMacro.sql'),
|
||||
connectors: readSQL(__dirname, 'createConnector.sql'),
|
||||
scheduledQueries: readSQL(__dirname, 'createScheduledQuery.sql')
|
||||
scheduledQueries: readSQL(__dirname, 'createScheduledQuery.sql'),
|
||||
};
|
||||
|
||||
describe('HiveSQL Create Syntax Tests', () => {
|
||||
|
@ -5,7 +5,7 @@ const parser = new HiveSQL();
|
||||
|
||||
const features = {
|
||||
drops: readSQL(__dirname, 'drop.sql'),
|
||||
reloads: readSQL(__dirname, 'reload.sql')
|
||||
reloads: readSQL(__dirname, 'reload.sql'),
|
||||
};
|
||||
|
||||
describe('HiveSQL Drop Syntax Tests', () => {
|
||||
|
@ -2,7 +2,7 @@ import HiveSQL from '../../../../src/parser/hive';
|
||||
import { readSQL } from '../../../helper';
|
||||
|
||||
const features = {
|
||||
exports: readSQL(__dirname, 'export.sql')
|
||||
exports: readSQL(__dirname, 'export.sql'),
|
||||
};
|
||||
|
||||
describe('HiveSQL Export Syntax Tests', () => {
|
||||
@ -14,4 +14,3 @@ describe('HiveSQL Export Syntax Tests', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import HiveSQL from '../../../../src/parser/hive';
|
||||
import { readSQL } from "../../../helper";
|
||||
import { readSQL } from '../../../helper';
|
||||
|
||||
const features = {
|
||||
imports: readSQL(__dirname, 'import.sql')
|
||||
imports: readSQL(__dirname, 'import.sql'),
|
||||
};
|
||||
|
||||
describe('HiveSQL Import Syntax Tests', () => {
|
||||
|
@ -5,7 +5,7 @@ const parser = new HiveSQL();
|
||||
|
||||
const features = {
|
||||
insertFromQueries: readSQL(__dirname, 'insertFromQuery.sql'),
|
||||
insertFromValues: readSQL(__dirname, 'insertFormValues.sql')
|
||||
insertFromValues: readSQL(__dirname, 'insertFormValues.sql'),
|
||||
};
|
||||
|
||||
describe('HiveSQL Insert Syntax Tests', () => {
|
||||
|
@ -15,7 +15,6 @@ describe('HiveSQL Visitor Tests', () => {
|
||||
test('Visitor visitTableName', () => {
|
||||
let result = '';
|
||||
class MyVisitor extends AbstractParseTreeVisitor<any> implements HiveSqlParserVisitor<any> {
|
||||
|
||||
defaultResult() {
|
||||
return result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user