浏览代码

HUE-9429 [editor] Extract and split GRANT, REVOKE, LOAD, IMPORT, MSCK and EXPORT for Hive and Presto

Johan Ahlen 5 年之前
父节点
当前提交
b69a9d9917
共有 27 个文件被更改,包括 1141 次插入954 次删除
  1. 102 0
      desktop/core/src/desktop/js/parse/jison/sql/hive/export/export.jison
  2. 153 0
      desktop/core/src/desktop/js/parse/jison/sql/hive/grant/grant_common.jison
  3. 68 0
      desktop/core/src/desktop/js/parse/jison/sql/hive/grant/grant_privilege.jison
  4. 42 0
      desktop/core/src/desktop/js/parse/jison/sql/hive/grant/grant_role.jison
  5. 46 0
      desktop/core/src/desktop/js/parse/jison/sql/hive/grant/grant_user.jison
  6. 29 0
      desktop/core/src/desktop/js/parse/jison/sql/hive/grant/privilege_type.jison
  7. 122 0
      desktop/core/src/desktop/js/parse/jison/sql/hive/import/import.jison
  8. 111 0
      desktop/core/src/desktop/js/parse/jison/sql/hive/load/load_data.jison
  9. 0 0
      desktop/core/src/desktop/js/parse/jison/sql/hive/msck/msck.jison
  10. 57 0
      desktop/core/src/desktop/js/parse/jison/sql/hive/revoke/revoke_admin_option_for.jison
  11. 47 0
      desktop/core/src/desktop/js/parse/jison/sql/hive/revoke/revoke_all.jison
  12. 22 0
      desktop/core/src/desktop/js/parse/jison/sql/hive/revoke/revoke_common.jison
  13. 57 0
      desktop/core/src/desktop/js/parse/jison/sql/hive/revoke/revoke_grant_option_for.jison
  14. 49 0
      desktop/core/src/desktop/js/parse/jison/sql/hive/revoke/revoke_privilege.jison
  15. 39 0
      desktop/core/src/desktop/js/parse/jison/sql/hive/revoke/revoke_role.jison
  16. 43 0
      desktop/core/src/desktop/js/parse/jison/sql/hive/revoke/revoke_user.jison
  17. 0 378
      desktop/core/src/desktop/js/parse/jison/sql/hive/sql_grant.jison
  18. 0 293
      desktop/core/src/desktop/js/parse/jison/sql/hive/sql_load.jison
  19. 32 6
      desktop/core/src/desktop/js/parse/jison/sql/hive/structure.json
  20. 90 0
      desktop/core/src/desktop/js/parse/jison/sql/presto/load/load_data.jison
  21. 0 0
      desktop/core/src/desktop/js/parse/jison/sql/presto/msck/msck.jison
  22. 0 271
      desktop/core/src/desktop/js/parse/jison/sql/presto/sql_load.jison
  23. 32 6
      desktop/core/src/desktop/js/parse/jison/sql/presto/structure.json
  24. 0 0
      desktop/core/src/desktop/js/parse/sql/hive/hiveAutocompleteParser.js
  25. 0 0
      desktop/core/src/desktop/js/parse/sql/hive/hiveSyntaxParser.js
  26. 0 0
      desktop/core/src/desktop/js/parse/sql/presto/prestoAutocompleteParser.js
  27. 0 0
      desktop/core/src/desktop/js/parse/sql/presto/prestoSyntaxParser.js

+ 102 - 0
desktop/core/src/desktop/js/parse/jison/sql/hive/export/export.jison

@@ -0,0 +1,102 @@
+// Licensed to Cloudera, Inc. under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  Cloudera, Inc. licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+DataManipulation
+ : ExportStatement
+ ;
+
+DataManipulation_EDIT
+ : ExportStatement_EDIT
+ ;
+
+ExportStatement
+ : 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec PushHdfsLexerState 'TO' HdfsPath
+   {
+     parser.addTablePrimary($3);
+   }
+ | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec PushHdfsLexerState 'TO' HdfsPath 'FOR' 'REPLICATION' '(' QuotedValue ')'
+   {
+     parser.addTablePrimary($3);
+   }
+ ;
+
+ExportStatement_EDIT
+ : 'EXPORT' 'CURSOR'
+   {
+     parser.suggestKeywords(['TABLE']);
+   }
+ | 'EXPORT' 'TABLE' 'CURSOR'
+   {
+     parser.suggestTables();
+     parser.suggestDatabases({ appendDot: true });
+   }
+ | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier_EDIT
+ | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec 'CURSOR'
+   {
+     parser.addTablePrimary($3);
+     if (!$4) {
+       parser.suggestKeywords([{ weight: 2, value: 'PARTITION' }, { weight: 1, value: 'TO' }]);
+     } else {
+       parser.suggestKeywords([ 'TO' ]);
+     }
+   }
+ | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier PartitionSpec_EDIT
+   {
+     parser.addTablePrimary($3);
+   }
+ | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec PushHdfsLexerState 'TO' HdfsPath_EDIT
+   {
+     parser.addTablePrimary($3);
+   }
+ | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec PushHdfsLexerState 'TO' HdfsPath 'CURSOR'
+   {
+     parser.addTablePrimary($3);
+     parser.suggestKeywords(['FOR replication()']);
+   }
+ | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec PushHdfsLexerState 'TO' HdfsPath 'FOR' 'CURSOR'
+   {
+     parser.addTablePrimary($3);
+     parser.suggestKeywords(['replication()']);
+   }
+ | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier_EDIT OptionalPartitionSpec PushHdfsLexerState 'TO' HdfsPath
+ | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier_EDIT OptionalPartitionSpec PushHdfsLexerState 'TO' HdfsPath 'FOR' 'REPLICATION' '(' QuotedValue ')'
+ | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec 'CURSOR' PushHdfsLexerState 'TO' HdfsPath
+   {
+     parser.addTablePrimary($3);
+     if (!$4) {
+       parser.suggestKeywords(['PARTITION']);
+     }
+   }
+ | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec 'CURSOR' PushHdfsLexerState 'TO' HdfsPath 'FOR' 'REPLICATION' '(' QuotedValue ')'
+   {
+     parser.addTablePrimary($3);
+     if (!$4) {
+       parser.suggestKeywords(['PARTITION']);
+     }
+   }
+ | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier PartitionSpec_EDIT PushHdfsLexerState 'TO' HdfsPath
+   {
+     parser.addTablePrimary($3);
+   }
+ | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier PartitionSpec_EDIT PushHdfsLexerState 'TO' HdfsPath 'FOR' 'REPLICATION' '(' QuotedValue ')'
+   {
+     parser.addTablePrimary($3);
+   }
+ | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec PushHdfsLexerState 'TO' HdfsPath_EDIT 'FOR' 'REPLICATION' '(' QuotedValue ')'
+   {
+     parser.addTablePrimary($3);
+   }
+ ;

+ 153 - 0
desktop/core/src/desktop/js/parse/jison/sql/hive/grant/grant_common.jison

@@ -0,0 +1,153 @@
+// Licensed to Cloudera, Inc. under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  Cloudera, Inc. licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+DataDefinition_EDIT
+ : 'GRANT' 'CURSOR'
+   {
+     parser.suggestKeywords(['ALL', 'ALTER', 'CREATE', 'DELETE', 'DROP', 'INDEX', 'INSERT', 'LOCK', 'ROLE', 'SELECT', 'UPDATE']);
+   }
+ ;
+
+OptionalOnSpecification
+ :
+ | 'ON' ObjectSpecification
+ ;
+
+OnSpecification_EDIT
+ : 'ON' 'CURSOR'
+   {
+     parser.suggestKeywords(['DATABASE', 'TABLE']);
+     parser.suggestTables();
+     parser.suggestDatabases({ appendDot: true });
+   }
+ | 'ON' ObjectSpecification_EDIT
+ ;
+
+ObjectSpecification
+ : 'DATABASE' RegularOrBacktickedIdentifier
+ | 'TABLE' SchemaQualifiedTableIdentifier
+   {
+     parser.addTablePrimary($2);
+   }
+ | SchemaQualifiedTableIdentifier
+   {
+     parser.addTablePrimary($1);
+   }
+ ;
+
+ObjectSpecification_EDIT
+ : 'DATABASE' 'CURSOR'
+   {
+     parser.suggestDatabases();
+   }
+ | 'TABLE' 'CURSOR'
+   {
+     parser.suggestTables();
+     parser.suggestDatabases({ appendDot: true });
+   }
+ | 'TABLE' SchemaQualifiedTableIdentifier_EDIT
+ | SchemaQualifiedTableIdentifier_EDIT
+ ;
+
+PrivilegeTypeList
+ : PrivilegeTypeWithOptionalColumn
+   {
+     if ($1.toUpperCase() === 'ALL') {
+       $$ = { singleAll: true };
+     }
+   }
+ | PrivilegeTypeList ',' PrivilegeTypeWithOptionalColumn
+ ;
+
+PrivilegeTypeList_EDIT
+ : PrivilegeTypeWithOptionalColumn_EDIT
+ | PrivilegeTypeList ',' PrivilegeTypeWithOptionalColumn_EDIT
+ | PrivilegeTypeWithOptionalColumn_EDIT ',' PrivilegeTypeList
+ | PrivilegeTypeList ',' PrivilegeTypeWithOptionalColumn_EDIT ',' PrivilegeTypeList
+ | 'CURSOR' ',' PrivilegeTypeList
+   {
+     parser.suggestKeywords(['ALL', 'ALTER', 'CREATE', 'DELETE', 'DROP', 'INDEX', 'INSERT', 'LOCK', 'SELECT', 'SHOW_DATABASE', 'UPDATE']);
+   }
+ | PrivilegeTypeList ',' 'CURSOR'
+   {
+     parser.suggestKeywords(['ALL', 'ALTER', 'CREATE', 'DELETE', 'DROP', 'INDEX', 'INSERT', 'LOCK', 'SELECT', 'SHOW_DATABASE', 'UPDATE']);
+   }
+ | PrivilegeTypeList ',' 'CURSOR' ',' PrivilegeTypeList
+   {
+     parser.suggestKeywords(['ALL', 'ALTER', 'CREATE', 'DELETE', 'DROP', 'INDEX', 'INSERT', 'LOCK', 'SELECT', 'SHOW_DATABASE', 'UPDATE']);
+   }
+ ;
+
+PrivilegeTypeWithOptionalColumn
+ : PrivilegeType OptionalParenthesizedColumnList
+ ;
+
+PrivilegeTypeWithOptionalColumn_EDIT
+ : PrivilegeType ParenthesizedColumnList_EDIT
+ ;
+
+PrincipalSpecificationList
+ : PrincipalSpecification
+ | PrincipalSpecificationList ',' PrincipalSpecification
+ ;
+
+PrincipalSpecificationList_EDIT
+ : PrincipalSpecificationList ',' 'CURSOR'
+   {
+     parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
+   }
+ | 'CURSOR' ',' PrincipalSpecificationList
+   {
+     parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
+   }
+ | PrincipalSpecificationList ',' 'CURSOR' ',' PrincipalSpecificationList
+   {
+     parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
+   }
+ ;
+
+PrincipalSpecification
+ : 'USER' RegularOrBacktickedIdentifier
+ | 'GROUP' RegularOrBacktickedIdentifier
+ | 'ROLE' RegularOrBacktickedIdentifier
+ ;
+
+PrincipalSpecification_EDIT
+ : 'USER' 'CURSOR'
+ | 'GROUP' 'CURSOR'
+ | 'ROLE' 'CURSOR'
+ ;
+
+UserOrRoleList
+ : RegularOrBacktickedIdentifier
+ | UserOrRoleList ',' RegularOrBacktickedIdentifier
+ ;
+
+OptionalWithAdminOption
+ :
+ | 'WITH' 'ADMIN' 'OPTION'
+ ;
+
+WithAdminOption_EDIT
+ : 'WITH' 'CURSOR'
+   {
+     parser.suggestKeywords(['ADMIN OPTION']);
+   }
+ | 'WITH' 'ADMIN' 'CURSOR'
+   {
+     parser.suggestKeywords(['OPTION']);
+   }
+ ;

