Просмотр исходного кода

HUE-9429 [editor] Remove intermediary parser rules for each statement type to improve pluggability

Johan Ahlen 5 лет назад
Родитель
Сommit
954aa6bc9b
44 измененных файлов с 39 добавлено и 78 удалено
  1. 0 8
      desktop/core/src/desktop/js/parse/jison/sql/generic/alter/alter_common.jison
  2. 2 2
      desktop/core/src/desktop/js/parse/jison/sql/generic/alter/alter_table.jison
  3. 2 2
      desktop/core/src/desktop/js/parse/jison/sql/generic/alter/alter_view.jison
  4. 0 8
      desktop/core/src/desktop/js/parse/jison/sql/generic/create/create_common.jison
  5. 2 2
      desktop/core/src/desktop/js/parse/jison/sql/generic/create/create_database.jison
  6. 1 1
      desktop/core/src/desktop/js/parse/jison/sql/generic/create/create_role.jison
  7. 2 2
      desktop/core/src/desktop/js/parse/jison/sql/generic/create/create_table.jison
  8. 2 2
      desktop/core/src/desktop/js/parse/jison/sql/generic/create/create_view.jison
  9. 0 8
      desktop/core/src/desktop/js/parse/jison/sql/generic/drop/drop_common.jison
  10. 2 2
      desktop/core/src/desktop/js/parse/jison/sql/generic/drop/drop_database.jison
  11. 1 1
      desktop/core/src/desktop/js/parse/jison/sql/generic/drop/drop_role.jison
  12. 2 2
      desktop/core/src/desktop/js/parse/jison/sql/generic/drop/drop_table.jison
  13. 2 2
      desktop/core/src/desktop/js/parse/jison/sql/generic/drop/drop_view.jison
  14. 1 1
      desktop/core/src/desktop/js/parse/jison/sql/generic/set/set_all.jison
  15. 0 4
      desktop/core/src/desktop/js/parse/jison/sql/generic/set/set_common.jison
  16. 1 1
      desktop/core/src/desktop/js/parse/jison/sql/generic/set/set_option.jison
  17. 0 8
      desktop/core/src/desktop/js/parse/jison/sql/impala/alter/alter_common.jison
  18. 2 2
      desktop/core/src/desktop/js/parse/jison/sql/impala/alter/alter_database.jison
  19. 2 2
      desktop/core/src/desktop/js/parse/jison/sql/impala/alter/alter_table.jison
  20. 2 2
      desktop/core/src/desktop/js/parse/jison/sql/impala/alter/alter_view.jison
  21. 2 2
      desktop/core/src/desktop/js/parse/jison/sql/impala/create/create_aggregate_function.jison
  22. 0 4
      desktop/core/src/desktop/js/parse/jison/sql/impala/create/create_common.jison
  23. 2 2
      desktop/core/src/desktop/js/parse/jison/sql/impala/create/create_database.jison
  24. 2 2
      desktop/core/src/desktop/js/parse/jison/sql/impala/create/create_function.jison
  25. 1 1
      desktop/core/src/desktop/js/parse/jison/sql/impala/create/create_role.jison
  26. 2 2
      desktop/core/src/desktop/js/parse/jison/sql/impala/create/create_table.jison
  27. 2 2
      desktop/core/src/desktop/js/parse/jison/sql/impala/create/create_view.jison
  28. 0 0
      desktop/core/src/desktop/js/parse/sql/calcite/calciteAutocompleteParser.js
  29. 0 0
      desktop/core/src/desktop/js/parse/sql/calcite/calciteSyntaxParser.js
  30. 0 0
      desktop/core/src/desktop/js/parse/sql/druid/druidAutocompleteParser.js
  31. 0 0
      desktop/core/src/desktop/js/parse/sql/druid/druidSyntaxParser.js
  32. 0 0
      desktop/core/src/desktop/js/parse/sql/elasticsearch/elasticsearchAutocompleteParser.js
  33. 0 0
      desktop/core/src/desktop/js/parse/sql/elasticsearch/elasticsearchSyntaxParser.js
  34. 0 0
      desktop/core/src/desktop/js/parse/sql/flink/flinkAutocompleteParser.js
  35. 0 0
      desktop/core/src/desktop/js/parse/sql/flink/flinkSyntaxParser.js
  36. 0 0
      desktop/core/src/desktop/js/parse/sql/generic/genericAutocompleteParser.js
  37. 0 0
      desktop/core/src/desktop/js/parse/sql/generic/genericSyntaxParser.js
  38. 0 0
      desktop/core/src/desktop/js/parse/sql/impala/impalaAutocompleteParser.js
  39. 0 0
      desktop/core/src/desktop/js/parse/sql/impala/impalaSyntaxParser.js
  40. 0 0
      desktop/core/src/desktop/js/parse/sql/ksql/ksqlAutocompleteParser.js
  41. 0 0
      desktop/core/src/desktop/js/parse/sql/ksql/ksqlSyntaxParser.js
  42. 0 0
      desktop/core/src/desktop/js/parse/sql/phoenix/phoenixAutocompleteParser.js
  43. 0 0
      desktop/core/src/desktop/js/parse/sql/phoenix/phoenixSyntaxParser.js
  44. 2 1
      desktop/core/src/desktop/js/parse/sql/sqlParseUtils.js

