feat(flink): update grammar to match special columnName

This commit is contained in:
Erindcl 2020-12-09 11:08:56 +08:00
parent e67f991ede
commit a9b1e90d73
4 changed files with 1358 additions and 1350 deletions

View File

@ -323,8 +323,7 @@ PLUS_ID_LITERAL: PLUS_ID_LITERAL_FRAG;
fragment EXPONENT_NUM_PART: 'E' [-+]? DEC_DIGIT+; fragment EXPONENT_NUM_PART: 'E' [-+]? DEC_DIGIT+;
fragment ID_LITERAL_FRAG: [A-Z_0-9a-z]*?[A-Z_a-z]+?[A-Z_0-9a-z]*; fragment ID_LITERAL_FRAG: [A-Z_0-9a-z]*?[A-Z_a-z]+?[A-Z_0-9a-z]*;
// fragment PLUS_ID_LITERAL_FRAG: ('a'..'z' | '0'..'9' | '_' | '*' | '@' | '#' | '^' | '$' | '%' | '&')*?[A-Z_a-z]+?('a'..'z' | '0'..'9' | '_' | '*' | '@' | '#' | '^' | '$' | '%' | '&')*; fragment PLUS_ID_LITERAL_FRAG: [A-Z_0-9a-z*@#^$%&{}]*?[A-Z_a-z*@#^$%&{}]+?[A-Z_0-9a-z*@#^$%&{}]*;
fragment PLUS_ID_LITERAL_FRAG: ('a'..'z' | '0'..'9' | '_' | '*' | '@' | '#' | '^' | '$' | '%' | '&')+;
fragment DEC_DIGIT: [0-9]; fragment DEC_DIGIT: [0-9];
fragment DEC_LETTER: [A-Za-z]; fragment DEC_LETTER: [A-Za-z];
fragment DQUOTA_STRING: '"' ( '\\'. | '""' | ~('"'| '\\') )* '"'; fragment DQUOTA_STRING: '"' ( '\\'. | '""' | ~('"'| '\\') )* '"';

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -173,12 +173,11 @@ describe('FlinkSQL Syntax Tests', () => {
expect(result.length).toBe(0); expect(result.length).toBe(0);
}); });
// todo 字段中包含特殊字符 如$符号 内容匹配不准确 test('Test complex sql Statement one', () => {
// test('Test complex sql Statement one', () => { const sql = sqlMockData.sqlStrOne;
// const sql = sqlMockData.sqlStrOne; const result = parser.validate(sql);
// const result = parser.validate(sql); expect(result.length).toBe(0);
// expect(result.length).toBe(0); });
// });
test('Test complex sql Statement two', () => { test('Test complex sql Statement two', () => {
const sql = sqlMockData.sqlStrTwo; const sql = sqlMockData.sqlStrTwo;
const result = parser.validate(sql); const result = parser.validate(sql);