+ 68 - 0
desktop/core/src/desktop/js/parse/jison/sql/hive/grant/grant_privilege.jison

@@ -0,0 +1,68 @@
+// Licensed to Cloudera, Inc. under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  Cloudera, Inc. licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+DataDefinition
+ : GrantPrivilegeStatement
+ ;
+
+DataDefinition_EDIT
+ : GrantPrivilegeStatement_EDIT
+ ;
+
+GrantPrivilegeStatement
+ : 'GRANT' PrivilegeTypeList OptionalOnSpecification 'TO' PrincipalSpecificationList OptionalWithGrantOption
+ ;
+
+GrantPrivilegeStatement_EDIT
+ : 'GRANT' PrivilegeTypeList_EDIT OptionalOnSpecification
+ | 'GRANT' PrivilegeTypeList OnSpecification_EDIT
+ | 'GRANT' PrivilegeTypeList OptionalOnSpecification 'CURSOR'
+   {
+     if (!$3) {
+       parser.suggestKeywords(['ON', 'TO']);
+     } else {
+       parser.suggestKeywords(['TO']);
+     }
+   }
+ | 'GRANT' PrivilegeTypeList OptionalOnSpecification 'TO' 'CURSOR'
+   {
+     parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
+   }
+ | 'GRANT' PrivilegeTypeList OptionalOnSpecification 'TO' PrincipalSpecificationList_EDIT
+ | 'GRANT' PrivilegeTypeList OptionalOnSpecification 'TO' PrincipalSpecificationList OptionalWithGrantOption 'CURSOR'
+   {
+     if (!$6) {
+       parser.suggestKeywords(['WITH GRANT OPTION']);
+     }
+   }
+ | 'GRANT' PrivilegeTypeList OptionalOnSpecification 'TO' PrincipalSpecificationList WithGrantOption_EDIT
+ ;
+
+OptionalWithGrantOption
+ :
+ | 'WITH' 'GRANT' 'OPTION'
+ ;
+
+WithGrantOption_EDIT
+ : 'WITH' 'CURSOR'
+   {
+     parser.suggestKeywords(['GRANT OPTION']);
+   }
+ | 'WITH' 'GRANT' 'CURSOR'
+   {
+     parser.suggestKeywords(['OPTION']);
+   }
+ ;

+ 42 - 0
desktop/core/src/desktop/js/parse/jison/sql/hive/grant/grant_role.jison

@@ -0,0 +1,42 @@
+// Licensed to Cloudera, Inc. under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  Cloudera, Inc. licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+DataDefinition
+ : GrantRoleStatement
+ ;
+
+DataDefinition_EDIT
+ : GrantRoleStatement_EDIT
+ ;
+
+GrantRoleStatement
+ : 'GRANT' 'ROLE' UserOrRoleList 'TO' PrincipalSpecificationList OptionalWithAdminOption
+ ;
+
+GrantRoleStatement_EDIT
+ : 'GRANT' 'ROLE' UserOrRoleList 'TO' 'CURSOR'
+   {
+     parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
+   }
+ | 'GRANT' 'ROLE' UserOrRoleList 'TO' PrincipalSpecificationList_EDIT
+ | 'GRANT' 'ROLE' UserOrRoleList 'TO' PrincipalSpecificationList OptionalWithAdminOption 'CURSOR'
+   {
+     if (!$6) {
+       parser.suggestKeywords(['WITH ADMIN OPTION']);
+     }
+   }
+ | 'GRANT' 'ROLE' UserOrRoleList 'TO' PrincipalSpecificationList WithAdminOption_EDIT
+ ;

+ 46 - 0
desktop/core/src/desktop/js/parse/jison/sql/hive/grant/grant_user.jison

@@ -0,0 +1,46 @@
+// Licensed to Cloudera, Inc. under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  Cloudera, Inc. licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+DataDefinition
+ : GrantUserStatement
+ ;
+
+DataDefinition_EDIT
+ : GrantUserStatement_EDIT
+ ;
+
+GrantUserStatement
+ : 'GRANT' UserOrRoleList 'TO' PrincipalSpecificationList OptionalWithAdminOption
+ ;
+
+GrantUserStatement_EDIT
+ : 'GRANT' UserOrRoleList 'CURSOR'
+   {
+     parser.suggestKeywords(['TO']);
+   }
+ | 'GRANT' UserOrRoleList 'TO' 'CURSOR'
+   {
+     parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
+   }
+ | 'GRANT' UserOrRoleList 'TO' PrincipalSpecificationList_EDIT
+ | 'GRANT' UserOrRoleList 'TO' PrincipalSpecificationList OptionalWithAdminOption 'CURSOR'
+   {
+     if (!$5) {
+       parser.suggestKeywords(['WITH ADMIN OPTION']);
+     }
+   }
+ | 'GRANT' UserOrRoleList 'TO' PrincipalSpecificationList WithAdminOption_EDIT
+ ;

+ 29 - 0
desktop/core/src/desktop/js/parse/jison/sql/hive/grant/privilege_type.jison

@@ -0,0 +1,29 @@
+// Licensed to Cloudera, Inc. under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  Cloudera, Inc. licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+PrivilegeType
+ : 'ALL'
+ | 'ALTER'
+ | 'CREATE'
+ | 'DELETE'
+ | 'DROP'
+ | 'INDEX'
+ | 'INSERT'
+ | 'LOCK'
+ | 'SELECT'
+ | 'SHOW_DATABASE'
+ | 'UPDATE'
+ ;

+ 122 - 0
desktop/core/src/desktop/js/parse/jison/sql/hive/import/import.jison

@@ -0,0 +1,122 @@
+// Licensed to Cloudera, Inc. under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  Cloudera, Inc. licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+DataManipulation
+ : ImportStatement
+ ;
+
+DataManipulation_EDIT
+ : ImportStatement_EDIT
+ ;
+
+ImportStatement
+ : 'IMPORT' OptionalTableWithPartition PushHdfsLexerState 'FROM' HdfsPath OptionalHdfsLocation
+ ;
+
+ImportStatement_EDIT
+ : 'IMPORT' 'CURSOR' OptionalTableWithPartition
+   {
+     if (!$3) {
+       parser.suggestKeywords(['EXTERNAL TABLE', 'FROM', 'TABLE']);
+     } else if (!$3.hasExternal) {
+       parser.suggestKeywords(['EXTERNAL']);
+     }
+   }
+ | 'IMPORT' TableWithPartition 'CURSOR'
+   {
+     if ($2.suggestKeywords) {
+        parser.suggestKeywords(parser.createWeightedKeywords($2.suggestKeywords, 2).concat(['FROM']));
+      } else {
+        parser.suggestKeywords(['FROM']);
+      }
+   }
+ | 'IMPORT' TableWithPartition_EDIT
+ | 'IMPORT' OptionalTableWithPartition PushHdfsLexerState 'FROM' HdfsPath_EDIT OptionalHdfsLocation
+ | 'IMPORT' OptionalTableWithPartition PushHdfsLexerState 'FROM' HdfsPath HdfsLocation_EDIT
+ | 'IMPORT' OptionalTableWithPartition PushHdfsLexerState 'FROM' HdfsPath OptionalHdfsLocation 'CURSOR'
+   {
+     if (!$6) {
+       parser.suggestKeywords(['LOCATION']);
+     }
+   }
+ | 'IMPORT' 'CURSOR' OptionalTableWithPartition PushHdfsLexerState 'FROM' HdfsPath OptionalHdfsLocation
+   {
+     if (!$3) {
+       parser.suggestKeywords(['EXTERNAL TABLE', 'TABLE']);
+     } else if (!$3.hasExternal) {
+       parser.suggestKeywords(['EXTERNAL']);
+     }
+   }
+ | 'IMPORT' TableWithPartition_EDIT PushHdfsLexerState 'FROM' HdfsPath OptionalHdfsLocation
+ | 'IMPORT' TableWithPartition 'CURSOR' PushHdfsLexerState 'FROM' HdfsPath OptionalHdfsLocation
+   {
+     if ($2.suggestKeywords) {
+       parser.suggestKeywords(parser.createWeightedKeywords($2.suggestKeywords, 2).concat(['FROM']));
+     }
+   }
+ ;
+
+OptionalTableWithPartition
+ :
+ | TableWithPartition
+ ;
+
+TableWithPartition
+ : 'EXTERNAL' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec
+   {
+     parser.addTablePrimary($3);
+     if (!$4) {
+       $$ = { hasExternal: true, suggestKeywords: ['PARTITION'] };
+     } else {
+       $$ = { hasExternal: true }
+     }
+   }
+ | 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec
+   {
+     parser.addTablePrimary($2);
+     if (!$3) {
+       $$ = { suggestKeywords: ['PARTITION'] };
+     }
+   }
+ ;
+
+TableWithPartition_EDIT
+ : 'EXTERNAL' 'CURSOR'
+   {
+     parser.suggestKeywords(['TABLE']);
+   }
+ | 'EXTERNAL' 'TABLE' 'CURSOR'
+   {
+     parser.suggestTables();
+     parser.suggestDatabases({ appendDot: true });
+   }
+ | 'EXTERNAL' 'TABLE' SchemaQualifiedTableIdentifier_EDIT OptionalPartitionSpec
+ | 'EXTERNAL' 'TABLE' SchemaQualifiedTableIdentifier PartitionSpec_EDIT
+   {
+     parser.addTablePrimary($3);
+   }
+ | 'TABLE' 'CURSOR'
+   {
+     parser.suggestTables();
+     parser.suggestDatabases({ appendDot: true });
+   }
+
+ | 'TABLE' SchemaQualifiedTableIdentifier_EDIT OptionalPartitionSpec
+ | 'TABLE' SchemaQualifiedTableIdentifier PartitionSpec_EDIT
+   {
+     parser.addTablePrimary($3);
+   }
+ ;