+ 0 - 8
desktop/core/src/desktop/js/parse/jison/sql/generic/alter/alter_common.jison

@@ -14,15 +14,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-DataDefinition
- : AlterStatement
- ;
-
 DataDefinition_EDIT
- : AlterStatement_EDIT
- ;
-
-AlterStatement_EDIT
  : 'ALTER' 'CURSOR'
    {
      parser.suggestKeywords(['TABLE', 'VIEW']);

+ 2 - 2
desktop/core/src/desktop/js/parse/jison/sql/generic/alter/alter_table.jison

@@ -14,11 +14,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-AlterStatement
+DataDefinition
  : AlterTable
  ;
 
-AlterStatement_EDIT
+DataDefinition_EDIT
  : AlterTable_EDIT
  ;
 

+ 2 - 2
desktop/core/src/desktop/js/parse/jison/sql/generic/alter/alter_view.jison

@@ -14,11 +14,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-AlterStatement
+DataDefinition
  : AlterView
  ;
 
-AlterStatement_EDIT
+DataDefinition_EDIT
  : AlterView_EDIT
  ;
 

+ 0 - 8
desktop/core/src/desktop/js/parse/jison/sql/generic/create/create_common.jison

@@ -14,15 +14,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-DataDefinition
- : CreateStatement
- ;
-
 DataDefinition_EDIT
- : CreateStatement_EDIT
- ;
-
-CreateStatement_EDIT
  : 'CREATE' 'CURSOR'
    {
      parser.suggestKeywords(['DATABASE', 'ROLE', 'SCHEMA', 'TABLE', 'VIEW']);

+ 2 - 2
desktop/core/src/desktop/js/parse/jison/sql/generic/create/create_database.jison

@@ -14,11 +14,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-CreateStatement
+DataDefinition
  : DatabaseDefinition
  ;
 
-CreateStatement_EDIT
+DataDefinition_EDIT
  : DatabaseDefinition_EDIT
  ;
 

+ 1 - 1
desktop/core/src/desktop/js/parse/jison/sql/generic/create/create_role.jison

@@ -14,7 +14,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-CreateStatement
+DataDefinition
  : RoleDefinition
  ;
 

+ 2 - 2
desktop/core/src/desktop/js/parse/jison/sql/generic/create/create_table.jison

@@ -14,11 +14,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-CreateStatement
+DataDefinition
  : TableDefinition
  ;
 
-CreateStatement_EDIT
+DataDefinition_EDIT
  : TableDefinition_EDIT
  ;
 

+ 2 - 2
desktop/core/src/desktop/js/parse/jison/sql/generic/create/create_view.jison

@@ -14,11 +14,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-CreateStatement
+DataDefinition
  : ViewDefinition
  ;
 
-CreateStatement_EDIT
+DataDefinition_EDIT
  : ViewDefinition_EDIT
  ;
 

+ 0 - 8
desktop/core/src/desktop/js/parse/jison/sql/generic/drop/drop_common.jison

@@ -14,15 +14,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-DataDefinition
- : DropStatement
- ;
-
 DataDefinition_EDIT
- : DropStatement_EDIT
- ;
-
-DropStatement_EDIT
  : 'DROP' 'CURSOR'
    {
      parser.suggestKeywords(['DATABASE', 'ROLE', 'SCHEMA', 'TABLE', 'VIEW']);

+ 2 - 2
desktop/core/src/desktop/js/parse/jison/sql/generic/drop/drop_database.jison

@@ -14,11 +14,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-DropStatement
+DataDefinition
  : DropDatabaseStatement
  ;
 
-DropStatement_EDIT
+DataDefinition_EDIT
  : DropDatabaseStatement_EDIT
  ;
 

+ 1 - 1
desktop/core/src/desktop/js/parse/jison/sql/generic/drop/drop_role.jison

@@ -14,7 +14,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-DropStatement
+DataDefinition
  : DropRoleStatement
  ;
 

+ 2 - 2
desktop/core/src/desktop/js/parse/jison/sql/generic/drop/drop_table.jison

@@ -14,11 +14,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-DropStatement
+DataDefinition
  : DropTableStatement
  ;
 
-DropStatement_EDIT
+DataDefinition_EDIT
  : DropTableStatement_EDIT
  ;
 

+ 2 - 2
desktop/core/src/desktop/js/parse/jison/sql/generic/drop/drop_view.jison

@@ -14,11 +14,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-DropStatement
+DataDefinition
  : DropViewStatement
  ;
 
-DropStatement_EDIT
+DataDefinition_EDIT
  : DropViewStatement_EDIT
  ;
 

+ 1 - 1
desktop/core/src/desktop/js/parse/jison/sql/generic/set/set_all.jison

@@ -14,6 +14,6 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-SetSpecification
+DataDefinition
  : 'SET' 'ALL'
  ;

+ 0 - 4
desktop/core/src/desktop/js/parse/jison/sql/generic/set/set_common.jison

@@ -14,10 +14,6 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-DataDefinition
- : SetSpecification
- ;
-
 DataDefinition_EDIT
  : 'SET' 'CURSOR'
    {

+ 1 - 1
desktop/core/src/desktop/js/parse/jison/sql/generic/set/set_option.jison

@@ -14,7 +14,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-SetSpecification
+DataDefinition
  : 'SET' SetOption '=' SetValue
  ;
 

+ 0 - 8
desktop/core/src/desktop/js/parse/jison/sql/impala/alter/alter_common.jison

@@ -14,15 +14,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-DataDefinition
- : AlterStatement
- ;
-
 DataDefinition_EDIT
- : AlterStatement_EDIT
- ;
-
-AlterStatement_EDIT
  : 'ALTER' 'CURSOR'
    {
      parser.suggestKeywords(['DATABASE', 'SCHEMA', 'TABLE', 'VIEW']);

+ 2 - 2
desktop/core/src/desktop/js/parse/jison/sql/impala/alter/alter_database.jison

@@ -14,11 +14,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-AlterStatement
+DataDefinition
  : AlterDatabase
  ;
 
-AlterStatement_EDIT
+DataDefinition_EDIT
  : AlterDatabase_EDIT
  ;
 

+ 2 - 2
desktop/core/src/desktop/js/parse/jison/sql/impala/alter/alter_table.jison

@@ -14,11 +14,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-AlterStatement
+DataDefinition
  : AlterTable
  ;
 
-AlterStatement_EDIT
+DataDefinition_EDIT
  : AlterTable_EDIT
  ;
 

+ 2 - 2
desktop/core/src/desktop/js/parse/jison/sql/impala/alter/alter_view.jison

@@ -14,11 +14,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-AlterStatement
+DataDefinition
  : AlterView
  ;
 
-AlterStatement_EDIT
+DataDefinition_EDIT
  : AlterView_EDIT
  ;
 

+ 2 - 2
desktop/core/src/desktop/js/parse/jison/sql/impala/create/create_aggregate_function.jison

@@ -14,11 +14,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-CreateStatement
+DataDefinition
  : AggregateFunctionDefinition
  ;
 
-CreateStatement
+DataDefinition_EDIT
  : AggregateFunctionDefinition_EDIT
  ;
 

+ 0 - 4
desktop/core/src/desktop/js/parse/jison/sql/impala/create/create_common.jison

@@ -19,10 +19,6 @@ DataDefinition
  ;
 
 DataDefinition_EDIT
- : CreateStatement_EDIT
- ;
-
-CreateStatement_EDIT
  : 'CREATE' OptionalExternal 'CURSOR'
    {
      if ($2) {

+ 2 - 2
desktop/core/src/desktop/js/parse/jison/sql/impala/create/create_database.jison

@@ -14,11 +14,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-CreateStatement
+DataDefinition
  : DatabaseDefinition
  ;
 
-CreateStatement_EDIT
+DataDefinition_EDIT
  : DatabaseDefinition_EDIT
  ;
 

+ 2 - 2
desktop/core/src/desktop/js/parse/jison/sql/impala/create/create_function.jison

@@ -14,11 +14,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-CreateStatement
+DataDefinition
  : FunctionDefinition
  ;
 
-CreateStatement_EDIT
+DataDefinition_EDIT
  : FunctionDefinition_EDIT
  ;
 

+ 1 - 1
desktop/core/src/desktop/js/parse/jison/sql/impala/create/create_role.jison

@@ -14,7 +14,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-CreateStatement
+DataDefinition
  : RoleDefinition
  ;
 

+ 2 - 2
desktop/core/src/desktop/js/parse/jison/sql/impala/create/create_table.jison

@@ -14,11 +14,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-CreateStatement
+DataDefinition
  : TableDefinition
  ;
 
-CreateStatement_EDIT
+DataDefinition_EDIT
  : TableDefinition_EDIT
  ;
 

+ 2 - 2
desktop/core/src/desktop/js/parse/jison/sql/impala/create/create_view.jison

@@ -14,11 +14,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-CreateStatement
+DataDefinition
  : ViewDefinition
  ;
 
-CreateStatement_EDIT
+DataDefinition_EDIT
  : ViewDefinition_EDIT
  ;
 

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
desktop/core/src/desktop/js/parse/sql/calcite/calciteAutocompleteParser.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
desktop/core/src/desktop/js/parse/sql/calcite/calciteSyntaxParser.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
desktop/core/src/desktop/js/parse/sql/druid/druidAutocompleteParser.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
desktop/core/src/desktop/js/parse/sql/druid/druidSyntaxParser.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
desktop/core/src/desktop/js/parse/sql/elasticsearch/elasticsearchAutocompleteParser.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
desktop/core/src/desktop/js/parse/sql/elasticsearch/elasticsearchSyntaxParser.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
desktop/core/src/desktop/js/parse/sql/flink/flinkAutocompleteParser.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
desktop/core/src/desktop/js/parse/sql/flink/flinkSyntaxParser.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
desktop/core/src/desktop/js/parse/sql/generic/genericAutocompleteParser.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
desktop/core/src/desktop/js/parse/sql/generic/genericSyntaxParser.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
desktop/core/src/desktop/js/parse/sql/impala/impalaAutocompleteParser.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
desktop/core/src/desktop/js/parse/sql/impala/impalaSyntaxParser.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
desktop/core/src/desktop/js/parse/sql/ksql/ksqlAutocompleteParser.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
desktop/core/src/desktop/js/parse/sql/ksql/ksqlSyntaxParser.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
desktop/core/src/desktop/js/parse/sql/phoenix/phoenixAutocompleteParser.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
desktop/core/src/desktop/js/parse/sql/phoenix/phoenixSyntaxParser.js


+ 2 - 1
desktop/core/src/desktop/js/parse/sql/sqlParseUtils.js

@@ -812,7 +812,8 @@ export const initSyntaxParser = parser => {
             parser.yy.error.possibleReserved = true;
           }
         } else if (!IGNORED_EXPECTED[expected] && /[a-z_]+/i.test(expected)) {
-          if (/^<[a-z]+>/.test(expected)) {
+          // Skip mixed-case expected
+          if (expected.toUpperCase() !== expected) {
             continue;
           }
           expected = CLEAN_EXPECTED[expected] || expected;

Некоторые файлы не были показаны из-за большого количества измененных файлов