dt-sql-parser 4.5.1-beta.1 → 4.5.1-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,6 +8,13 @@ import { MysqlErrorListener } from './mysqlErrorListener';
8
8
  import { MysqlSplitListener } from './mysqlSplitListener';
9
9
  import { MySqlSemanticContextCollector } from '../mysql/mysqlSemanticContextCollector';
10
10
  export { MySqlEntityCollector, MysqlSplitListener };
11
+ const ALLOW_EMPTY_COLUMN_PARENT_RULES = new Set([
12
+ MySqlParser.RULE_joinSpec,
13
+ MySqlParser.RULE_fromClause,
14
+ MySqlParser.RULE_orderByExpression,
15
+ MySqlParser.RULE_groupByItem,
16
+ MySqlParser.RULE_havingClause,
17
+ ]);
11
18
  export class MySQL extends BasicSQL {
12
19
  constructor() {
13
20
  super(...arguments);
@@ -96,11 +103,7 @@ export class MySQL extends BasicSQL {
96
103
  break;
97
104
  }
98
105
  case MySqlParser.RULE_columnNamePathAllowEmpty: {
99
- if (candidateRule.ruleList.includes(MySqlParser.RULE_joinSpec) ||
100
- candidateRule.ruleList.includes(MySqlParser.RULE_fromClause) ||
101
- candidateRule.ruleList.includes(MySqlParser.RULE_orderByExpression) ||
102
- candidateRule.ruleList.includes(MySqlParser.RULE_groupByItem) ||
103
- candidateRule.ruleList.includes(MySqlParser.RULE_havingClause)) {
106
+ if (candidateRule.ruleList.some((rule) => ALLOW_EMPTY_COLUMN_PARENT_RULES.has(rule))) {
104
107
  syntaxContextType = EntityContextType.COLUMN;
105
108
  }
106
109
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dt-sql-parser",
3
- "version": "4.5.1-beta.1",
3
+ "version": "4.5.1-beta.2",
4
4
  "authors": "DTStack Corporation",
5
5
  "description": "SQL Parsers for BigData, built with antlr4",
6
6
  "keywords": [