+ 111 - 0
desktop/core/src/desktop/js/parse/jison/sql/hive/load/load_data.jison

@@ -0,0 +1,111 @@
+// Licensed to Cloudera, Inc. under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  Cloudera, Inc. licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+DataManipulation
+ : LoadDataStatement
+ ;
+
+DataManipulation_EDIT
+ : LoadDataStatement_EDIT
+ ;
+
+LoadDataStatement
+ : 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath OptionalOverwrite 'INTO' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec OptionalInputFormat
+   {
+     parser.addTablePrimary($9);
+   }
+ ;
+
+LoadDataStatement_EDIT
+ : 'LOAD' 'CURSOR'
+   {
+     parser.suggestKeywords(['DATA LOCAL INPATH', 'DATA INPATH']);
+   }
+ | 'LOAD' 'DATA' OptionalLocal 'CURSOR'
+   {
+     if (!$3) {
+       parser.suggestKeywords(['INPATH', 'LOCAL INPATH']);
+     } else {
+       parser.suggestKeywords(['INPATH']);
+     }
+   }
+ | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath_EDIT OptionalOverwrite
+ | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath OptionalOverwrite 'CURSOR'
+   {
+     if (!$6) {
+       parser.suggestKeywords(['OVERWRITE INTO TABLE', 'INTO TABLE']);
+     } else {
+       parser.suggestKeywords(['INTO TABLE']);
+     }
+   }
+ | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath OptionalOverwrite 'INTO' 'CURSOR'
+   {
+     parser.suggestKeywords([ 'TABLE' ]);
+   }
+ | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath OptionalOverwrite 'INTO' 'TABLE' 'CURSOR'
+   {
+     parser.suggestTables();
+     parser.suggestDatabases({ appendDot: true });
+   }
+ | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath OptionalOverwrite 'INTO' 'TABLE' SchemaQualifiedTableIdentifier_EDIT OptionalPartitionSpec OptionalInputFormat
+ | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath OptionalOverwrite 'INTO' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec OptionalInputFormat 'CURSOR'
+   {
+     parser.addTablePrimary($9);
+     if (!$10 && !$11) {
+       parser.suggestKeywords(['INPUTFORMAT', 'PARTITION']);
+     } else if ($10 && !$11) {
+       parser.suggestKeywords(['INPUTFORMAT']);
+     }
+   }
+ | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath OptionalOverwrite 'INTO' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec_EDIT OptionalInputFormat
+   {
+     parser.addTablePrimary($9);
+   }
+ | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath OptionalOverwrite 'INTO' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec InputFormat_EDIT
+   {
+     parser.addTablePrimary($9);
+   }
+ | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath_EDIT OptionalOverwrite 'INTO' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec OptionalInputFormat
+   {
+     parser.addTablePrimary($9);
+   }
+ ;
+
+OptionalOverwrite
+ :
+ | 'OVERWRITE'
+ ;
+
+OptionalLocal
+ :
+ | 'LOCAL'
+ ;
+
+OptionalInputFormat
+ :
+ | InputFormat
+ ;
+
+InputFormat
+ : 'INPUTFORMAT' QuotedValue 'SERDE' QuotedValue
+ ;
+
+InputFormat_EDIT
+ : 'INPUTFORMAT' QuotedValue 'CURSOR'
+   {
+     parser.suggestKeywords(['SERDE']);
+   }
+ ;

+ 0 - 0
desktop/core/src/desktop/js/parse/jison/sql/hive/sql_msck.jison → desktop/core/src/desktop/js/parse/jison/sql/hive/msck/msck.jison


+ 57 - 0
desktop/core/src/desktop/js/parse/jison/sql/hive/revoke/revoke_admin_option_for.jison

@@ -0,0 +1,57 @@
+// Licensed to Cloudera, Inc. under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  Cloudera, Inc. licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+DataDefinition
+ : RevokeAdminOptionForStatement
+ ;
+
+DataDefinition_EDIT
+ : RevokeAdminOptionForStatement_EDIT
+ ;
+
+RevokeAdminOptionForStatement
+ : 'REVOKE' 'ADMIN' 'OPTION' 'FOR' UserOrRoleList 'FROM' PrincipalSpecificationList
+ | 'REVOKE' 'ADMIN' 'OPTION' 'FOR' 'ROLE' UserOrRoleList 'FROM' PrincipalSpecificationList
+ ;
+
+RevokeAdminOptionForStatement_EDIT
+ : 'REVOKE' 'ADMIN' 'OPTION' 'CURSOR'
+   {
+     parser.suggestKeywords(['FOR']);
+   }
+ | 'REVOKE' 'ADMIN' 'OPTION' 'FOR' 'CURSOR'
+   {
+     parser.suggestKeywords(['ROLE']);
+   }
+ | 'REVOKE' 'ADMIN' 'OPTION' 'FOR' UserOrRoleList 'CURSOR'
+   {
+     parser.suggestKeywords(['FROM']);
+   }
+ | 'REVOKE' 'ADMIN' 'OPTION' 'FOR' UserOrRoleList 'FROM' 'CURSOR'
+   {
+     parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
+   }
+ | 'REVOKE' 'ADMIN' 'OPTION' 'FOR' UserOrRoleList 'FROM' PrincipalSpecificationList_EDIT
+ | 'REVOKE' 'ADMIN' 'OPTION' 'FOR' 'ROLE' UserOrRoleList 'CURSOR'
+   {
+     parser.suggestKeywords(['FROM']);
+   }
+ | 'REVOKE' 'ADMIN' 'OPTION' 'FOR' 'ROLE' UserOrRoleList 'FROM' 'CURSOR'
+   {
+     parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
+   }
+ | 'REVOKE' 'ADMIN' 'OPTION' 'FOR' 'ROLE' UserOrRoleList 'FROM' PrincipalSpecificationList_EDIT
+ ;

+ 47 - 0
desktop/core/src/desktop/js/parse/jison/sql/hive/revoke/revoke_all.jison

@@ -0,0 +1,47 @@
+// Licensed to Cloudera, Inc. under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  Cloudera, Inc. licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+DataDefinition
+ : RevokeAllStatement
+ ;
+
+DataDefinition_EDIT
+ : RevokeAllStatement_EDIT
+ ;
+
+RevokeAllStatement
+ : 'REVOKE' 'ALL' PrivilegesOrGrantOption 'FROM' UserOrRoleList
+ ;
+
+RevokeAllStatement_EDIT
+ : 'REVOKE' 'ALL' PrivilegesOrGrantOption_EDIT
+ | 'REVOKE' 'ALL' PrivilegesOrGrantOption 'CURSOR'
+   {
+     parser.suggestKeywords(['FROM']);
+   }
+ ;
+
+PrivilegesOrGrantOption
+ : 'PRIVILEGES'
+ | 'GRANT' 'OPTION'
+ ;
+
+PrivilegesOrGrantOption_EDIT
+ : 'GRANT' 'CURSOR'
+   {
+     parser.suggestKeywords(['OPTION']);
+   }
+ ;

+ 22 - 0
desktop/core/src/desktop/js/parse/jison/sql/hive/revoke/revoke_common.jison

@@ -0,0 +1,22 @@
+// Licensed to Cloudera, Inc. under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  Cloudera, Inc. licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+DataDefinition_EDIT
+ : 'REVOKE' 'CURSOR'
+   {
+     parser.suggestKeywords(['ADMIN OPTION FOR', 'ALL', 'ALL GRANT OPTION FROM', 'ALL PRIVILEGES FROM', 'ALTER', 'CREATE', 'DELETE', 'DROP', 'GRANT OPTION FOR', 'INDEX', 'INSERT', 'LOCK', 'ROLE', 'SELECT', 'UPDATE']);
+   }
+ ;

+ 57 - 0
desktop/core/src/desktop/js/parse/jison/sql/hive/revoke/revoke_grant_option_for.jison

@@ -0,0 +1,57 @@
+// Licensed to Cloudera, Inc. under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  Cloudera, Inc. licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+DataDefinition
+ : RevokeGrantOptionForStatement
+ ;
+
+DataDefinition_EDIT
+ : RevokeGrantOptionForStatement_EDIT
+ ;
+
+RevokeGrantOptionForStatement
+ : 'REVOKE' 'GRANT' 'OPTION' 'FOR' PrivilegeTypeList OptionalOnSpecification 'FROM' PrincipalSpecificationList
+ ;
+
+RevokeGrantOptionForStatement_EDIT
+ : 'REVOKE' 'GRANT' 'CURSOR'
+   {
+     parser.suggestKeywords(['OPTION FOR']);
+   }
+ | 'REVOKE' 'GRANT' 'OPTION' 'CURSOR'
+   {
+     parser.suggestKeywords(['FOR']);
+   }
+ | 'REVOKE' 'GRANT' 'OPTION' 'FOR' 'CURSOR'
+   {
+     parser.suggestKeywords(['ALL', 'ALTER', 'CREATE', 'DELETE', 'DROP', 'INDEX', 'INSERT', 'LOCK', 'SELECT', 'SHOW_DATABASE', 'UPDATE']);
+   }
+ | 'REVOKE' 'GRANT' 'OPTION' 'FOR' PrivilegeTypeList_EDIT
+ | 'REVOKE' 'GRANT' 'OPTION' 'FOR' PrivilegeTypeList OnSpecification_EDIT
+ | 'REVOKE' 'GRANT' 'OPTION' 'FOR' PrivilegeTypeList OptionalOnSpecification 'CURSOR'
+   {
+     if (!$6) {
+       parser.suggestKeywords(['FROM', 'ON']);
+     } else {
+       parser.suggestKeywords(['FROM']);
+     }
+   }
+ | 'REVOKE' 'GRANT' 'OPTION' 'FOR' PrivilegeTypeList OptionalOnSpecification 'FROM' 'CURSOR'
+   {
+     parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
+   }
+ | 'REVOKE' 'GRANT' 'OPTION' 'FOR' PrivilegeTypeList OptionalOnSpecification 'FROM' PrincipalSpecificationList_EDIT
+ ;

+ 49 - 0
desktop/core/src/desktop/js/parse/jison/sql/hive/revoke/revoke_privilege.jison

@@ -0,0 +1,49 @@
+// Licensed to Cloudera, Inc. under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  Cloudera, Inc. licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+DataDefinition
+ : RevokePrivilegeStatement
+ ;
+
+DataDefinition_EDIT
+ : RevokePrivilegeStatement_EDIT
+ ;
+
+RevokePrivilegeStatement
+ : 'REVOKE' PrivilegeTypeList OptionalOnSpecification 'FROM' PrincipalSpecificationList
+ ;
+
+RevokePrivilegeStatement_EDIT
+ : 'REVOKE' PrivilegeTypeList_EDIT
+ | 'REVOKE' PrivilegeTypeList OnSpecification_EDIT
+ | 'REVOKE' PrivilegeTypeList OptionalOnSpecification 'CURSOR'
+   {
+     if (!$3) {
+       if ($2.singleAll) {
+         parser.suggestKeywords(['FROM', 'GRANT OPTION', 'ON', 'PRIVILEGES FROM']);
+       } else {
+         parser.suggestKeywords(['FROM', 'ON']);
+       }
+     } else {
+       parser.suggestKeywords(['FROM']);
+     }
+   }
+ | 'REVOKE' PrivilegeTypeList OptionalOnSpecification 'FROM' 'CURSOR'
+   {
+     parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
+   }
+ | 'REVOKE' PrivilegeTypeList OptionalOnSpecification 'FROM' PrincipalSpecificationList_EDIT
+ ;

+ 39 - 0
desktop/core/src/desktop/js/parse/jison/sql/hive/revoke/revoke_role.jison

@@ -0,0 +1,39 @@
+// Licensed to Cloudera, Inc. under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  Cloudera, Inc. licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+DataDefinition
+ : RevokeRoleStatement
+ ;
+
+DataDefinition_EDIT
+ : RevokeRoleStatement_EDIT
+ ;
+
+RevokeRoleStatement
+ : 'REVOKE' 'ROLE' UserOrRoleList 'FROM' PrincipalSpecificationList
+ ;
+
+RevokeRoleStatement_EDIT
+ : 'REVOKE' 'ROLE' UserOrRoleList 'CURSOR'
+   {
+     parser.suggestKeywords(['FROM']);
+   }
+ | 'REVOKE' 'ROLE' UserOrRoleList 'FROM' 'CURSOR'
+   {
+     parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
+   }
+ | 'REVOKE' 'ROLE' UserOrRoleList 'FROM' PrincipalSpecificationList_EDIT
+ ;

+ 43 - 0
desktop/core/src/desktop/js/parse/jison/sql/hive/revoke/revoke_user.jison

@@ -0,0 +1,43 @@
+// Licensed to Cloudera, Inc. under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  Cloudera, Inc. licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+DataDefinition
+ : RevokeUserStatement
+ ;
+
+DataDefinition_EDIT
+ : RevokeUserStatement_EDIT
+ ;
+
+RevokeUserStatement
+ : 'REVOKE' UserOrRoleList 'FROM' PrincipalSpecificationList
+ ;
+
+RevokeUserStatement_EDIT
+ : 'REVOKE' UserOrRoleList 'CURSOR'
+   {
+     if ($2.toUpperCase() === 'ADMIN') {
+       parser.suggestKeywords(['FROM', 'OPTION FOR']);
+     } else {
+       parser.suggestKeywords(['FROM']);
+     }
+   }
+ | 'REVOKE' UserOrRoleList 'FROM' 'CURSOR'
+   {
+     parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
+   }
+ | 'REVOKE' UserOrRoleList 'FROM' PrincipalSpecificationList_EDIT
+ ;

+ 0 - 378
desktop/core/src/desktop/js/parse/jison/sql/hive/sql_grant.jison

@@ -1,378 +0,0 @@
-// Licensed to Cloudera, Inc. under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  Cloudera, Inc. licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-DataDefinition
- : GrantStatement
- | RevokeStatement
- ;
-
-DataDefinition_EDIT
- : GrantStatement_EDIT
- | RevokeStatement_EDIT
- ;
-
-GrantStatement
- : 'GRANT' PrivilegeTypeList OptionalOnSpecification 'TO' PrincipalSpecificationList OptionalWithGrantOption
- | 'GRANT' UserOrRoleList 'TO' PrincipalSpecificationList OptionalWithAdminOption
- | 'GRANT' 'ROLE' UserOrRoleList 'TO' PrincipalSpecificationList OptionalWithAdminOption
- ;
-
-GrantStatement_EDIT
- : 'GRANT' 'CURSOR'
-   {
-     parser.suggestKeywords(['ALL', 'ALTER', 'CREATE', 'DELETE', 'DROP', 'INDEX', 'INSERT', 'LOCK', 'ROLE', 'SELECT', 'UPDATE']);
-   }
- | 'GRANT' PrivilegeTypeList_EDIT OptionalOnSpecification
- | 'GRANT' PrivilegeTypeList OnSpecification_EDIT
- | 'GRANT' PrivilegeTypeList OptionalOnSpecification 'CURSOR'
-   {
-     if (!$3) {
-       parser.suggestKeywords(['ON', 'TO']);
-     } else {
-       parser.suggestKeywords(['TO']);
-     }
-   }
- | 'GRANT' PrivilegeTypeList OptionalOnSpecification 'TO' 'CURSOR'
-   {
-     parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
-   }
- | 'GRANT' PrivilegeTypeList OptionalOnSpecification 'TO' PrincipalSpecificationList_EDIT
- | 'GRANT' PrivilegeTypeList OptionalOnSpecification 'TO' PrincipalSpecificationList OptionalWithGrantOption 'CURSOR'
-   {
-     if (!$6) {
-       parser.suggestKeywords(['WITH GRANT OPTION']);
-     }
-   }
- | 'GRANT' PrivilegeTypeList OptionalOnSpecification 'TO' PrincipalSpecificationList WithGrantOption_EDIT
- | 'GRANT' UserOrRoleList 'CURSOR'
-   {
-     parser.suggestKeywords(['TO']);
-   }
- | 'GRANT' UserOrRoleList 'TO' 'CURSOR'
-   {
-     parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
-   }
- | 'GRANT' UserOrRoleList 'TO' PrincipalSpecificationList_EDIT
- | 'GRANT' UserOrRoleList 'TO' PrincipalSpecificationList OptionalWithAdminOption 'CURSOR'
-   {
-     if (!$5) {
-       parser.suggestKeywords(['WITH ADMIN OPTION']);
-     }
-   }
- | 'GRANT' UserOrRoleList 'TO' PrincipalSpecificationList WithAdminOption_EDIT
- | 'GRANT' 'ROLE' UserOrRoleList 'TO' 'CURSOR'
-   {
-     parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
-   }
- | 'GRANT' 'ROLE' UserOrRoleList 'TO' PrincipalSpecificationList_EDIT
- | 'GRANT' 'ROLE' UserOrRoleList 'TO' PrincipalSpecificationList OptionalWithAdminOption 'CURSOR'
-   {
-     if (!$6) {
-       parser.suggestKeywords(['WITH ADMIN OPTION']);
-     }
-   }
- | 'GRANT' 'ROLE' UserOrRoleList 'TO' PrincipalSpecificationList WithAdminOption_EDIT
- ;
-
-OptionalOnSpecification
- :
- | 'ON' ObjectSpecification
- ;
-
-OnSpecification_EDIT
- : 'ON' 'CURSOR'
-   {
-     parser.suggestKeywords(['DATABASE', 'TABLE']);
-     parser.suggestTables();
-     parser.suggestDatabases({ appendDot: true });
-   }
- | 'ON' ObjectSpecification_EDIT
- ;
-
-ObjectSpecification
- : 'DATABASE' RegularOrBacktickedIdentifier
- | 'TABLE' SchemaQualifiedTableIdentifier
-   {
-     parser.addTablePrimary($2);
-   }
- | SchemaQualifiedTableIdentifier
-   {
-     parser.addTablePrimary($1);
-   }
- ;
-
-ObjectSpecification_EDIT
- : 'DATABASE' 'CURSOR'
-   {
-     parser.suggestDatabases();
-   }
- | 'TABLE' 'CURSOR'
-   {
-     parser.suggestTables();
-     parser.suggestDatabases({ appendDot: true });
-   }
- | 'TABLE' SchemaQualifiedTableIdentifier_EDIT
- | SchemaQualifiedTableIdentifier_EDIT
- ;
-
-PrivilegeTypeList
- : PrivilegeTypeWithOptionalColumn
-   {
-     if ($1.toUpperCase() === 'ALL') {
-       $$ = { singleAll: true };
-     }
-   }
- | PrivilegeTypeList ',' PrivilegeTypeWithOptionalColumn
- ;
-
-PrivilegeTypeList_EDIT
- : PrivilegeTypeWithOptionalColumn_EDIT
- | PrivilegeTypeList ',' PrivilegeTypeWithOptionalColumn_EDIT
- | PrivilegeTypeWithOptionalColumn_EDIT ',' PrivilegeTypeList
- | PrivilegeTypeList ',' PrivilegeTypeWithOptionalColumn_EDIT ',' PrivilegeTypeList
- | 'CURSOR' ',' PrivilegeTypeList
-   {
-     parser.suggestKeywords(['ALL', 'ALTER', 'CREATE', 'DELETE', 'DROP', 'INDEX', 'INSERT', 'LOCK', 'SELECT', 'SHOW_DATABASE', 'UPDATE']);
-   }
- | PrivilegeTypeList ',' 'CURSOR'
-   {
-     parser.suggestKeywords(['ALL', 'ALTER', 'CREATE', 'DELETE', 'DROP', 'INDEX', 'INSERT', 'LOCK', 'SELECT', 'SHOW_DATABASE', 'UPDATE']);
-   }
- | PrivilegeTypeList ',' 'CURSOR' ',' PrivilegeTypeList
-   {
-     parser.suggestKeywords(['ALL', 'ALTER', 'CREATE', 'DELETE', 'DROP', 'INDEX', 'INSERT', 'LOCK', 'SELECT', 'SHOW_DATABASE', 'UPDATE']);
-   }
- ;
-
-PrivilegeTypeWithOptionalColumn
- : PrivilegeType OptionalParenthesizedColumnList
- ;
-
-PrivilegeTypeWithOptionalColumn_EDIT
- : PrivilegeType ParenthesizedColumnList_EDIT
- ;
-
-PrivilegeType
- : 'ALL'
- | 'ALTER'
- | 'CREATE'
- | 'DELETE'
- | 'DROP'
- | 'INDEX'
- | 'INSERT'
- | 'LOCK'
- | 'SELECT'
- | 'SHOW_DATABASE'
- | 'UPDATE'
- ;
-
-PrincipalSpecificationList
- : PrincipalSpecification
- | PrincipalSpecificationList ',' PrincipalSpecification
- ;
-
-PrincipalSpecificationList_EDIT
- : PrincipalSpecificationList ',' 'CURSOR'
-   {
-     parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
-   }
- | 'CURSOR' ',' PrincipalSpecificationList
-   {
-     parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
-   }
- | PrincipalSpecificationList ',' 'CURSOR' ',' PrincipalSpecificationList
-   {
-     parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
-   }
- ;
-
-PrincipalSpecification
- : 'USER' RegularOrBacktickedIdentifier
- | 'GROUP' RegularOrBacktickedIdentifier
- | 'ROLE' RegularOrBacktickedIdentifier
- ;
-
-PrincipalSpecification_EDIT
- : 'USER' 'CURSOR'
- | 'GROUP' 'CURSOR'
- | 'ROLE' 'CURSOR'
- ;
-
-UserOrRoleList
- : RegularOrBacktickedIdentifier
- | UserOrRoleList ',' RegularOrBacktickedIdentifier
- ;
-
-OptionalWithGrantOption
- :
- | 'WITH' 'GRANT' 'OPTION'
- ;
-
-WithGrantOption_EDIT
- : 'WITH' 'CURSOR'
-   {
-     parser.suggestKeywords(['GRANT OPTION']);
-   }
- | 'WITH' 'GRANT' 'CURSOR'
-   {
-     parser.suggestKeywords(['OPTION']);
-   }
- ;
-
-OptionalWithAdminOption
- :
- | 'WITH' 'ADMIN' 'OPTION'
- ;
-
-WithAdminOption_EDIT
- : 'WITH' 'CURSOR'
-   {
-     parser.suggestKeywords(['ADMIN OPTION']);
-   }
- | 'WITH' 'ADMIN' 'CURSOR'
-   {
-     parser.suggestKeywords(['OPTION']);
-   }
- ;
-
-RevokeStatement
- : 'REVOKE' PrivilegeTypeList OptionalOnSpecification 'FROM' PrincipalSpecificationList
- | 'REVOKE' 'GRANT' 'OPTION' 'FOR' PrivilegeTypeList OptionalOnSpecification 'FROM' PrincipalSpecificationList
- | 'REVOKE' UserOrRoleList 'FROM' PrincipalSpecificationList
- | 'REVOKE' 'ROLE' UserOrRoleList 'FROM' PrincipalSpecificationList
- | 'REVOKE' 'ADMIN' 'OPTION' 'FOR' UserOrRoleList 'FROM' PrincipalSpecificationList
- | 'REVOKE' 'ADMIN' 'OPTION' 'FOR' 'ROLE' UserOrRoleList 'FROM' PrincipalSpecificationList
- | 'REVOKE' 'ALL' PrivilegesOrGrantOption 'FROM' UserOrRoleList
- ;
-
-RevokeStatement_EDIT
- : 'REVOKE' 'CURSOR'
-   {
-     parser.suggestKeywords(['ADMIN OPTION FOR', 'ALL', 'ALL GRANT OPTION FROM', 'ALL PRIVILEGES FROM', 'ALTER', 'CREATE', 'DELETE', 'DROP', 'GRANT OPTION FOR', 'INDEX', 'INSERT', 'LOCK', 'ROLE', 'SELECT', 'UPDATE']);
-   }
- | 'REVOKE' PrivilegeTypeList_EDIT
- | 'REVOKE' PrivilegeTypeList OnSpecification_EDIT
- | 'REVOKE' PrivilegeTypeList OptionalOnSpecification 'CURSOR'
-   {
-     if (!$3) {
-       if ($2.singleAll) {
-         parser.suggestKeywords(['FROM', 'GRANT OPTION', 'ON', 'PRIVILEGES FROM']);
-       } else {
-         parser.suggestKeywords(['FROM', 'ON']);
-       }
-     } else {
-       parser.suggestKeywords(['FROM']);
-     }
-   }
- | 'REVOKE' PrivilegeTypeList OptionalOnSpecification 'FROM' 'CURSOR'
-   {
-     parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
-   }
- | 'REVOKE' PrivilegeTypeList OptionalOnSpecification 'FROM' PrincipalSpecificationList_EDIT
- | 'REVOKE' 'GRANT' 'CURSOR'
-   {
-     parser.suggestKeywords(['OPTION FOR']);
-   }
- | 'REVOKE' 'GRANT' 'OPTION' 'CURSOR'
-   {
-     parser.suggestKeywords(['FOR']);
-   }
- | 'REVOKE' 'GRANT' 'OPTION' 'FOR' 'CURSOR'
-   {
-     parser.suggestKeywords(['ALL', 'ALTER', 'CREATE', 'DELETE', 'DROP', 'INDEX', 'INSERT', 'LOCK', 'SELECT', 'SHOW_DATABASE', 'UPDATE']);
-   }
- | 'REVOKE' 'GRANT' 'OPTION' 'FOR' PrivilegeTypeList_EDIT
- | 'REVOKE' 'GRANT' 'OPTION' 'FOR' PrivilegeTypeList OnSpecification_EDIT
- | 'REVOKE' 'GRANT' 'OPTION' 'FOR' PrivilegeTypeList OptionalOnSpecification 'CURSOR'
-   {
-     if (!$6) {
-       parser.suggestKeywords(['FROM', 'ON']);
-     } else {
-       parser.suggestKeywords(['FROM']);
-     }
-   }
- | 'REVOKE' 'GRANT' 'OPTION' 'FOR' PrivilegeTypeList OptionalOnSpecification 'FROM' 'CURSOR'
-   {
-     parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
-   }
- | 'REVOKE' 'GRANT' 'OPTION' 'FOR' PrivilegeTypeList OptionalOnSpecification 'FROM' PrincipalSpecificationList_EDIT
- | 'REVOKE' UserOrRoleList 'CURSOR'
-   {
-     if ($2.toUpperCase() === 'ADMIN') {
-       parser.suggestKeywords(['FROM', 'OPTION FOR']);
-     } else {
-       parser.suggestKeywords(['FROM']);
-     }
-   }
- | 'REVOKE' UserOrRoleList 'FROM' 'CURSOR'
-   {
-     parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
-   }
- | 'REVOKE' UserOrRoleList 'FROM' PrincipalSpecificationList_EDIT
- | 'REVOKE' 'ROLE' UserOrRoleList 'CURSOR'
-   {
-     parser.suggestKeywords(['FROM']);
-   }
- | 'REVOKE' 'ROLE' UserOrRoleList 'FROM' 'CURSOR'
-   {
-     parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
-   }
- | 'REVOKE' 'ROLE' UserOrRoleList 'FROM' PrincipalSpecificationList_EDIT
-
- | 'REVOKE' 'ADMIN' 'OPTION' 'CURSOR'
-   {
-     parser.suggestKeywords(['FOR']);
-   }
- | 'REVOKE' 'ADMIN' 'OPTION' 'FOR' 'CURSOR'
-   {
-     parser.suggestKeywords(['ROLE']);
-   }
- | 'REVOKE' 'ADMIN' 'OPTION' 'FOR' UserOrRoleList 'CURSOR'
-   {
-     parser.suggestKeywords(['FROM']);
-   }
- | 'REVOKE' 'ADMIN' 'OPTION' 'FOR' UserOrRoleList 'FROM' 'CURSOR'
-   {
-     parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
-   }
- | 'REVOKE' 'ADMIN' 'OPTION' 'FOR' UserOrRoleList 'FROM' PrincipalSpecificationList_EDIT
- | 'REVOKE' 'ADMIN' 'OPTION' 'FOR' 'ROLE' UserOrRoleList 'CURSOR'
-   {
-     parser.suggestKeywords(['FROM']);
-   }
- | 'REVOKE' 'ADMIN' 'OPTION' 'FOR' 'ROLE' UserOrRoleList 'FROM' 'CURSOR'
-   {
-     parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
-   }
- | 'REVOKE' 'ADMIN' 'OPTION' 'FOR' 'ROLE' UserOrRoleList 'FROM' PrincipalSpecificationList_EDIT
- | 'REVOKE' 'ALL' PrivilegesOrGrantOption_EDIT
- | 'REVOKE' 'ALL' PrivilegesOrGrantOption 'CURSOR'
-   {
-     parser.suggestKeywords(['FROM']);
-   }
- ;
-
-PrivilegesOrGrantOption
- : 'PRIVILEGES'
- | 'GRANT' 'OPTION'
- ;
-
-PrivilegesOrGrantOption_EDIT
- : 'GRANT' 'CURSOR'
-   {
-     parser.suggestKeywords(['OPTION']);
-   }
- ;

+ 0 - 293
desktop/core/src/desktop/js/parse/jison/sql/hive/sql_load.jison

@@ -1,293 +0,0 @@
-// Licensed to Cloudera, Inc. under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  Cloudera, Inc. licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-DataManipulation
- : LoadStatement
- | ImportStatement
- | ExportStatement
- ;
-
-DataManipulation_EDIT
- : LoadStatement_EDIT
- | ImportStatement_EDIT
- | ExportStatement_EDIT
- ;
-
-LoadStatement
- : 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath OptionalOverwrite 'INTO' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec OptionalInputFormat
-   {
-     parser.addTablePrimary($9);
-   }
- ;
-
-LoadStatement_EDIT
- : 'LOAD' 'CURSOR'
-   {
-     parser.suggestKeywords(['DATA LOCAL INPATH', 'DATA INPATH']);
-   }
- | 'LOAD' 'DATA' OptionalLocal 'CURSOR'
-   {
-     if (!$3) {
-       parser.suggestKeywords(['INPATH', 'LOCAL INPATH']);
-     } else {
-       parser.suggestKeywords(['INPATH']);
-     }
-   }
- | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath_EDIT OptionalOverwrite
- | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath OptionalOverwrite 'CURSOR'
-   {
-     if (!$6) {
-       parser.suggestKeywords(['OVERWRITE INTO TABLE', 'INTO TABLE']);
-     } else {
-       parser.suggestKeywords(['INTO TABLE']);
-     }
-   }
- | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath OptionalOverwrite 'INTO' 'CURSOR'
-   {
-     parser.suggestKeywords([ 'TABLE' ]);
-   }
- | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath OptionalOverwrite 'INTO' 'TABLE' 'CURSOR'
-   {
-     parser.suggestTables();
-     parser.suggestDatabases({ appendDot: true });
-   }
- | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath OptionalOverwrite 'INTO' 'TABLE' SchemaQualifiedTableIdentifier_EDIT OptionalPartitionSpec OptionalInputFormat
- | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath OptionalOverwrite 'INTO' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec OptionalInputFormat 'CURSOR'
-   {
-     parser.addTablePrimary($9);
-     if (!$10 && !$11) {
-       parser.suggestKeywords(['INPUTFORMAT', 'PARTITION']);
-     } else if ($10 && !$11) {
-       parser.suggestKeywords(['INPUTFORMAT']);
-     }
-   }
- | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath OptionalOverwrite 'INTO' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec_EDIT OptionalInputFormat
-   {
-     parser.addTablePrimary($9);
-   }
- | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath OptionalOverwrite 'INTO' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec InputFormat_EDIT
-   {
-     parser.addTablePrimary($9);
-   }
- | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath_EDIT OptionalOverwrite 'INTO' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec OptionalInputFormat
-   {
-     parser.addTablePrimary($9);
-   }
- ;
-
-OptionalOverwrite
- :
- | 'OVERWRITE'
- ;
-
-OptionalLocal
- :
- | 'LOCAL'
- ;
-
-OptionalInputFormat
- :
- | InputFormat
- ;
-
-InputFormat
- : 'INPUTFORMAT' QuotedValue 'SERDE' QuotedValue
- ;
-
-InputFormat_EDIT
- : 'INPUTFORMAT' QuotedValue 'CURSOR'
-   {
-     parser.suggestKeywords(['SERDE']);
-   }
- ;
-
-ImportStatement
- : 'IMPORT' OptionalTableWithPartition PushHdfsLexerState 'FROM' HdfsPath OptionalHdfsLocation
- ;
-
-ImportStatement_EDIT
- : 'IMPORT' 'CURSOR' OptionalTableWithPartition
-   {
-     if (!$3) {
-       parser.suggestKeywords(['EXTERNAL TABLE', 'FROM', 'TABLE']);
-     } else if (!$3.hasExternal) {
-       parser.suggestKeywords(['EXTERNAL']);
-     }
-   }
- | 'IMPORT' TableWithPartition 'CURSOR'
-   {
-     if ($2.suggestKeywords) {
-        parser.suggestKeywords(parser.createWeightedKeywords($2.suggestKeywords, 2).concat(['FROM']));
-      } else {
-        parser.suggestKeywords(['FROM']);
-      }
-   }
- | 'IMPORT' TableWithPartition_EDIT
- | 'IMPORT' OptionalTableWithPartition PushHdfsLexerState 'FROM' HdfsPath_EDIT OptionalHdfsLocation
- | 'IMPORT' OptionalTableWithPartition PushHdfsLexerState 'FROM' HdfsPath HdfsLocation_EDIT
- | 'IMPORT' OptionalTableWithPartition PushHdfsLexerState 'FROM' HdfsPath OptionalHdfsLocation 'CURSOR'
-   {
-     if (!$6) {
-       parser.suggestKeywords(['LOCATION']);
-     }
-   }
- | 'IMPORT' 'CURSOR' OptionalTableWithPartition PushHdfsLexerState 'FROM' HdfsPath OptionalHdfsLocation
-   {
-     if (!$3) {
-       parser.suggestKeywords(['EXTERNAL TABLE', 'TABLE']);
-     } else if (!$3.hasExternal) {
-       parser.suggestKeywords(['EXTERNAL']);
-     }
-   }
-| 'IMPORT' TableWithPartition_EDIT PushHdfsLexerState 'FROM' HdfsPath OptionalHdfsLocation
- | 'IMPORT' TableWithPartition 'CURSOR' PushHdfsLexerState 'FROM' HdfsPath OptionalHdfsLocation
-    {
-      if ($2.suggestKeywords) {
-        parser.suggestKeywords(parser.createWeightedKeywords($2.suggestKeywords, 2).concat(['FROM']));
-      }
-    }
- ;
-
-OptionalTableWithPartition
- :
- | TableWithPartition
- ;
-
-TableWithPartition
- : 'EXTERNAL' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec
-   {
-     parser.addTablePrimary($3);
-     if (!$4) {
-       $$ = { hasExternal: true, suggestKeywords: ['PARTITION'] };
-     } else {
-       $$ = { hasExternal: true }
-     }
-   }
- | 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec
-   {
-     parser.addTablePrimary($2);
-     if (!$3) {
-       $$ = { suggestKeywords: ['PARTITION'] };
-     }
-   }
- ;
-
-TableWithPartition_EDIT
- : 'EXTERNAL' 'CURSOR'
-   {
-     parser.suggestKeywords(['TABLE']);
-   }
- | 'EXTERNAL' 'TABLE' 'CURSOR'
-   {
-     parser.suggestTables();
-     parser.suggestDatabases({ appendDot: true });
-   }
- | 'EXTERNAL' 'TABLE' SchemaQualifiedTableIdentifier_EDIT OptionalPartitionSpec
- | 'EXTERNAL' 'TABLE' SchemaQualifiedTableIdentifier PartitionSpec_EDIT
-   {
-     parser.addTablePrimary($3);
-   }
- | 'TABLE' 'CURSOR'
-   {
-     parser.suggestTables();
-     parser.suggestDatabases({ appendDot: true });
-   }
-
- | 'TABLE' SchemaQualifiedTableIdentifier_EDIT OptionalPartitionSpec
- | 'TABLE' SchemaQualifiedTableIdentifier PartitionSpec_EDIT
-   {
-     parser.addTablePrimary($3);
-   }
- ;
-
-ExportStatement
- : 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec PushHdfsLexerState 'TO' HdfsPath
-   {
-     parser.addTablePrimary($3);
-   }
- | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec PushHdfsLexerState 'TO' HdfsPath 'FOR' 'REPLICATION' '(' QuotedValue ')'
-   {
-     parser.addTablePrimary($3);
-   }
- ;
-
-ExportStatement_EDIT
- : 'EXPORT' 'CURSOR'
-   {
-     parser.suggestKeywords(['TABLE']);
-   }
- | 'EXPORT' 'TABLE' 'CURSOR'
-   {
-     parser.suggestTables();
-     parser.suggestDatabases({ appendDot: true });
-   }
- | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier_EDIT
- | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec 'CURSOR'
-   {
-     parser.addTablePrimary($3);
-     if (!$4) {
-       parser.suggestKeywords([{ weight: 2, value: 'PARTITION' }, { weight: 1, value: 'TO' }]);
-     } else {
-       parser.suggestKeywords([ 'TO' ]);
-     }
-   }
- | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier PartitionSpec_EDIT
-   {
-     parser.addTablePrimary($3);
-   }
- | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec PushHdfsLexerState 'TO' HdfsPath_EDIT
-   {
-     parser.addTablePrimary($3);
-   }
- | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec PushHdfsLexerState 'TO' HdfsPath 'CURSOR'
-   {
-     parser.addTablePrimary($3);
-     parser.suggestKeywords(['FOR replication()']);
-   }
- | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec PushHdfsLexerState 'TO' HdfsPath 'FOR' 'CURSOR'
-   {
-     parser.addTablePrimary($3);
-     parser.suggestKeywords(['replication()']);
-   }
- | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier_EDIT OptionalPartitionSpec PushHdfsLexerState 'TO' HdfsPath
- | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier_EDIT OptionalPartitionSpec PushHdfsLexerState 'TO' HdfsPath 'FOR' 'REPLICATION' '(' QuotedValue ')'
- | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec 'CURSOR' PushHdfsLexerState 'TO' HdfsPath
-   {
-     parser.addTablePrimary($3);
-     if (!$4) {
-       parser.suggestKeywords(['PARTITION']);
-     }
-   }
- | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec 'CURSOR' PushHdfsLexerState 'TO' HdfsPath 'FOR' 'REPLICATION' '(' QuotedValue ')'
-   {
-     parser.addTablePrimary($3);
-     if (!$4) {
-       parser.suggestKeywords(['PARTITION']);
-     }
-   }
- | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier PartitionSpec_EDIT PushHdfsLexerState 'TO' HdfsPath
-   {
-     parser.addTablePrimary($3);
-   }
- | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier PartitionSpec_EDIT PushHdfsLexerState 'TO' HdfsPath 'FOR' 'REPLICATION' '(' QuotedValue ')'
-   {
-     parser.addTablePrimary($3);
-   }
- | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec PushHdfsLexerState 'TO' HdfsPath_EDIT 'FOR' 'REPLICATION' '(' QuotedValue ')'
-   {
-     parser.addTablePrimary($3);
-   }
- ;

+ 32 - 6
desktop/core/src/desktop/js/parse/jison/sql/hive/structure.json

@@ -33,7 +33,23 @@
     "drop/drop_temporary_macro.jison",
     "drop/drop_view.jison",
     "explain/explain.jison",
+    "export/export.jison",
+    "grant/grant_common.jison",
+    "grant/grant_privilege.jison",
+    "grant/grant_role.jison",
+    "grant/grant_user.jison",
+    "grant/privilege_type.jison",
+    "import/import.jison",
+    "load/load_data.jison",
+    "msck/msck.jison",
     "reload/reload.jison",
+    "revoke/revoke_admin_option_for.jison",
+    "revoke/revoke_all.jison",
+    "revoke/revoke_common.jison",
+    "revoke/revoke_grant_option_for.jison",
+    "revoke/revoke_privilege.jison",
+    "revoke/revoke_role.jison",
+    "revoke/revoke_user.jison",
     "show/show_columns.jison",
     "show/show_common.jison",
     "show/show_compactions.jison",
@@ -79,11 +95,8 @@
     "../generic/use/use.jison",
     "../generic/sql_valueExpression.jison",
     "sql_error.jison",
-    "sql_grant.jison",
     "sql_insert.jison",
-    "sql_load.jison",
     "sql_main.jison",
-    "sql_msck.jison",
     "sql_set.jison",
     "sql_update.jison",
     "../generic/autocomplete_footer.jison"
@@ -121,7 +134,23 @@
     "drop/drop_temporary_macro.jison",
     "drop/drop_view.jison",
     "explain/explain.jison",
+    "export/export.jison",
+    "grant/grant_common.jison",
+    "grant/grant_privilege.jison",
+    "grant/grant_role.jison",
+    "grant/grant_user.jison",
+    "grant/privilege_type.jison",
+    "import/import.jison",
+    "load/load_data.jison",
+    "msck/msck.jison",
     "reload/reload.jison",
+    "revoke/revoke_admin_option_for.jison",
+    "revoke/revoke_all.jison",
+    "revoke/revoke_common.jison",
+    "revoke/revoke_grant_option_for.jison",
+    "revoke/revoke_privilege.jison",
+    "revoke/revoke_role.jison",
+    "revoke/revoke_user.jison",
     "show/show_columns.jison",
     "show/show_common.jison",
     "show/show_compactions.jison",
@@ -166,11 +195,8 @@
     "udf/sql_extract.jison",
     "../generic/use/use.jison",
     "../generic/sql_valueExpression.jison",
-    "sql_grant.jison",
     "sql_insert.jison",
-    "sql_load.jison",
     "sql_main.jison",
-    "sql_msck.jison",
     "sql_set.jison",
     "sql_update.jison",
     "../generic/syntax_footer.jison"

+ 90 - 0
desktop/core/src/desktop/js/parse/jison/sql/presto/load/load_data.jison

@@ -0,0 +1,90 @@
+// Licensed to Cloudera, Inc. under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  Cloudera, Inc. licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+DataManipulation
+ : LoadDataStatement
+ ;
+
+DataManipulation_EDIT
+ : LoadDataStatement_EDIT
+ ;
+
+LoadDataStatement
+ : 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath OptionalOverwrite 'INTO' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec
+   {
+     parser.addTablePrimary($9);
+   }
+ ;
+
+LoadDataStatement_EDIT
+ : 'LOAD' 'CURSOR'
+   {
+     parser.suggestKeywords(['DATA LOCAL INPATH', 'DATA INPATH']);
+   }
+ | 'LOAD' 'DATA' OptionalLocal 'CURSOR'
+   {
+     if (!$3) {
+       parser.suggestKeywords(['INPATH', 'LOCAL INPATH']);
+     } else {
+       parser.suggestKeywords(['INPATH']);
+     }
+   }
+ | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath_EDIT OptionalOverwrite
+ | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath OptionalOverwrite 'CURSOR'
+   {
+     if (!$6) {
+       parser.suggestKeywords(['OVERWRITE INTO TABLE', 'INTO TABLE']);
+     } else {
+       parser.suggestKeywords(['INTO TABLE']);
+     }
+   }
+ | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath OptionalOverwrite 'INTO' 'CURSOR'
+   {
+     parser.suggestKeywords([ 'TABLE' ]);
+   }
+ | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath OptionalOverwrite 'INTO' 'TABLE' 'CURSOR'
+   {
+     parser.suggestTables();
+     parser.suggestDatabases({ appendDot: true });
+   }
+ | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath OptionalOverwrite 'INTO' 'TABLE' SchemaQualifiedTableIdentifier_EDIT OptionalPartitionSpec
+ | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath OptionalOverwrite 'INTO' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec 'CURSOR'
+   {
+     parser.addTablePrimary($9);
+     if (!$10) {
+       parser.suggestKeywords(['PARTITION']);
+     }
+   }
+ | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath OptionalOverwrite 'INTO' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec_EDIT
+   {
+     parser.addTablePrimary($9);
+   }
+ | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath_EDIT OptionalOverwrite 'INTO' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec
+   {
+     parser.addTablePrimary($9);
+   }
+ ;
+
+OptionalOverwrite
+ :
+ | 'OVERWRITE'
+ ;
+
+OptionalLocal
+ :
+ | 'LOCAL'
+ ;
+

+ 0 - 0
desktop/core/src/desktop/js/parse/jison/sql/presto/sql_msck.jison → desktop/core/src/desktop/js/parse/jison/sql/presto/msck/msck.jison


+ 0 - 271
desktop/core/src/desktop/js/parse/jison/sql/presto/sql_load.jison

@@ -1,271 +0,0 @@
-// Licensed to Cloudera, Inc. under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  Cloudera, Inc. licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-DataManipulation
- : LoadStatement
- | ImportStatement
- | ExportStatement
- ;
-
-DataManipulation_EDIT
- : LoadStatement_EDIT
- | ImportStatement_EDIT
- | ExportStatement_EDIT
- ;
-
-LoadStatement
- : 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath OptionalOverwrite 'INTO' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec
-   {
-     parser.addTablePrimary($9);
-   }
- ;
-
-LoadStatement_EDIT
- : 'LOAD' 'CURSOR'
-   {
-     parser.suggestKeywords(['DATA LOCAL INPATH', 'DATA INPATH']);
-   }
- | 'LOAD' 'DATA' OptionalLocal 'CURSOR'
-   {
-     if (!$3) {
-       parser.suggestKeywords(['INPATH', 'LOCAL INPATH']);
-     } else {
-       parser.suggestKeywords(['INPATH']);
-     }
-   }
- | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath_EDIT OptionalOverwrite
- | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath OptionalOverwrite 'CURSOR'
-   {
-     if (!$6) {
-       parser.suggestKeywords(['OVERWRITE INTO TABLE', 'INTO TABLE']);
-     } else {
-       parser.suggestKeywords(['INTO TABLE']);
-     }
-   }
- | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath OptionalOverwrite 'INTO' 'CURSOR'
-   {
-     parser.suggestKeywords([ 'TABLE' ]);
-   }
- | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath OptionalOverwrite 'INTO' 'TABLE' 'CURSOR'
-   {
-     parser.suggestTables();
-     parser.suggestDatabases({ appendDot: true });
-   }
- | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath OptionalOverwrite 'INTO' 'TABLE' SchemaQualifiedTableIdentifier_EDIT OptionalPartitionSpec
- | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath OptionalOverwrite 'INTO' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec 'CURSOR'
-   {
-     parser.addTablePrimary($9);
-     if (!$10) {
-       parser.suggestKeywords(['PARTITION']);
-     }
-   }
- | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath OptionalOverwrite 'INTO' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec_EDIT
-   {
-     parser.addTablePrimary($9);
-   }
- | 'LOAD' 'DATA' OptionalLocal 'INPATH' HdfsPath_EDIT OptionalOverwrite 'INTO' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec
-   {
-     parser.addTablePrimary($9);
-   }
- ;
-
-OptionalOverwrite
- :
- | 'OVERWRITE'
- ;
-
-OptionalLocal
- :
- | 'LOCAL'
- ;
-
-ImportStatement
- : 'IMPORT' OptionalTableWithPartition PushHdfsLexerState 'FROM' HdfsPath OptionalHdfsLocation
- ;
-
-ImportStatement_EDIT
- : 'IMPORT' 'CURSOR' OptionalTableWithPartition
-   {
-     if (!$3) {
-       parser.suggestKeywords(['EXTERNAL TABLE', 'FROM', 'TABLE']);
-     } else if (!$3.hasExternal) {
-       parser.suggestKeywords(['EXTERNAL']);
-     }
-   }
- | 'IMPORT' TableWithPartition 'CURSOR'
-   {
-     if ($2.suggestKeywords) {
-        parser.suggestKeywords(parser.createWeightedKeywords($2.suggestKeywords, 2).concat(['FROM']));
-      } else {
-        parser.suggestKeywords(['FROM']);
-      }
-   }
- | 'IMPORT' TableWithPartition_EDIT
- | 'IMPORT' OptionalTableWithPartition PushHdfsLexerState 'FROM' HdfsPath_EDIT OptionalHdfsLocation
- | 'IMPORT' OptionalTableWithPartition PushHdfsLexerState 'FROM' HdfsPath HdfsLocation_EDIT
- | 'IMPORT' OptionalTableWithPartition PushHdfsLexerState 'FROM' HdfsPath OptionalHdfsLocation 'CURSOR'
-   {
-     if (!$6) {
-       parser.suggestKeywords(['LOCATION']);
-     }
-   }
- | 'IMPORT' 'CURSOR' OptionalTableWithPartition PushHdfsLexerState 'FROM' HdfsPath OptionalHdfsLocation
-   {
-     if (!$3) {
-       parser.suggestKeywords(['EXTERNAL TABLE', 'TABLE']);
-     } else if (!$3.hasExternal) {
-       parser.suggestKeywords(['EXTERNAL']);
-     }
-   }
-| 'IMPORT' TableWithPartition_EDIT PushHdfsLexerState 'FROM' HdfsPath OptionalHdfsLocation
- | 'IMPORT' TableWithPartition 'CURSOR' PushHdfsLexerState 'FROM' HdfsPath OptionalHdfsLocation
-    {
-      if ($2.suggestKeywords) {
-        parser.suggestKeywords(parser.createWeightedKeywords($2.suggestKeywords, 2).concat(['FROM']));
-      }
-    }
- ;
-
-OptionalTableWithPartition
- :
- | TableWithPartition
- ;
-
-TableWithPartition
- : 'EXTERNAL' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec
-   {
-     parser.addTablePrimary($3);
-     if (!$4) {
-       $$ = { hasExternal: true, suggestKeywords: ['PARTITION'] };
-     } else {
-       $$ = { hasExternal: true }
-     }
-   }
- | 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec
-   {
-     parser.addTablePrimary($2);
-     if (!$3) {
-       $$ = { suggestKeywords: ['PARTITION'] };
-     }
-   }
- ;
-
-TableWithPartition_EDIT
- : 'EXTERNAL' 'CURSOR'
-   {
-     parser.suggestKeywords(['TABLE']);
-   }
- | 'EXTERNAL' 'TABLE' 'CURSOR'
-   {
-     parser.suggestTables();
-     parser.suggestDatabases({ appendDot: true });
-   }
- | 'EXTERNAL' 'TABLE' SchemaQualifiedTableIdentifier_EDIT OptionalPartitionSpec
- | 'EXTERNAL' 'TABLE' SchemaQualifiedTableIdentifier PartitionSpec_EDIT
-   {
-     parser.addTablePrimary($3);
-   }
- | 'TABLE' 'CURSOR'
-   {
-     parser.suggestTables();
-     parser.suggestDatabases({ appendDot: true });
-   }
-
- | 'TABLE' SchemaQualifiedTableIdentifier_EDIT OptionalPartitionSpec
- | 'TABLE' SchemaQualifiedTableIdentifier PartitionSpec_EDIT
-   {
-     parser.addTablePrimary($3);
-   }
- ;
-
-ExportStatement
- : 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec PushHdfsLexerState 'TO' HdfsPath
-   {
-     parser.addTablePrimary($3);
-   }
- | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec PushHdfsLexerState 'TO' HdfsPath 'FOR' 'REPLICATION' '(' QuotedValue ')'
-   {
-     parser.addTablePrimary($3);
-   }
- ;
-
-ExportStatement_EDIT
- : 'EXPORT' 'CURSOR'
-   {
-     parser.suggestKeywords(['TABLE']);
-   }
- | 'EXPORT' 'TABLE' 'CURSOR'
-   {
-     parser.suggestTables();
-     parser.suggestDatabases({ appendDot: true });
-   }
- | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier_EDIT
- | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec 'CURSOR'
-   {
-     parser.addTablePrimary($3);
-     if (!$4) {
-       parser.suggestKeywords([{ weight: 2, value: 'PARTITION' }, { weight: 1, value: 'TO' }]);
-     } else {
-       parser.suggestKeywords([ 'TO' ]);
-     }
-   }
- | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier PartitionSpec_EDIT
-   {
-     parser.addTablePrimary($3);
-   }
- | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec PushHdfsLexerState 'TO' HdfsPath_EDIT
-   {
-     parser.addTablePrimary($3);
-   }
- | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec PushHdfsLexerState 'TO' HdfsPath 'CURSOR'
-   {
-     parser.addTablePrimary($3);
-     parser.suggestKeywords(['FOR replication()']);
-   }
- | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec PushHdfsLexerState 'TO' HdfsPath 'FOR' 'CURSOR'
-   {
-     parser.addTablePrimary($3);
-     parser.suggestKeywords(['replication()']);
-   }
- | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier_EDIT OptionalPartitionSpec PushHdfsLexerState 'TO' HdfsPath
- | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier_EDIT OptionalPartitionSpec PushHdfsLexerState 'TO' HdfsPath 'FOR' 'REPLICATION' '(' QuotedValue ')'
- | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec 'CURSOR' PushHdfsLexerState 'TO' HdfsPath
-   {
-     parser.addTablePrimary($3);
-     if (!$4) {
-       parser.suggestKeywords(['PARTITION']);
-     }
-   }
- | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec 'CURSOR' PushHdfsLexerState 'TO' HdfsPath 'FOR' 'REPLICATION' '(' QuotedValue ')'
-   {
-     parser.addTablePrimary($3);
-     if (!$4) {
-       parser.suggestKeywords(['PARTITION']);
-     }
-   }
- | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier PartitionSpec_EDIT PushHdfsLexerState 'TO' HdfsPath
-   {
-     parser.addTablePrimary($3);
-   }
- | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier PartitionSpec_EDIT PushHdfsLexerState 'TO' HdfsPath 'FOR' 'REPLICATION' '(' QuotedValue ')'
-   {
-     parser.addTablePrimary($3);
-   }
- | 'EXPORT' 'TABLE' SchemaQualifiedTableIdentifier OptionalPartitionSpec PushHdfsLexerState 'TO' HdfsPath_EDIT 'FOR' 'REPLICATION' '(' QuotedValue ')'
-   {
-     parser.addTablePrimary($3);
-   }
- ;

+ 32 - 6
desktop/core/src/desktop/js/parse/jison/sql/presto/structure.json

@@ -32,7 +32,23 @@
     "../hive/drop/drop_temporary_function.jison",
     "../hive/drop/drop_temporary_macro.jison",
     "../hive/drop/drop_view.jison",
+    "../hive/export/export.jison",
+    "../hive/grant/grant_common.jison",
+    "../hive/grant/grant_privilege.jison",
+    "../hive/grant/grant_role.jison",
+    "../hive/grant/grant_user.jison",
+    "../hive/grant/privilege_type.jison",
+    "../hive/import/import.jison",
+    "load/load_data.jison",
+    "msck/msck.jison",
     "../hive/reload/reload.jison",
+    "../hive/revoke/revoke_admin_option_for.jison",
+    "../hive/revoke/revoke_all.jison",
+    "../hive/revoke/revoke_common.jison",
+    "../hive/revoke/revoke_grant_option_for.jison",
+    "../hive/revoke/revoke_privilege.jison",
+    "../hive/revoke/revoke_role.jison",
+    "../hive/revoke/revoke_user.jison",
     "../hive/show/show_columns.jison",
     "../hive/show/show_common.jison",
     "../hive/show/show_compactions.jison",
@@ -78,11 +94,8 @@
     "../generic/use/use.jison",
     "../generic/sql_valueExpression.jison",
     "../hive/sql_error.jison",
-    "../hive/sql_grant.jison",
     "../hive/sql_insert.jison",
-    "sql_load.jison",
     "sql_main.jison",
-    "sql_msck.jison",
     "../hive/sql_set.jison",
     "../hive/sql_update.jison",
     "../generic/autocomplete_footer.jison"
@@ -119,7 +132,23 @@
     "../hive/drop/drop_temporary_function.jison",
     "../hive/drop/drop_temporary_macro.jison",
     "../hive/drop/drop_view.jison",
+    "../hive/export/export.jison",
+    "../hive/grant/grant_common.jison",
+    "../hive/grant/grant_privilege.jison",
+    "../hive/grant/grant_role.jison",
+    "../hive/grant/grant_user.jison",
+    "../hive/grant/privilege_type.jison",
+    "../hive/import/import.jison",
+    "load/load_data.jison",
+    "msck/msck.jison",
     "../hive/reload/reload.jison",
+    "../hive/revoke/revoke_admin_option_for.jison",
+    "../hive/revoke/revoke_all.jison",
+    "../hive/revoke/revoke_common.jison",
+    "../hive/revoke/revoke_grant_option_for.jison",
+    "../hive/revoke/revoke_privilege.jison",
+    "../hive/revoke/revoke_role.jison",
+    "../hive/revoke/revoke_user.jison",
     "../hive/show/show_columns.jison",
     "../hive/show/show_common.jison",
     "../hive/show/show_compactions.jison",
@@ -164,11 +193,8 @@
     "../hive/udf/sql_extract.jison",
     "../generic/use/use.jison",
     "../generic/sql_valueExpression.jison",
-    "../hive/sql_grant.jison",
     "../hive/sql_insert.jison",
-    "sql_load.jison",
     "sql_main.jison",
-    "sql_msck.jison",
     "../hive/sql_set.jison",
     "../hive/sql_update.jison",
     "../generic/syntax_footer.jison"

文件差异内容过多而无法显示
+ 0 - 0
desktop/core/src/desktop/js/parse/sql/hive/hiveAutocompleteParser.js


文件差异内容过多而无法显示
+ 0 - 0
desktop/core/src/desktop/js/parse/sql/hive/hiveSyntaxParser.js


文件差异内容过多而无法显示
+ 0 - 0
desktop/core/src/desktop/js/parse/sql/presto/prestoAutocompleteParser.js


文件差异内容过多而无法显示
+ 0 - 0
desktop/core/src/desktop/js/parse/sql/presto/prestoSyntaxParser.js


部分文件因为文件数量过多而无法显示