浏览代码

Hive Autocomplete and docs update (#2811)

* [editor] Update the Hive autocomplete and syntax parsers

* [editor] Update the built-in Hive language reference, UDF library and highliting rules
Johan Åhlén 3 年之前
父节点
当前提交
fef28c864f
共有 46 个文件被更改,包括 1158 次插入192 次删除
  1. 17 13
      desktop/core/src/desktop/js/apps/editor/components/aceEditor/autocomplete/AutocompleteResults.ts
  2. 20 19
      desktop/core/src/desktop/js/ext/ace/mode-hive.js
  3. 47 0
      desktop/core/src/desktop/js/parse/jison/sql/hive/alter/alter_connector.jison
  4. 20 12
      desktop/core/src/desktop/js/parse/jison/sql/hive/alter/alter_table.jison
  5. 43 9
      desktop/core/src/desktop/js/parse/jison/sql/hive/create/create_common.jison
  6. 81 0
      desktop/core/src/desktop/js/parse/jison/sql/hive/create/create_connector.jison
  7. 23 0
      desktop/core/src/desktop/js/parse/jison/sql/hive/create/create_database.jison
  8. 8 1
      desktop/core/src/desktop/js/parse/jison/sql/hive/create/create_materialized_view.jison
  9. 66 26
      desktop/core/src/desktop/js/parse/jison/sql/hive/create/create_table.jison
  10. 1 1
      desktop/core/src/desktop/js/parse/jison/sql/hive/describe/describe.jison
  11. 42 0
      desktop/core/src/desktop/js/parse/jison/sql/hive/describe/describe_connector.jison
  12. 45 0
      desktop/core/src/desktop/js/parse/jison/sql/hive/drop/drop_connector.jison
  13. 1 1
      desktop/core/src/desktop/js/parse/jison/sql/hive/insert/insert.jison
  14. 1 1
      desktop/core/src/desktop/js/parse/jison/sql/hive/merge/merge.jison
  15. 4 5
      desktop/core/src/desktop/js/parse/jison/sql/hive/show/show_connectors.jison
  16. 9 0
      desktop/core/src/desktop/js/parse/jison/sql/hive/sql.jisonlex
  17. 30 0
      desktop/core/src/desktop/js/parse/jison/sql/hive/sql_main.jison
  18. 10 2
      desktop/core/src/desktop/js/parse/jison/sql/hive/structure.json
  19. 1 0
      desktop/core/src/desktop/js/parse/jison/sql/impala/structure.json
  20. 0 2
      desktop/core/src/desktop/js/parse/jison/sql/presto/structure.json
  21. 0 0
      desktop/core/src/desktop/js/parse/sql/hive/hiveAutocompleteParser.js
  22. 0 0
      desktop/core/src/desktop/js/parse/sql/hive/hiveSyntaxParser.js
  23. 3 3
      desktop/core/src/desktop/js/parse/sql/hive/keywords.json
  24. 227 74
      desktop/core/src/desktop/js/parse/sql/hive/test/hiveAutocompleteParser.Alter.test.js
  25. 298 1
      desktop/core/src/desktop/js/parse/sql/hive/test/hiveAutocompleteParser.Create.test.js
  26. 24 2
      desktop/core/src/desktop/js/parse/sql/hive/test/hiveAutocompleteParser.Describe.test.js
  27. 36 0
      desktop/core/src/desktop/js/parse/sql/hive/test/hiveAutocompleteParser.Drop.test.js
  28. 12 0
      desktop/core/src/desktop/js/parse/sql/hive/test/hiveAutocompleteParser.Insert.test.js
  29. 51 0
      desktop/core/src/desktop/js/parse/sql/hive/test/hiveAutocompleteParser.Select.test.js
  30. 15 0
      desktop/core/src/desktop/js/parse/sql/hive/test/hiveAutocompleteParser.Show.test.js
  31. 0 0
      desktop/core/src/desktop/js/parse/sql/impala/impalaSyntaxParser.js
  32. 1 1
      desktop/core/src/desktop/js/parse/sql/impala/test/impalaAutocompleteParser.Create.test.js
  33. 1 1
      desktop/core/src/desktop/js/parse/sql/presto/test/prestoAutocompleteParser.Create.test.js
  34. 1 0
      desktop/core/src/desktop/js/parse/sql/sqlParseUtils.js
  35. 1 0
      desktop/core/src/desktop/js/sql/reference/hive/reservedKeywords.ts
  36. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_177049669.json
  37. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_177050456.json
  38. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_27362034.json
  39. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_27362036.json
  40. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_27838462.json
  41. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_27842758.json
  42. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_30754722.json
  43. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_34838882.json
  44. 0 0
      desktop/core/src/desktop/static/desktop/docs/hive/_40509928.json
  45. 0 0
      desktop/core/src/desktop/templates/sql_doc_index.mako
  46. 19 18
      tools/ace-editor/lib/ace/mode/hive_highlight_rules.js

+ 17 - 13
desktop/core/src/desktop/js/apps/editor/components/aceEditor/autocomplete/AutocompleteResults.ts

@@ -135,6 +135,15 @@ const HIVE_DIALECT = 'hive';
 const IMPALA_DIALECT = 'impala';
 const PHOENIX_DIALECT = 'phoenix';
 
+const HIVE_VIRTUAL_COLUMNS = [
+  'BLOCK__OFFSET__INSIDE__FILE',
+  'GROUPING__ID',
+  'RAW__DATA__SIZE',
+  'ROW__ID',
+  'ROW__IS__DELETED',
+  'ROW__OFFSET__INSIDE__BLOCK'
+];
+
 const locateSubQuery = (subQueries: SubQuery[], subQueryName: string): SubQuery | undefined => {
   if (subQueries) {
     return subQueries.find(knownSubQuery => equalIgnoreCase(knownSubQuery.alias, subQueryName));
@@ -772,19 +781,14 @@ class AutocompleteResults {
     AutocompleteResults.mergeColumns(columnSuggestions);
 
     if (this.dialect() === HIVE_DIALECT && /[^.]$/.test(this.editor.getTextBeforeCursor())) {
-      columnSuggestions.push({
-        value: 'BLOCK__OFFSET__INSIDE__FILE',
-        meta: MetaLabels.Virtual,
-        category: Category.VirtualColumn,
-        popular: false,
-        details: { name: 'BLOCK__OFFSET__INSIDE__FILE' }
-      });
-      columnSuggestions.push({
-        value: 'INPUT__FILE__NAME',
-        meta: MetaLabels.Virtual,
-        category: Category.VirtualColumn,
-        popular: false,
-        details: { name: 'INPUT__FILE__NAME' }
+      HIVE_VIRTUAL_COLUMNS.forEach(virtualColumn => {
+        columnSuggestions.push({
+          value: virtualColumn,
+          meta: MetaLabels.Virtual,
+          category: Category.VirtualColumn,
+          popular: false,
+          details: { name: virtualColumn }
+        });
       });
     }
 

+ 20 - 19
desktop/core/src/desktop/js/ext/ace/mode-hive.js

@@ -7,24 +7,25 @@ ace.define("ace/mode/hive_highlight_rules",["require","exports","module","ace/li
   var HiveHighlightRules = function () {
 
     var keywords =
-      'ABORT|ADD|ADMIN|AFTER|ALL|ALTER|ANALYZE|AND|ARCHIVE|AS|ASC|AST|AUTHORIZATION|AVRO|BETWEEN|BUCKET|BUCKETS|BY|' +
+      'ABORT|ADD|ADMIN|AFTER|ALL|ALTER|ANALYZE|AND|ARCHIVE|AS|ASC|AST|AUTHORIZATION|BETWEEN|BUCKET|BUCKETS|BY|' +
       'CACHE|CASCADE|CASE|CBO|CHANGE|CHECK|CLUSTER|CLUSTERED|COLLECTION|COLUMN|COLUMNS|COMMENT|COMPACT|COMPACTIONS|' +
-      'COMPUTE|CONCATENATE|CONF|CONSTRAINT|COST|CREATE|CROSS|CUBE|CURRENT|DATA|DATABASE|DATABASES|DBPROPERTIES|' +
-      'DEFAULT|DEFERRED|DEFINED|DELETE|DEPENDENCY|DESC|DESCRIBE|DETAIL|DIRECTORY|DISABLE|DISTINCT|DISTRIBUTE|' +
-      'DISTRIBUTED|DIV|DROP|ELSE|ENABLE|END|ESCAPED|EXCHANGE|EXISTS|EXPLAIN|EXPORT|EXPRESSION|EXTENDED|EXTERNAL|' +
-      'FIELDS|FILE|FILEFORMAT|FIRST|FOLLOWING|FOR|FOREIGN|FORMAT|FORMATTED|FROM|FULL|FUNCTION|FUNCTIONS|GRANT|GROUP|' +
-      'GROUPING|HAVING|IDXPROPERTIES|IF|IMPORT|IN|INDEX|INDEXES|INNER|INPATH|INPUTFORMAT|INSERT|INTO|IS|ITEMS|JAR|' +
-      'JOIN|JOINCOST|KEY|KEYS|LAST|LATERAL|LEFT|LIKE|LIMIT|LINES|LITERAL|LOAD|LOCAL|LOCATION|LOCK|LOCKS|MACRO|' +
-      'MATCHED|MATERIALIZED|MERGE|METADATA|MSCK|NO_DROP|NONE|NORELY|NOSCAN|NOT|NOVALIDATE|NULLS|OF|OFFLINE|ON|ONLY|' +
-      'OPERATOR|OPTION|OR|ORDER|OUT|OUTER|OUTPUTFORMAT|OVER|OVERWRITE|OWNER|PARTITION|PARTITIONED|PARTITIONS|' +
-      'PERCENT|PRECEDING|PRIMARY|PRIVILEGES|PURGE|QUARTER|RANGE|REBUILD|RECOVER|REFERENCES|REGEXP|RELOAD|RELY|' +
-      'RENAME|REPAIR|REPLACE|REPLICATION|RESTRICT|REVOKE|REWRITE|RIGHT|RLIKE|ROLE|ROLES|ROLLUP|ROW|ROWS|SCHEMA|' +
-      'SCHEMAS|SELECT|SEMI|SERDEPROPERTIES|SET|SETS|SHOW|SHOW_DATABASE|SKEWED|SORT|SORTED|STATISTICS|STORED|SUMMARY|' +
-      'SYNC|TABLE|TABLES|TABLESAMPLE|TBLPROPERTIES|TEMPORARY|TERMINATED|THEN|TO|TOUCH|TRANSACTIONAL|TRANSACTIONS|' +
-      'TRUNCATE|UNARCHIVE|UNBOUNDED|UNION|UNIQUE|UPDATE|USE|USER|USING|VALUES|VECTORIZATION|VIEW|VIEWS|WAIT|WHEN|' +
-      'WHERE|WINDOW|WITH';
-
-    var builtinConstants = 'FALSE|NULL|TRUE';
+      'COMPUTE|CONCATENATE|CONF|CONNECTOR|CONNECTORS|CONSTRAINT|COST|CREATE|CROSS|CUBE|CURRENT|DATA|DATABASE|' +
+      'DATABASES|DBPROPERTIES|DCPROPERTIES|DEFAULT|DEFERRED|DEFINED|DELETE|DEPENDENCY|DESC|DESCRIBE|DETAIL|DIRECTORY|' +
+      'DISABLE|DISTINCT|DISTRIBUTE|DISTRIBUTED|DIV|DROP|ELSE|ENABLE|END|ESCAPED|EXCHANGE|EXISTS|EXPLAIN|EXPORT|' +
+      'EXPRESSION|EXTENDED|EXTERNAL|FIELDS|FILE|FILEFORMAT|FIRST|FOLLOWING|FOR|FOREIGN|FORMAT|FORMATTED|FROM|FULL|' +
+      'FUNCTION|FUNCTIONS|GRANT|GROUP|GROUPING|HAVING|IDXPROPERTIES|IF|IMPORT|IN|INDEX|INDEXES|INNER|INPATH|' +
+      'INPUTFORMAT|INSERT|INTO|IS|ITEMS|JAR|JOIN|JOINCOST|KEY|KEYS|LAST|LATERAL|LEFT|LIKE|LIMIT|LINES|LITERAL|LOAD|' +
+      'LOCAL|LOCATION|LOCK|LOCKS|MACRO|MATCHED|MATERIALIZED|MERGE|METADATA|MSCK|NO_DROP|NONE|NORELY|NOSCAN|NOT|' +
+      'NOVALIDATE|NULLS|OF|OFFLINE|ON|ONLY|OPERATOR|OPTION|OR|ORDER|OUT|OUTER|OUTPUTFORMAT|OVER|OVERWRITE|OWNER|' +
+      'PARTITION|PARTITIONED|PARTITIONS|PERCENT|PRECEDING|PRIMARY|PRIVILEGES|PURGE|QUARTER|RANGE|REBUILD|RECOVER|' +
+      'REFERENCES|REGEXP|RELOAD|RELY|REMOTE|RENAME|REPAIR|REPLACE|REPLICATION|RESTRICT|REVOKE|REWRITE|RIGHT|RLIKE|' +
+      'ROLE|ROLES|ROLLUP|ROW|ROWS|SCHEMA|SCHEMAS|SELECT|SEMI|SERDEPROPERTIES|SET|SETS|SHOW|SHOW_DATABASE|SKEWED|SORT|' +
+      'SORTED|SPEC|STATISTICS|STORED|SUMMARY|SYNC|TABLE|TABLES|TABLESAMPLE|TBLPROPERTIES|TEMPORARY|TERMINATED|THEN|' +
+      'TO|TOUCH|TRANSACTIONAL|TRANSACTIONS|TRUNCATE|TYPE|UNARCHIVE|UNBOUNDED|UNION|UNIQUE|UPDATE|URL|USE|USER|USING|' +
+      'VALUES|VECTORIZATION|VIEW|VIEWS|WAIT|WHEN|WHERE|WINDOW|WITH';
+
+    var builtinConstants =
+        'AVRO|DELIMITED|FALSE|ICEBERG|JSONFILE|NULL|ORC|PARQUET|RCFILE|SEQUENCEFILE|SERDE|TEXTFILE|TRUE';
 
     var builtinFunctions =
       'ABS|ACOS|ADD_MONTHS|AES_DECRYPT|AES_ENCRYPT|ARRAY|ARRAY_CONTAINS|ASCII|ASIN|ATAN|AVG|BASE64|BIN|BINARY|' +
@@ -44,8 +45,8 @@ ace.define("ace/mode/hive_highlight_rules",["require","exports","module","ace/li
       'XPATH_BOOLEAN|XPATH_DOUBLE|XPATH_FLOAT|XPATH_INT|XPATH_LONG|XPATH_NUMBER|XPATH_SHORT|XPATH_STRING|YEAR';
 
     var dataTypes =
-      'ARRAY|BIGINT|BINARY|BOOLEAN|CHAR|DATE|DECIMAL|DELIMITED|DOUBLE|FLOAT|INT|INTEGER|JSONFILE|MAP|ORC|PARQUET|PRECISION|' +
-      'RCFILE|SEQUENCEFILE|SERDE|SMALLINT|STRING|STRUCT|TEXTFILE|TIMESTAMP|TINYINT|UNIONTYPE|VARCHAR';
+      'ARRAY|BIGINT|BINARY|BOOLEAN|CHAR|DATE|DECIMAL|DOUBLE|FLOAT|INT|INTEGER|MAP|PRECISION|SMALLINT|STRING|STRUCT|' +
+      'TIMESTAMP|TINYINT|UNIONTYPE|VARCHAR';
 
     var keywordMapper = this.createKeywordMapper({
         "support.function": builtinFunctions,

+ 47 - 0
desktop/core/src/desktop/js/parse/jison/sql/hive/alter/alter_connector.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
+ : AlterConnector
+ ;
+
+DataDefinition_EDIT
+ : AlterConnector_EDIT
+ ;
+
+AlterConnector
+ : 'ALTER' 'CONNECTOR' RegularOrBacktickedIdentifier 'SET' 'DCPROPERTIES' ParenthesizedPropertyAssignmentList
+ | 'ALTER' 'CONNECTOR' RegularOrBacktickedIdentifier 'SET' 'URL' QuotedValue
+ | 'ALTER' 'CONNECTOR' RegularOrBacktickedIdentifier 'SET' 'OWNER' RegularOrBacktickedIdentifier
+ | 'ALTER' 'CONNECTOR' RegularOrBacktickedIdentifier 'SET' 'OWNER' 'ROLE' RegularOrBacktickedIdentifier
+ | 'ALTER' 'CONNECTOR' RegularOrBacktickedIdentifier 'SET' 'OWNER' 'USER' RegularOrBacktickedIdentifier
+ ;
+
+AlterConnector_EDIT
+ : 'ALTER' 'CONNECTOR' 'CURSOR'
+ | 'ALTER' 'CONNECTOR' RegularOrBacktickedIdentifier 'CURSOR'
+   {
+     parser.suggestKeywords(['SET DCPROPERTIES', 'SET URL', 'SET OWNER']);
+   }
+ | 'ALTER' 'CONNECTOR' RegularOrBacktickedIdentifier 'SET' 'CURSOR'
+   {
+     parser.suggestKeywords(['DCPROPERTIES', 'URL', 'OWNER']);
+   }
+ | 'ALTER' 'CONNECTOR' RegularOrBacktickedIdentifier 'SET' 'OWNER' 'CURSOR'
+   {
+     parser.suggestKeywords(['ROLE', 'USER']);
+   }
+ ;

+ 20 - 12
desktop/core/src/desktop/js/parse/jison/sql/hive/alter/alter_table.jison

@@ -37,6 +37,7 @@ AlterTable
  | AlterTableLeftSide 'NOT' 'STORED_AS_DIRECTORIES'
  | AlterTableLeftSide 'SET' 'SKEWED_LOCATION' ParenthesizedSkewedLocationList
  | AlterTableLeftSide 'SET' 'OWNER' PrincipalSpecification
+ | AlterTableLeftSide 'UPDATE' 'COLUMNS'
  | AlterTableLeftSide PartitionSpec 'RENAME' 'TO' PartitionSpec
  | AlterTableLeftSide PartitionSpec 'CHANGE' 'COLUMN' ParenthesizedColumnSpecificationList OptionalCascadeOrRestrict
  | AlterTableLeftSide DropOperations
@@ -139,6 +140,10 @@ AlterTable_EDIT
    {
      parser.suggestKeywords(['BY']);
    }
+ | AlterTableLeftSide 'UPDATE' 'CURSOR'
+   {
+     parser.suggestKeywords(['COLUMNS']);
+   }
  | AlterTableLeftSide 'SET' 'OWNER' 'CURSOR'
    {
      parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
@@ -169,9 +174,9 @@ AlterTable_EDIT
      parser.suggestKeywords(['ADD COLUMNS', 'ADD IF NOT EXISTS', 'ADD PARTITION', 'ARCHIVE PARTITION', 'CHANGE',
        'CLUSTERED BY', 'CONCATENATE', 'COMPACT', 'DISABLE NO_DROP', 'DISABLE OFFLINE', 'DROP', 'ENABLE NO_DROP',
        'ENABLE OFFLINE', 'EXCHANGE PARTITION', 'NOT SKEWED', 'NOT STORED AS DIRECTORIES', 'PARTITION',
-       'RECOVER PARTITIONS', 'RENAME TO', 'REPLACE COLUMNS', 'SET FILEFORMAT', 'SET LOCATION', 'SET OWNER', 'SET SERDE',
-       'SET SERDEPROPERTIES', 'SET SKEWED LOCATION', 'SET TBLPROPERTIES', 'SKEWED BY', 'TOUCH', 'UNARCHIVE PARTITION',
-       'UNSET SERDEPROPERTIES']);
+       'RECOVER PARTITIONS', 'RENAME TO', 'REPLACE COLUMNS', 'SET FILEFORMAT', 'SET LOCATION', 'SET OWNER',
+       'SET PARTITION SPEC', 'SET SERDE', 'SET SERDEPROPERTIES', 'SET SKEWED LOCATION', 'SET TBLPROPERTIES',
+       'SKEWED BY', 'TOUCH', 'UNARCHIVE PARTITION', 'UNSET SERDEPROPERTIES', 'UNSET TBLPROPERTIES', 'UPDATE COLUMNS']);
    }
  | AlterTableLeftSide PartitionSpec 'CURSOR'
    {
@@ -189,7 +194,11 @@ AlterTable_EDIT
    }
  | AlterTableLeftSide 'SET' 'CURSOR'
    {
-     parser.suggestKeywords(['FILEFORMAT', 'LOCATION', 'OWNER', 'SERDE', 'SERDEPROPERTIES', 'SKEWED LOCATION', 'TBLPROPERTIES']);
+     parser.suggestKeywords(['FILEFORMAT', 'LOCATION', 'OWNER', 'PARTITION SPEC', 'SERDE', 'SERDEPROPERTIES', 'SKEWED LOCATION', 'TBLPROPERTIES']);
+   }
+ | AlterTableLeftSide 'SET' 'PARTITION' 'CURSOR'
+   {
+     parser.suggestKeywords(['SPEC']);
    }
  | AlterTableLeftSide PartitionSpec PartitionOperations_EDIT
  | AlterTableLeftSide 'RENAME' 'CURSOR'
@@ -202,7 +211,7 @@ AlterTable_EDIT
    }
  | AlterTableLeftSide 'UNSET' 'CURSOR'
    {
-     parser.suggestKeywords(['SERDEPROPERTIES']);
+     parser.suggestKeywords(['SERDEPROPERTIES', 'TBLPROPERTIES']);
    }
  ;
 
@@ -233,7 +242,9 @@ PartitionOperations
  | 'SET' 'TBLPROPERTIES' ParenthesizedPropertyAssignmentList
  | 'SET' 'SERDE' QuotedValue OptionalWithSerdeproperties
  | 'SET' 'SERDEPROPERTIES' ParenthesizedPropertyAssignmentList
+ | 'SET' 'PARTITION' SpecClause
  | 'UNSET' 'SERDEPROPERTIES' ParenthesizedPropertyAssignmentList
+ | 'UNSET' 'TBLPROPERTIES' ParenthesizedPropertyAssignmentList
  | AddReplaceColumns
  | 'CONCATENATE'
  | 'COMPACT' QuotedValue OptionalAndWait OptionalWithOverwriteTblProperties
@@ -291,6 +302,7 @@ PartitionOperations_EDIT
      parser.suggestKeywords(['NO_DROP', 'OFFLINE']);
    }
  | EnableOrDisable NoDropOrOffline_EDIT
+ | 'SET' 'PARTITION' SpecClause_EDIT
  | 'SET' 'FILEFORMAT' 'CURSOR'
    {
      parser.suggestFileFormats();
@@ -427,20 +439,16 @@ AddOrReplace
 
 OptionalAfterOrFirst
  :
- | AfterOrFirst ColumnIdentifier
- ;
-
-AfterOrFirst
- : 'AFTER'
  | 'FIRST'
+ | 'AFTER' ColumnIdentifier
  ;
 
 AfterOrFirst_EDIT
- : AfterOrFirst 'CURSOR'
+ : 'AFTER' 'CURSOR'
    {
      parser.suggestColumns();
    }
- | AfterOrFirst ColumnIdentifier_EDIT
+ | 'AFTER' ColumnIdentifier_EDIT
  ;
 
 OptionalColumn

+ 43 - 9
desktop/core/src/desktop/js/parse/jison/sql/hive/create/create_common.jison

@@ -15,17 +15,19 @@
 // limitations under the License.
 
 DataDefinition_EDIT
- : 'CREATE' OptionalTemporary OptionalTransactional OptionalExternal 'CURSOR'
+ : 'CREATE' OptionalTemporary OptionalTransactional OptionalExternal OptionalRemote 'CURSOR'
    {
-     if ($4) {
+     if ($5) {
+       parser.suggestKeywords(['DATABASE']);
+     } else if ($4) {
        parser.suggestKeywords(['TABLE']);
      } else {
        if ($2 && !$3) {
          parser.suggestKeywords(['EXTERNAL TABLE', 'FUNCTION', 'MACRO', 'TABLE']);
        } else if (!$2 && !$3) {
-         parser.suggestKeywords(['DATABASE', 'EXTERNAL TABLE', 'FUNCTION', 'INDEX', 'MATERIALIZED VIEW', 'ROLE',
-           'SCHEDULED QUERY', 'SCHEMA', 'TABLE', 'TEMPORARY EXTERNAL TABLE', 'TEMPORARY FUNCTION', 'TEMPORARY MACRO',
-           'TEMPORARY TABLE', 'TRANSACTIONAL TABLE', 'VIEW']);
+         parser.suggestKeywords(['CONNECTOR', 'DATABASE', 'EXTERNAL TABLE', 'FUNCTION', 'INDEX', 'MATERIALIZED VIEW',
+           'REMOTE DATABASE', 'ROLE', 'SCHEDULED QUERY', 'SCHEMA', 'TABLE', 'TEMPORARY EXTERNAL TABLE',
+           'TEMPORARY FUNCTION', 'TEMPORARY MACRO', 'TEMPORARY TABLE', 'TRANSACTIONAL TABLE', 'VIEW']);
        } else if ($3) {
          parser.suggestKeywords(['TABLE']);
        }
@@ -38,6 +40,11 @@ OptionalComment
  | Comment
  ;
 
+OptionalRemote
+ :
+ | 'REMOTE'
+ ;
+
 Comment
  : 'COMMENT' QuotedValue
  ;
@@ -537,10 +544,10 @@ OptionalStoredAsOrBy
 
 StoredAsOrBy
  : StoredAs
- | 'STORED' 'BY' QuotedValue
-  {
-    $$ = { storedBy: true }
-  }
+ | StoredBy           -> { storedBy: true, suggestKeywords: ['STORED AS', 'WITH SERDEPROPERTIES'] }
+ | StoredBy WithSerdeproperties
+ | StoredBy WithSerdeproperties StoredAs
+ | StoredBy StoredAs
  ;
 
 StoredAsOrBy_EDIT
@@ -548,6 +555,15 @@ StoredAsOrBy_EDIT
    {
      parser.suggestKeywords(['AS', 'BY']);
    }
+ | StoredBy_EDIT
+ | StoredBy 'STORED' 'CURSOR'
+   {
+     parser.suggestKeywords(['AS']);
+   }
+ | StoredBy StoredAs_EDIT
+ | StoredBy WithSerdeproperties_EDIT
+ | StoredBy_EDIT StoredAs
+ | StoredBy WithSerdeproperties_EDIT StoredAs
  | StoredAs_EDIT
  ;
 
@@ -567,6 +583,24 @@ StoredAs_EDIT
    }
  ;
 
+StoredBy
+ : 'STORED' 'BY' QuotedValue
+   {
+     $$ = { storedBy: true }
+   }
+ | 'STORED' 'BY' 'ICEBERG'
+   {
+     $$ = { storedBy: true }
+   }
+ ;
+
+StoredBy_EDIT
+ : 'STORED' 'BY' 'CURSOR'
+   {
+     parser.suggestKeywords(['ICEBERG']);
+   }
+ ;
+
 FileFormat
  : 'AVRO'
  | 'INPUTFORMAT' QuotedValue 'OUTPUTFORMAT' QuotedValue

+ 81 - 0
desktop/core/src/desktop/js/parse/jison/sql/hive/create/create_connector.jison

@@ -0,0 +1,81 @@
+// 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
+ : CreateConnector
+ ;
+
+DataDefinition_EDIT
+ : CreateConnector_EDIT
+ ;
+
+CreateConnector
+ : 'CREATE' 'CONNECTOR' OptionalIfNotExists RegularIdentifier OptionalType OptionalUrl OptionalComment
+   OptionalWithDcproperties
+ ;
+
+CreateConnector_EDIT
+ : 'CREATE' 'CONNECTOR' OptionalIfNotExists 'CURSOR'
+   {
+     if (!$3) {
+       parser.suggestKeywords(['IF NOT EXISTS']);
+     }
+   }
+ | 'CREATE' 'CONNECTOR' OptionalIfNotExists_EDIT
+ | 'CREATE' 'CONNECTOR' OptionalIfNotExists 'CURSOR' RegularIdentifier
+   {
+     if (!$3) {
+       parser.suggestKeywords(['IF NOT EXISTS']);
+     }
+   }
+ | 'CREATE' 'CONNECTOR' OptionalIfNotExists_EDIT RegularIdentifier
+ | 'CREATE' 'CONNECTOR' OptionalIfNotExists RegularIdentifier OptionalType OptionalUrl OptionalComment WithDcproperties_EDIT
+ | 'CREATE' 'CONNECTOR' OptionalIfNotExists RegularIdentifier OptionalType OptionalUrl OptionalComment OptionalWithDcproperties 'CURSOR'
+   {
+     parser.suggestKeywordsForOptionalsLR([$8, $7, $6, $5], [
+       { value: 'WITH DCPROPERTIES', weight: 1 },
+       { value: 'COMMENT', weight: 2 },
+       { value: 'URL', weight: 3 },
+       { value: 'TYPE', weight: 4 }
+     ]);
+   }
+ ;
+
+OptionalType
+ :
+ | 'TYPE' QuotedValue
+ ;
+
+OptionalUrl
+ :
+ | 'URL' QuotedValue
+ ;
+
+OptionalWithDcproperties
+ :
+ | WithDcproperties
+ ;
+
+WithDcproperties
+ : 'WITH' 'DCPROPERTIES' ParenthesizedPropertyAssignmentList
+ ;
+
+WithDcproperties_EDIT
+ : 'WITH' 'CURSOR'
+   {
+     parser.suggestKeywords(['DCPROPERTIES']);
+   }
+ ;

+ 23 - 0
desktop/core/src/desktop/js/parse/jison/sql/hive/create/create_database.jison

@@ -27,6 +27,10 @@ CreateDatabase
    {
      parser.addNewDatabaseLocation(@4, [{ name: $4 }]);
    }
+ | 'CREATE_REMOTE' DatabaseOrSchema RegularIdentifier 'USING' RegularIdentifier OptionalDbProperties
+   {
+     parser.addNewDatabaseLocation(@3, [{ name: $3 }]);
+   }
  ;
 
 CreateDatabase_EDIT
@@ -48,10 +52,29 @@ CreateDatabase_EDIT
    {
      parser.addNewDatabaseLocation(@4, [{ name: $4 }]);
    }
+ | 'CREATE' DatabaseOrSchema OptionalIfNotExists RegularIdentifier DatabaseDefinitionOptionals_EDIT
  | 'CREATE' DatabaseOrSchema OptionalIfNotExists RegularIdentifier DatabaseDefinitionOptionals 'CURSOR'
    {
      parser.addNewDatabaseLocation(@4, [{ name: $4 }]);
    }
+ | 'CREATE_REMOTE' 'CURSOR'
+   {
+     parser.suggestKeywords(['DATABASE']);
+   }
+ | 'CREATE_REMOTE' DatabaseOrSchema RegularIdentifier 'CURSOR'
+   {
+     parser.addNewDatabaseLocation(@3, [{ name: $3 }]);
+     parser.suggestKeywords(['USING']);
+   }
+ | 'CREATE_REMOTE' DatabaseOrSchema RegularIdentifier 'USING' RegularIdentifier OptionalDbProperties 'CURSOR'
+   {
+     parser.addNewDatabaseLocation(@3, [{ name: $3 }]);
+     parser.suggestKeywords(['WITH DBPROPERTIES']);
+   }
+ | 'CREATE_REMOTE' DatabaseOrSchema RegularIdentifier 'USING' RegularIdentifier DbProperties_EDIT
+   {
+     parser.addNewDatabaseLocation(@3, [{ name: $3 }]);
+   }
  ;
 
 DatabaseDefinitionOptionals

+ 8 - 1
desktop/core/src/desktop/js/parse/jison/sql/hive/create/create_materialized_view.jison

@@ -45,7 +45,7 @@ CreateMaterializedView_EDIT
    OptionalPartitionedOn OptionalClusteredOrDistributedOn OptionalRowFormat OptionalStoredAsOrBy OptionalHdfsLocation
    OptionalTblproperties 'CURSOR'
    {
-     parser.suggestKeywordsForOptionalsLR([undefined, $12, $11, $10, $9, $8, $7, $6, $5], [
+     var keywords = parser.getKeywordsForOptionalsLR([undefined, $12, $11, $10, $9, $8, $7, $6, $5], [
        { value: 'AS SELECT', weight: 1 },
        { value: 'TBLPROPERTIES', weight: 2 },
        { value: 'LOCATION', weight: 3 },
@@ -55,6 +55,13 @@ CreateMaterializedView_EDIT
        { value: 'COMMENT', weight: 7 },
        { value: 'DISABLE REWRITE', weight: 8 }
      ]);
+
+     if (!$13 && !$12 && $11 && $11.suggestKeywords) {
+       keywords = keywords.concat(parser.createWeightedKeywords($11.suggestKeywords, 4));
+     }
+     if (keywords.length) {
+       parser.suggestKeywords(keywords);
+     }
    }
  | 'CREATE' 'MATERIALIZED' 'VIEW' OptionalIfNotExists SchemaQualifiedIdentifier DisableRewrite_EDIT OptionalComment
    OptionalPartitionedOn OptionalClusteredOrDistributedOn OptionalRowFormat OptionalStoredAsOrBy OptionalHdfsLocation

+ 66 - 26
desktop/core/src/desktop/js/parse/jison/sql/hive/create/create_table.jison

@@ -40,74 +40,71 @@ CreateTable_EDIT
 TableDefinitionRightPart
  : TableIdentifierAndOptionalColumnSpecification OptionalComment OptionalPartitionedBy
    OptionalClusteredBy OptionalSkewedBy OptionalRowFormat OptionalStoredAsOrBy
-   OptionalWithSerdeproperties OptionalHdfsLocation OptionalTblproperties OptionalAsSelectStatement
+   OptionalHdfsLocation OptionalTblproperties OptionalAsSelectStatement
  ;
 
 TableDefinitionRightPart_EDIT
  : TableIdentifierAndOptionalColumnSpecification_EDIT OptionalComment OptionalPartitionedBy
    OptionalClusteredBy OptionalSkewedBy OptionalRowFormat OptionalStoredAsOrBy
-   OptionalWithSerdeproperties OptionalHdfsLocation OptionalTblproperties OptionalAsSelectStatement
+   OptionalHdfsLocation OptionalTblproperties OptionalAsSelectStatement
  | TableIdentifierAndOptionalColumnSpecification OptionalComment PartitionedBy_EDIT
    OptionalClusteredBy OptionalSkewedBy OptionalRowFormat OptionalStoredAsOrBy
-   OptionalWithSerdeproperties OptionalHdfsLocation OptionalTblproperties OptionalAsSelectStatement
+   OptionalHdfsLocation OptionalTblproperties OptionalAsSelectStatement
  | TableIdentifierAndOptionalColumnSpecification OptionalComment OptionalPartitionedBy
    ClusteredBy_EDIT OptionalSkewedBy OptionalRowFormat OptionalStoredAsOrBy
-   OptionalWithSerdeproperties OptionalHdfsLocation OptionalTblproperties OptionalAsSelectStatement
+   OptionalHdfsLocation OptionalTblproperties OptionalAsSelectStatement
  | TableIdentifierAndOptionalColumnSpecification OptionalComment OptionalPartitionedBy
    OptionalClusteredBy SkewedBy_EDIT OptionalRowFormat OptionalStoredAsOrBy
-   OptionalWithSerdeproperties OptionalHdfsLocation OptionalTblproperties OptionalAsSelectStatement
+   OptionalHdfsLocation OptionalTblproperties OptionalAsSelectStatement
  | TableIdentifierAndOptionalColumnSpecification OptionalComment OptionalPartitionedBy
    OptionalClusteredBy OptionalSkewedBy RowFormat_EDIT OptionalStoredAsOrBy
-   OptionalWithSerdeproperties OptionalHdfsLocation OptionalTblproperties OptionalAsSelectStatement
+   OptionalHdfsLocation OptionalTblproperties OptionalAsSelectStatement
  | TableIdentifierAndOptionalColumnSpecification OptionalComment OptionalPartitionedBy
    OptionalClusteredBy OptionalSkewedBy OptionalRowFormat StoredAsOrBy_EDIT
-   OptionalWithSerdeproperties OptionalHdfsLocation OptionalTblproperties OptionalAsSelectStatement
+   OptionalHdfsLocation OptionalTblproperties OptionalAsSelectStatement
  | TableIdentifierAndOptionalColumnSpecification OptionalComment OptionalPartitionedBy
    OptionalClusteredBy OptionalSkewedBy OptionalRowFormat OptionalStoredAsOrBy
-   WithSerdeproperties_EDIT OptionalHdfsLocation OptionalTblproperties OptionalAsSelectStatement
+   HdfsLocation_EDIT OptionalTblproperties OptionalAsSelectStatement
  | TableIdentifierAndOptionalColumnSpecification OptionalComment OptionalPartitionedBy
    OptionalClusteredBy OptionalSkewedBy OptionalRowFormat OptionalStoredAsOrBy
-   OptionalWithSerdeproperties HdfsLocation_EDIT OptionalTblproperties OptionalAsSelectStatement
+   OptionalHdfsLocation OptionalTblproperties AsSelectStatement_EDIT
  | TableIdentifierAndOptionalColumnSpecification OptionalComment OptionalPartitionedBy
    OptionalClusteredBy OptionalSkewedBy OptionalRowFormat OptionalStoredAsOrBy
-   OptionalWithSerdeproperties OptionalHdfsLocation OptionalTblproperties AsSelectStatement_EDIT
- | TableIdentifierAndOptionalColumnSpecification OptionalComment OptionalPartitionedBy
-   OptionalClusteredBy OptionalSkewedBy OptionalRowFormat OptionalStoredAsOrBy
-   OptionalWithSerdeproperties OptionalHdfsLocation OptionalTblproperties 'CURSOR'
+   OptionalHdfsLocation OptionalTblproperties 'CURSOR'
    {
      var keywords = [];
-     if (!$1 && !$2 && !$3 && !$4 && !$5 && !$6 && !$7 && !$8 && !$9 && !$10) {
+     if (!$1 && !$2 && !$3 && !$4 && !$5 && !$6 && !$7 && !$8 && !$9) {
        keywords.push({ value: 'LIKE', weight: 1 });
      } else {
-       if (!$2 && !$3 && !$4 && !$5 && !$6 && !$7 && !$8 && !$9 && !$10) {
+       if (!$2 && !$3 && !$4 && !$5 && !$6 && !$7 && !$8 && !$9) {
          keywords.push({ value: 'COMMENT', weight: 10 });
        }
-       if (!$3 && !$4 && !$5 && !$6 && !$7 && !$8 && !$9 && !$10) {
+       if (!$3 && !$4 && !$5 && !$6 && !$7 && !$8 && !$9) {
          keywords.push({ value: 'PARTITIONED BY', weight: 9 });
        }
-       if (!$4 && !$5 && !$6 && !$7 && !$8 && !$9 && !$10) {
+       if (!$4 && !$5 && !$6 && !$7 && !$8 && !$9) {
          keywords.push({ value: 'CLUSTERED BY', weight: 8 });
        }
-       if (!$5 && !$6 && !$7 && !$8 && !$9 && !$10) {
+       if (!$5 && !$6 && !$7 && !$8 && !$9) {
          keywords.push({ value: 'SKEWED BY', weight: 7 });
-       } else if ($5 && $5.suggestKeywords && !$6 && !$7 && !$8 && !$9 && !$10) {
+       } else if ($5 && $5.suggestKeywords && !$6 && !$7 && !$8 && !$9) {
          keywords = keywords.concat(parser.createWeightedKeywords($5.suggestKeywords, 7)); // Get the last optional from SKEWED BY
        }
-       if (!$6 && !$7 && !$8 && !$9 && !$10) {
+       if (!$6 && !$7 && !$8 && !$9) {
          keywords.push({ value: 'ROW FORMAT', weight: 6 });
-       } else if ($6 && $6.suggestKeywords && !$7 && !$8 && !$9 && !$10) {
+       } else if ($6 && $6.suggestKeywords && !$7 && !$8 && !$9) {
          keywords = keywords.concat(parser.createWeightedKeywords($6.suggestKeywords, 6));
        }
-       if (!$7 && !$8 && !$9 && !$10) {
+       if (!$7 && !$8 && !$9) {
          keywords.push({ value: 'STORED AS', weight: 5 });
          keywords.push({ value: 'STORED BY', weight: 5 });
-       } else if ($7 && $7.storedBy && !$8 && !$9 && !$10) {
-         keywords.push({ value: 'WITH SERDEPROPERTIES', weight: 4 });
+       } else if ($7 && $7.suggestKeywords && !$8 && !$9) {
+         keywords = keywords.concat(parser.createWeightedKeywords($7.suggestKeywords, 5));
        }
-       if (!$9 && !$10) {
+       if (!$8 && !$9) {
          keywords.push({ value: 'LOCATION', weight: 3 });
        }
-       if (!$10) {
+       if (!$9) {
          keywords.push({ value: 'TBLPROPERTIES', weight: 2 });
        }
        keywords.push({ value: 'AS', weight: 1 });
@@ -153,6 +150,7 @@ OptionalPartitionedBy
 
 PartitionedBy
  : 'PARTITIONED' 'BY' ParenthesizedColumnSpecificationList
+ | 'PARTITIONED' 'BY' SpecClause
  ;
 
 PartitionedBy_EDIT
@@ -176,6 +174,48 @@ PartitionedBy_EDIT
    }
  ;
 
+SpecClause
+ : 'SPEC' ParenthesizedSpecList
+ ;
+
+SpecClause_EDIT
+ : 'SPEC' 'CURSOR'
+ | 'SPEC' ParenthesizedSpecList_EDIT
+ ;
+
+ParenthesizedSpecList
+ : '(' SpecList ')'
+ ;
+
+ParenthesizedSpecList_EDIT
+ : '(' 'CURSOR' RightParenthesisOrError
+   {
+     parser.suggestKeywords(['BUCKET', 'DAY', 'HOUR', 'MONTH', 'TRUNCATE', 'YEAR' ]);
+   }
+ | '(' SpecList_EDIT RightParenthesisOrError
+ ;
+
+Spec
+ : ArbitraryFunction
+ | RegularIdentifier
+ ;
+
+SpecList
+ : Spec
+ | SpecList ',' Spec
+ ;
+
+SpecList_EDIT
+ : SpecList ',' 'CURSOR'
+   {
+     parser.suggestKeywords(['BUCKET', 'DAY', 'HOUR', 'IDENTITY', 'MONTH', 'TRUNCATE', 'YEAR', 'VOID' ]);
+   }
+ | SpecList ',' 'CURSOR' ',' SpecList
+   {
+     parser.suggestKeywords(['BUCKET', 'DAY', 'HOUR', 'IDENTITY', 'MONTH', 'TRUNCATE', 'YEAR', 'VOID' ]);
+   }
+ ;
+
 OptionalClusteredBy
  :
  | ClusteredBy

+ 1 - 1
desktop/core/src/desktop/js/parse/jison/sql/hive/describe/describe.jison

@@ -72,7 +72,7 @@ DescribeStatement_EDIT
  | 'DESCRIBE' OptionalExtendedOrFormatted 'CURSOR'
    {
      if (!$2) {
-       parser.suggestKeywords(['DATABASE', 'EXTENDED', 'FORMATTED', 'FUNCTION', 'SCHEMA']);
+       parser.suggestKeywords(['CONNECTOR', 'DATABASE', 'EXTENDED', 'FORMATTED', 'FUNCTION', 'SCHEMA']);
      }
      parser.suggestTables();
      parser.suggestDatabases({ appendDot: true });

+ 42 - 0
desktop/core/src/desktop/js/parse/jison/sql/hive/describe/describe_connector.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
+ : DescribeConnectorStatement
+ ;
+
+DataDefinition_EDIT
+ : DescribeConnectorStatement_EDIT
+ ;
+
+DescribeConnectorStatement
+ : 'DESCRIBE' 'CONNECTOR' OptionalExtended RegularOrBacktickedIdentifier
+ ;
+
+DescribeConnectorStatement_EDIT
+ : 'DESCRIBE' 'CONNECTOR' OptionalExtended 'CURSOR'
+   {
+     if (!$3) {
+       parser.suggestKeywords(['EXTENDED']);
+     }
+   }
+ | 'DESCRIBE' 'CONNECTOR' OptionalExtended 'CURSOR' RegularOrBacktickedIdentifier
+   {
+     if (!$3) {
+       parser.suggestKeywords(['EXTENDED']);
+     }
+   }
+ ;

+ 45 - 0
desktop/core/src/desktop/js/parse/jison/sql/hive/drop/drop_connector.jison

@@ -0,0 +1,45 @@
+// 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
+ : DropConnectorStatement
+ ;
+
+DataDefinition_EDIT
+ : DropConnectorStatement_EDIT
+ ;
+
+DropConnectorStatement
+ : 'DROP' 'CONNECTOR' OptionalIfExists RegularOrBacktickedIdentifier
+ ;
+
+DropConnectorStatement_EDIT
+ : 'DROP' 'CONNECTOR' OptionalIfExists
+ | 'DROP' 'CONNECTOR' OptionalIfExists_EDIT
+ | 'DROP' 'CONNECTOR' OptionalIfExists 'CURSOR'
+   {
+     if (!$3) {
+       parser.suggestKeywords(['IF EXISTS']);
+     }
+   }
+ | 'DROP' 'CONNECTOR' OptionalIfExists_EDIT RegularOrBacktickedIdentifier
+ | 'DROP' 'CONNECTOR' OptionalIfExists 'CURSOR' RegularOrBacktickedIdentifier
+   {
+     if (!$3) {
+       parser.suggestKeywords(['IF EXISTS']);
+     }
+   }
+ ;

+ 1 - 1
desktop/core/src/desktop/js/parse/jison/sql/hive/insert/insert.jison

@@ -86,7 +86,7 @@ InsertStatement_EDIT
  ;
 
 InsertWithoutQuery
- : 'INSERT' 'INTO' OptionalTable SchemaQualifiedTableIdentifier OptionalPartitionSpec 'VALUES' InsertValuesList
+ : 'INSERT' 'INTO' OptionalTable SchemaQualifiedTableIdentifier OptionalPartitionSpec ValuesClause
    {
      $4.owner = 'insert';
      parser.addTablePrimary($4);

+ 1 - 1
desktop/core/src/desktop/js/parse/jison/sql/hive/merge/merge.jison

@@ -227,7 +227,7 @@ MatchCondition_EDIT
 UpdateDeleteOrInsert
  : 'UPDATE' 'SET' SetClauseList        -> { isUpdate: true }
  | 'DELETE'                            -> { isDelete: true }
- | 'INSERT' 'VALUES' InsertValuesList  -> { isInsert: true }
+ | 'INSERT' ValuesClause  -> { isInsert: true }
  ;
 
 UpdateDeleteOrInsert_EDIT

+ 4 - 5
desktop/core/src/desktop/js/parse/jison/sql/hive/insert/insert_common.jison → desktop/core/src/desktop/js/parse/jison/sql/hive/show/show_connectors.jison

@@ -14,11 +14,10 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-InsertValuesList
- : ParenthesizedRowValuesList
- | InsertValuesList ',' ParenthesizedRowValuesList
+DataDefinition
+ : ShowConnectorsStatement
  ;
 
-ParenthesizedRowValuesList
- : '(' InValueList ')'
+ShowConnectorsStatement
+ : 'SHOW' 'CONNECTORS'
  ;

+ 9 - 0
desktop/core/src/desktop/js/parse/jison/sql/hive/sql.jisonlex

@@ -160,11 +160,14 @@
 'COLLECTION'                         { return 'COLLECTION'; }
 'COLUMNS'                            { return 'COLUMNS'; }
 'COMMENT'                            { return 'COMMENT'; }
+'CONNECTOR'                          { return 'CONNECTOR'; }
+'CONNECTORS'                         { return 'CONNECTORS'; }
 'COMPACT'                            { return 'COMPACT'; }
 'COMPACTIONS'                        { return 'COMPACTIONS'; }
 'COMPUTE'                            { return 'COMPUTE'; }
 'CONCATENATE'                        { return 'CONCATENATE'; }
 'COST'                               { return 'COST'; }
+CREATE\s+REMOTE                      { parser.determineCase(yytext); return 'CREATE_REMOTE'; }
 'CRON'                               { return 'CRON'; }
 'CURRENT_DATE'                       { return 'CURRENT_DATE'; }
 'CURRENT_TIMESTAMP'                  { return 'CURRENT_TIMESTAMP'; }
@@ -173,6 +176,7 @@
 'DATABASES'                          { return 'DATABASES'; }
 'DAY'                                { return 'DAY'; }
 'DAYOFWEEK'                          { return 'DAYOFWEEK'; }
+'DCPROPERTIES'                       { return 'DCPROPERTIES'; }
 'DBPROPERTIES'                       { return 'DBPROPERTIES'; }
 'DEFAULT'                            { return 'DEFAULT'; }
 'DEFERRED'                           { return 'DEFERRED'; }
@@ -205,6 +209,7 @@ DOUBLE\s+PRECISION                   { return 'DOUBLE_PRECISION'; }
 'FORMATTED'                          { return 'FORMATTED'; }
 'FUNCTIONS'                          { return 'FUNCTIONS'; }
 'HOUR'                               { return 'HOUR'; }
+'ICEBERG'                            { return 'ICEBERG'; }
 'IDXPROPERTIES'                      { return 'IDXPROPERTIES'; }
 'INDEX'                              { return 'INDEX'; }
 'INDEXES'                            { return 'INDEXES'; }
@@ -259,6 +264,7 @@ OVERWRITE\s+DIRECTORY                { this.begin('hdfs'); return 'OVERWRITE_DIR
 'RECOVER'                            { return 'RECOVER'; }
 'RELOAD'                             { parser.determineCase(yytext); return 'RELOAD'; }
 'RELY'                               { return 'RELY'; }
+'REMOTE'                             { return 'REMOTE'; }
 'RENAME'                             { return 'RENAME'; }
 'REPAIR'                             { return 'REPAIR'; }
 'REPLACE'                            { return 'REPLACE'; }
@@ -281,6 +287,7 @@ OVERWRITE\s+DIRECTORY                { this.begin('hdfs'); return 'OVERWRITE_DIR
 'SKEWED'                             { return 'SKEWED'; }
 'SORT'                               { return 'SORT'; }
 'SORTED'                             { return 'SORTED'; }
+'SPEC'                               { return 'SPEC'; }
 'STATISTICS'                         { return 'STATISTICS'; }
 'STORED'                             { return 'STORED'; }
 STORED\s+AS\s+DIRECTORIES            { return 'STORED_AS_DIRECTORIES'; }
@@ -297,10 +304,12 @@ STORED\s+AS\s+DIRECTORIES            { return 'STORED_AS_DIRECTORIES'; }
 'TOUCH'                              { return 'TOUCH'; }
 'TRANSACTIONAL'                      { return 'TRANSACTIONAL'; }
 'TRANSACTIONS'                       { return 'TRANSACTIONS'; }
+'TYPE'                               { return 'TYPE'; }
 'UNARCHIVE'                          { return 'UNARCHIVE'; }
 'UNIONTYPE'                          { return 'UNIONTYPE'; }
 'UNIQUE'                             { return 'UNIQUE'; }
 'UNSET'                              { return 'UNSET'; }
+'URL'                                { return 'URL'; }
 'USE'                                { parser.determineCase(yytext); parser.addStatementTypeLocation('USE', yylloc); return 'USE'; }
 'VECTORIZATION'                      { return 'VECTORIZATION'; }
 'VIEW'                               { return 'VIEW'; }

+ 30 - 0
desktop/core/src/desktop/js/parse/jison/sql/hive/sql_main.jison

@@ -109,6 +109,7 @@ NonReservedKeyword
  | 'COMPACTIONS'
  | 'COMPUTE'
  | 'CONCATENATE'
+ | 'CONNECTORS'
  | 'COST'
  | 'CRON'
  | 'CURRENT_DATE'
@@ -118,6 +119,7 @@ NonReservedKeyword
  | 'DATABASES'
  | 'DAY'
  | 'DAYOFWEEK'
+ | 'DCPROPERTIES'
  | 'DBPROPERTIES'
  | 'DEFAULT'
  | 'DEFERRED'
@@ -147,6 +149,7 @@ NonReservedKeyword
  | 'FORMAT'
  | 'FUNCTIONS'
  | 'HOUR'
+ | 'ICEBERG'
  | 'IDXPROPERTIES'
  | 'INPATH'
  | 'INPUTFORMAT'
@@ -197,6 +200,7 @@ NonReservedKeyword
  | 'RECOVER'
  | 'RELOAD'
  | 'RELY'
+ | 'REMOTE'
  | 'RENAME'
  | 'REPAIR'
  | 'REPLACE'
@@ -216,6 +220,7 @@ NonReservedKeyword
  | 'SKEWED_LOCATION'
  | 'SKEWED'
  | 'SORTED'
+ | 'SPEC'
  | 'STATISTICS'
  | 'STORED'
  | 'STORED_AS_DIRECTORIES'
@@ -231,9 +236,11 @@ NonReservedKeyword
  | 'TOUCH'
  | 'TRANSACTIONAL'
  | 'TRANSACTIONS'
+ | 'TYPE'
  | 'UNARCHIVE'
  | 'UNIONTYPE'
  | 'UNIQUE'
+ | 'URL'
  | 'USE'
  | 'VECTORIZATION'
  | 'VIEW'
@@ -1360,6 +1367,11 @@ WithQuery
      $4.alias = $1;
      $$ = $4;
    }
+ | RegularOrBacktickedIdentifier 'AS' '(' ValuesClause ')'
+   {
+     parser.addCteAliasLocation(@1, $1);
+     $$ = { alias: $1 };
+   }
  ;
 
 WithQuery_EDIT
@@ -2660,6 +2672,7 @@ TableOrQueryName_EDIT
 
 DerivedTable
  : TableSubQuery
+ | '(' ValuesClause ')' -> {}
  ;
 
 DerivedTable_EDIT
@@ -3155,3 +3168,20 @@ LateralViewColumnAliases_EDIT
  : 'AS' PartialBacktickedOrCursor
  | 'AS' RegularOrBacktickedIdentifier ',' PartialBacktickedOrAnyCursor
  ;
+
+ValueExpression
+ : '(' ValuesClause ')'
+ ;
+
+ValuesClause
+ : 'VALUES' ValuesList
+ ;
+
+ValuesList
+ : ParenthesizedRowValuesList
+ | ValuesList ',' ParenthesizedRowValuesList
+ ;
+
+ParenthesizedRowValuesList
+ : '(' InValueList ')'
+ ;

+ 10 - 2
desktop/core/src/desktop/js/parse/jison/sql/hive/structure.json

@@ -5,6 +5,7 @@
     "abort/abort_transactions.jison",
     "common/table_constraint.jison",
     "alter/alter_common.jison",
+    "alter/alter_connector.jison",
     "alter/alter_database.jison",
     "alter/alter_index.jison",
     "alter/alter_materialized_view.jison",
@@ -13,6 +14,7 @@
     "alter/alter_view.jison",
     "analyze/analyze_table.jison",
     "create/create_common.jison",
+    "create/create_connector.jison",
     "create/create_database.jison",
     "create/create_function.jison",
     "create/create_index.jison",
@@ -25,9 +27,11 @@
     "create/create_view.jison",
     "delete/delete.jison",
     "describe/describe.jison",
+    "describe/describe_connector.jison",
     "describe/describe_database.jison",
     "describe/describe_function.jison",
     "drop/drop_common.jison",
+    "drop/drop_connector.jison",
     "drop/drop_database.jison",
     "drop/drop_function.jison",
     "drop/drop_index.jison",
@@ -48,7 +52,6 @@
     "import/import.jison",
     "../impala/insert/cte_insert.jison",
     "insert/insert.jison",
-    "insert/insert_common.jison",
     "load/load_data.jison",
     "merge/merge.jison",
     "msck/msck.jison",
@@ -68,6 +71,7 @@
     "show/show_common.jison",
     "show/show_compactions.jison",
     "show/show_conf.jison",
+    "show/show_connectors.jison",
     "show/show_create_table.jison",
     "show/show_current_roles.jison",
     "show/show_databases.jison",
@@ -118,6 +122,7 @@
     "abort/abort_transactions.jison",
     "common/table_constraint.jison",
     "alter/alter_common.jison",
+    "alter/alter_connector.jison",
     "alter/alter_database.jison",
     "alter/alter_index.jison",
     "alter/alter_materialized_view.jison",
@@ -126,6 +131,7 @@
     "alter/alter_view.jison",
     "analyze/analyze_table.jison",
     "create/create_common.jison",
+    "create/create_connector.jison",
     "create/create_database.jison",
     "create/create_function.jison",
     "create/create_index.jison",
@@ -138,9 +144,11 @@
     "create/create_view.jison",
     "delete/delete.jison",
     "describe/describe.jison",
+    "describe/describe_connector.jison",
     "describe/describe_database.jison",
     "describe/describe_function.jison",
     "drop/drop_common.jison",
+    "drop/drop_connector.jison",
     "drop/drop_database.jison",
     "drop/drop_function.jison",
     "drop/drop_index.jison",
@@ -161,7 +169,6 @@
     "import/import.jison",
     "../impala/insert/cte_insert.jison",
     "insert/insert.jison",
-    "insert/insert_common.jison",
     "load/load_data.jison",
     "merge/merge.jison",
     "msck/msck.jison",
@@ -181,6 +188,7 @@
     "show/show_common.jison",
     "show/show_compactions.jison",
     "show/show_conf.jison",
+    "show/show_connectors.jison",
     "show/show_create_table.jison",
     "show/show_current_roles.jison",
     "show/show_databases.jison",

+ 1 - 0
desktop/core/src/desktop/js/parse/jison/sql/impala/structure.json

@@ -122,6 +122,7 @@
     "delete/delete.jison",
     "describe/describe.jison",
     "describe/describe_database.jison",
+    "describe/describe_history.jison",
     "drop/drop_aggregate_function.jison",
     "drop/drop_common.jison",
     "drop/drop_database.jison",

+ 0 - 2
desktop/core/src/desktop/js/parse/jison/sql/presto/structure.json

@@ -44,7 +44,6 @@
     "../hive/import/import.jison",
     "../impala/insert/cte_insert.jison",
     "../hive/insert/insert.jison",
-    "../hive/insert/insert_common.jison",
     "load/load_data.jison",
     "../hive/merge/merge.jison",
     "msck/msck.jison",
@@ -153,7 +152,6 @@
     "../hive/import/import.jison",
     "../impala/insert/cte_insert.jison",
     "../hive/insert/insert.jison",
-    "../hive/insert/insert_common.jison",
     "load/load_data.jison",
     "../hive/merge/merge.jison",
     "msck/msck.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


+ 3 - 3
desktop/core/src/desktop/js/parse/sql/hive/keywords.json

@@ -1,7 +1,7 @@
 {
-  "ALTER": ["DATABASE", "INDEX", "MATERIALIZED VIEW", "SCHEDULED QUERY", "SCHEMA", "TABLE", "VIEW"],
+  "ALTER": ["CONNECTOR", "DATABASE", "INDEX", "MATERIALIZED VIEW", "SCHEDULED QUERY", "SCHEMA", "TABLE", "VIEW"],
   "ALTER TABLE ADD CONSTRAINT identifier": ["CHECK", "FOREIGN KEY", "PRIMARY KEY", "UNIQUE"],
-  "DROP": ["DATABASE", "FUNCTION", "INDEX", "MATERIALIZED VIEW", "ROLE", "SCHEDULED QUERY", "SCHEMA", "TABLE", "TEMPORARY FUNCTION", "TEMPORARY MACRO", "VIEW"],
+  "DROP": ["CONNECTOR", "DATABASE", "FUNCTION", "INDEX", "MATERIALIZED VIEW", "ROLE", "SCHEDULED QUERY", "SCHEMA", "TABLE", "TEMPORARY FUNCTION", "TEMPORARY MACRO", "VIEW"],
   "SHOW": [
-    "COLUMNS", "COMPACTIONS", "CONF", "CREATE TABLE", "CURRENT ROLES", "DATABASES", "FORMATTED", "FUNCTIONS", "GRANT", "INDEX", "INDEXES", "LOCKS", "MATERIALIZED VIEWS", "PARTITIONS", "PRINCIPALS", "ROLE GRANT", "ROLES", "SCHEMAS", "TABLE EXTENDED", "TABLES", "TBLPROPERTIES", "TRANSACTIONS", "VIEWS"]
+    "COLUMNS", "CONNECTORS",  "COMPACTIONS", "CONF", "CREATE TABLE", "CURRENT ROLES", "DATABASES", "FORMATTED", "FUNCTIONS", "GRANT", "INDEX", "INDEXES", "LOCKS", "MATERIALIZED VIEWS", "PARTITIONS", "PRINCIPALS", "ROLE GRANT", "ROLES", "SCHEMAS", "TABLE EXTENDED", "TABLES", "TBLPROPERTIES", "TRANSACTIONS", "VIEWS"]
 }

+ 227 - 74
desktop/core/src/desktop/js/parse/sql/hive/test/hiveAutocompleteParser.Alter.test.js

@@ -35,10 +35,92 @@ describe('hiveAutocompleteParser.js ALTER statements', () => {
     ).toEqualDefinition(testDefinition);
   };
 
+  describe('ALTER CONNECTOR', () => {
+    it('should handle "ALTER CONNECTOR foo SET URL \'banana\'; |"', () => {
+      assertAutoComplete({
+        beforeCursor: "ALTER CONNECTOR foo SET URL 'banana'; ",
+        afterCursor: '',
+        noErrors: true,
+        containsKeywords: ['SELECT'],
+        expectedResult: {
+          lowerCase: false
+        }
+      });
+    });
+
+    it('should handle "ALTER CONNECTOR foo SET OWNER banana; |"', () => {
+      assertAutoComplete({
+        beforeCursor: 'ALTER CONNECTOR foo SET OWNER banana; ',
+        afterCursor: '',
+        noErrors: true,
+        containsKeywords: ['SELECT'],
+        expectedResult: {
+          lowerCase: false
+        }
+      });
+    });
+
+    it("should handle \"ALTER CONNECTOR foo SET DCPROPERTIES ('foo'='bar'); |\"", () => {
+      assertAutoComplete({
+        beforeCursor: "ALTER CONNECTOR foo SET  DCPROPERTIES ('foo'='bar'); ",
+        afterCursor: '',
+        noErrors: true,
+        containsKeywords: ['SELECT'],
+        expectedResult: {
+          lowerCase: false
+        }
+      });
+    });
+
+    it('should suggest keywords for "ALTER |"', () => {
+      assertAutoComplete({
+        beforeCursor: 'ALTER ',
+        afterCursor: '',
+        containsKeywords: ['CONNECTOR'],
+        expectedResult: {
+          lowerCase: false
+        }
+      });
+    });
+
+    it('should suggest keywords for "ALTER CONNECTOR foo |"', () => {
+      assertAutoComplete({
+        beforeCursor: 'ALTER CONNECTOR foo ',
+        afterCursor: '',
+        expectedResult: {
+          lowerCase: false,
+          suggestKeywords: ['SET DCPROPERTIES', 'SET OWNER', 'SET URL']
+        }
+      });
+    });
+
+    it('should suggest keywords for "ALTER CONNECTOR foo SET |"', () => {
+      assertAutoComplete({
+        beforeCursor: 'ALTER CONNECTOR foo SET ',
+        afterCursor: '',
+        expectedResult: {
+          lowerCase: false,
+          suggestKeywords: ['DCPROPERTIES', 'OWNER', 'URL']
+        }
+      });
+    });
+
+    it('should suggest keywords for "ALTER CONNECTOR foo SET OWNER |"', () => {
+      assertAutoComplete({
+        beforeCursor: 'ALTER CONNECTOR foo SET OWNER ',
+        afterCursor: '',
+        expectedResult: {
+          lowerCase: false,
+          suggestKeywords: ['ROLE', 'USER']
+        }
+      });
+    });
+  });
+
   describe('ALTER DATABASE', () => {
-    it("should handle \"ALTER DATABASE baa SET DBPROPERTIES ('boo'=1, 'baa'=2);|\"", () => {
+    it("should handle \"ALTER DATABASE baa SET DBPROPERTIES ('boo'=1, 'baa'=2); |\"", () => {
       assertAutoComplete({
-        beforeCursor: "ALTER DATABASE baa SET DBPROPERTIES ('boo'=1, 'baa'=2);",
+        beforeCursor: "ALTER DATABASE baa SET DBPROPERTIES ('boo'=1, 'baa'=2); ",
         afterCursor: '',
         noErrors: true,
         containsKeywords: ['SELECT'],
@@ -48,9 +130,9 @@ describe('hiveAutocompleteParser.js ALTER statements', () => {
       });
     });
 
-    it('should handle "ALTER SCHEMA baa SET OWNER ROLE boo;|"', () => {
+    it('should handle "ALTER SCHEMA baa SET OWNER ROLE boo; |"', () => {
       assertAutoComplete({
-        beforeCursor: 'ALTER SCHEMA baa SET OWNER ROLE boo;',
+        beforeCursor: 'ALTER SCHEMA baa SET OWNER ROLE boo; ',
         afterCursor: '',
         noErrors: true,
         containsKeywords: ['SELECT'],
@@ -60,9 +142,9 @@ describe('hiveAutocompleteParser.js ALTER statements', () => {
       });
     });
 
-    it('should handle "ALTER DATABASE baa SET LOCATION \'/baa/boo\';|"', () => {
+    it('should handle "ALTER DATABASE baa SET LOCATION \'/baa/boo\'; |"', () => {
       assertAutoComplete({
-        beforeCursor: "ALTER DATABASE baa SET LOCATION '/baa/boo';",
+        beforeCursor: "ALTER DATABASE baa SET LOCATION '/baa/boo'; ",
         afterCursor: '',
         noErrors: true,
         containsKeywords: ['SELECT'],
@@ -72,9 +154,9 @@ describe('hiveAutocompleteParser.js ALTER statements', () => {
       });
     });
 
-    it('should handle "ALTER DATABASE baa SET MANAGEDLOCATION \'/baa/boo\';|"', () => {
+    it('should handle "ALTER DATABASE baa SET MANAGEDLOCATION \'/baa/boo\'; |"', () => {
       assertAutoComplete({
-        beforeCursor: "ALTER DATABASE baa SET MANAGEDLOCATION '/baa/boo';",
+        beforeCursor: "ALTER DATABASE baa SET MANAGEDLOCATION '/baa/boo'; ",
         afterCursor: '',
         noErrors: true,
         containsKeywords: ['SELECT'],
@@ -174,9 +256,9 @@ describe('hiveAutocompleteParser.js ALTER statements', () => {
   });
 
   describe('ALTER INDEX', () => {
-    it('should handle "ALTER INDEX baa ON boo.ba PARTITION (bla=1) REBUILD;|"', () => {
+    it('should handle "ALTER INDEX baa ON boo.ba PARTITION (bla=1) REBUILD; |"', () => {
       assertAutoComplete({
-        beforeCursor: 'ALTER INDEX baa ON boo.ba PARTITION (bla=1) REBUILD;',
+        beforeCursor: 'ALTER INDEX baa ON boo.ba PARTITION (bla=1) REBUILD; ',
         afterCursor: '',
         noErrors: true,
         containsKeywords: ['SELECT'],
@@ -325,6 +407,106 @@ describe('hiveAutocompleteParser.js ALTER statements', () => {
   });
 
   describe('ALTER TABLE', () => {
+    it('should handle "ALTER TABLE foo SET PARTITION SPEC (month(ts)); |"', () => {
+      assertAutoComplete({
+        beforeCursor: 'ALTER TABLE foo SET PARTITION SPEC (month(ts)); ',
+        afterCursor: '',
+        noErrors: true,
+        containsKeywords: ['SELECT'],
+        expectedResult: {
+          lowerCase: false
+        }
+      });
+    });
+
+    it('should handle "ALTER TABLE default.part_test SET PARTITION SPEC(year(year_field), month(month_field), day(day_field)); |"', () => {
+      assertAutoComplete({
+        beforeCursor:
+          'ALTER TABLE default.part_test SET PARTITION SPEC(year(year_field), month(month_field), day(day_field)); ',
+        afterCursor: '',
+        noErrors: true,
+        containsKeywords: ['SELECT'],
+        expectedResult: {
+          lowerCase: false
+        }
+      });
+    });
+
+    it('should handle "ALTER TABLE default.customers ADD COLUMNS (newintcol int, newstringcol string COMMENT \'Column with description\'); |"', () => {
+      assertAutoComplete({
+        beforeCursor:
+          "ALTER TABLE default.customers ADD COLUMNS (newintcol int, newstringcol string COMMENT 'Column with description'); ",
+        afterCursor: '',
+        noErrors: true,
+        containsKeywords: ['SELECT'],
+        expectedResult: {
+          lowerCase: false
+        }
+      });
+    });
+
+    it('should handle "ALTER TABLE default.customers CHANGE COLUMN last_name family_name string COMMENT \'This is family name\'; |"', () => {
+      assertAutoComplete({
+        beforeCursor:
+          "ALTER TABLE default.customers CHANGE COLUMN last_name family_name string COMMENT 'This is family name'; ",
+        afterCursor: '',
+        noErrors: true,
+        containsKeywords: ['SELECT'],
+        expectedResult: {
+          lowerCase: false
+        }
+      });
+    });
+
+    it('should handle "ALTER TABLE customers CHANGE COLUMN last_name family_name string AFTER customer_id; |"', () => {
+      assertAutoComplete({
+        beforeCursor:
+          'ALTER TABLE customers CHANGE COLUMN last_name family_name string AFTER customer_id; ',
+        afterCursor: '',
+        noErrors: true,
+        containsKeywords: ['SELECT'],
+        expectedResult: {
+          lowerCase: false
+        }
+      });
+    });
+
+    it('should handle "ALTER TABLE customers CHANGE COLUMN family_name family_name string FIRST; |"', () => {
+      assertAutoComplete({
+        beforeCursor: 'ALTER TABLE customers CHANGE COLUMN family_name family_name string FIRST; ',
+        afterCursor: '',
+        noErrors: true,
+        containsKeywords: ['SELECT'],
+        expectedResult: {
+          lowerCase: false
+        }
+      });
+    });
+
+    it('should handle "ALTER TABLE customers UPDATE COLUMNS; |"', () => {
+      assertAutoComplete({
+        beforeCursor: 'ALTER TABLE customers UPDATE COLUMNS; ',
+        afterCursor: '',
+        noErrors: true,
+        containsKeywords: ['SELECT'],
+        expectedResult: {
+          lowerCase: false
+        }
+      });
+    });
+
+    it("should handle \"ALTER TABLE customers UNSET TBLPROPERTIES('dummy'='dummy'); |\"", () => {
+      assertAutoComplete({
+        beforeCursor: "ALTER TABLE customers UNSET TBLPROPERTIES('dummy'='dummy'); ",
+        afterCursor: '',
+        noErrors: true,
+        containsKeywords: ['SELECT'],
+        expectedResult: {
+          lowerCase: false
+        }
+      });
+    });
+
     it('should suggest keywords for "ALTER |"', () => {
       assertAutoComplete({
         beforeCursor: 'ALTER ',
@@ -359,10 +541,10 @@ describe('hiveAutocompleteParser.js ALTER statements', () => {
       });
     });
 
-    it('should handle "ALTER TABLE foo PARTITION (ds=\'2008-04-08\', hr) CHANGE COLUMN dec_column_name dec_column_name DECIMAL;|"', () => {
+    it('should handle "ALTER TABLE foo PARTITION (ds=\'2008-04-08\', hr) CHANGE COLUMN dec_column_name dec_column_name DECIMAL; |"', () => {
       assertAutoComplete({
         beforeCursor:
-          "ALTER TABLE foo PARTITION (ds='2008-04-08', hr) CHANGE COLUMN dec_column_name dec_column_name DECIMAL;",
+          "ALTER TABLE foo PARTITION (ds='2008-04-08', hr) CHANGE COLUMN dec_column_name dec_column_name DECIMAL; ",
         afterCursor: '',
         containsKeywords: ['SELECT'],
         expectedResult: {
@@ -371,9 +553,9 @@ describe('hiveAutocompleteParser.js ALTER statements', () => {
       });
     });
 
-    it("should handle \"ALTER TABLE page_view DROP PARTITION (dt='2008-08-08', country='us');|\"", () => {
+    it("should handle \"ALTER TABLE page_view DROP PARTITION (dt='2008-08-08', country='us'); |\"", () => {
       assertAutoComplete({
-        beforeCursor: "ALTER TABLE page_view DROP PARTITION (dt='2008-08-08', country='us');",
+        beforeCursor: "ALTER TABLE page_view DROP PARTITION (dt='2008-08-08', country='us'); ",
         afterCursor: '',
         containsKeywords: ['SELECT'],
         expectedResult: {
@@ -382,10 +564,10 @@ describe('hiveAutocompleteParser.js ALTER statements', () => {
       });
     });
 
-    it("should handle \"ALTER TABLE page_view ADD PARTITION (dt='2008-08-08', country='us') location '/path/to/us/part080808'\nPARTITION (dt='2008-08-09', country='us') location '/path/to/us/part080809';|\"", () => {
+    it("should handle \"ALTER TABLE page_view ADD PARTITION (dt='2008-08-08', country='us') location '/path/to/us/part080808'\nPARTITION (dt='2008-08-09', country='us') location '/path/to/us/part080809'; |\"", () => {
       assertAutoComplete({
         beforeCursor:
-          "ALTER TABLE page_view ADD PARTITION (dt='2008-08-08', country='us') location '/path/to/us/part080808'\nPARTITION (dt='2008-08-09', country='us') location '/path/to/us/part080809';",
+          "ALTER TABLE page_view ADD PARTITION (dt='2008-08-08', country='us') location '/path/to/us/part080808'\nPARTITION (dt='2008-08-09', country='us') location '/path/to/us/part080809'; ",
         afterCursor: '',
         containsKeywords: ['SELECT'],
         expectedResult: {
@@ -394,9 +576,9 @@ describe('hiveAutocompleteParser.js ALTER statements', () => {
       });
     });
 
-    it('should handle "ALTER TABLE bar SET OWNER ROLE boo;|"', () => {
+    it('should handle "ALTER TABLE bar SET OWNER ROLE boo; |"', () => {
       assertAutoComplete({
-        beforeCursor: 'ALTER TABLE bar SET OWNER ROLE boo;',
+        beforeCursor: 'ALTER TABLE bar SET OWNER ROLE boo; ',
         afterCursor: '',
         noErrors: true,
         containsKeywords: ['SELECT'],
@@ -436,6 +618,7 @@ describe('hiveAutocompleteParser.js ALTER statements', () => {
             'SET FILEFORMAT',
             'SET LOCATION',
             'SET OWNER',
+            'SET PARTITION SPEC',
             'SET SERDE',
             'SET SERDEPROPERTIES',
             'SET SKEWED LOCATION',
@@ -443,7 +626,9 @@ describe('hiveAutocompleteParser.js ALTER statements', () => {
             'SKEWED BY',
             'TOUCH',
             'UNARCHIVE PARTITION',
-            'UNSET SERDEPROPERTIES'
+            'UNSET SERDEPROPERTIES',
+            'UNSET TBLPROPERTIES',
+            'UPDATE COLUMNS'
           ]
         }
       });
@@ -741,28 +926,6 @@ describe('hiveAutocompleteParser.js ALTER statements', () => {
       });
     });
 
-    it('should suggest columns for "ALTER TABLE bar CHANGE boo baa INT FIRST |"', () => {
-      assertAutoComplete({
-        beforeCursor: 'ALTER TABLE bar CHANGE boo baa INT FIRST ',
-        afterCursor: '',
-        expectedResult: {
-          lowerCase: false,
-          suggestColumns: { tables: [{ identifierChain: [{ name: 'bar' }] }] }
-        }
-      });
-    });
-
-    it('should suggest keywords for "ALTER TABLE bar CHANGE boo baa INT FIRST ba |"', () => {
-      assertAutoComplete({
-        beforeCursor: 'ALTER TABLE bar CHANGE boo baa INT FIRST ba ',
-        afterCursor: '',
-        expectedResult: {
-          lowerCase: false,
-          suggestKeywords: ['CASCADE', 'RESTRICT']
-        }
-      });
-    });
-
     it('should suggest keywords for "ALTER TABLE bar CHANGE COLUMN boo baa INT AFTER ba |"', () => {
       assertAutoComplete({
         beforeCursor: 'ALTER TABLE bar CHANGE COLUMN boo baa INT AFTER ba ',
@@ -1234,28 +1397,6 @@ describe('hiveAutocompleteParser.js ALTER statements', () => {
       });
     });
 
-    it('should suggest columns for "ALTER TABLE bar PARTITION (col=\'val\') CHANGE boo baa INT FIRST |"', () => {
-      assertAutoComplete({
-        beforeCursor: "ALTER TABLE bar PARTITION (col='val') CHANGE boo baa INT FIRST ",
-        afterCursor: '',
-        expectedResult: {
-          lowerCase: false,
-          suggestColumns: { tables: [{ identifierChain: [{ name: 'bar' }] }] }
-        }
-      });
-    });
-
-    it('should suggest keywords for "ALTER TABLE bar PARTITION (col=\'val\') CHANGE boo baa INT FIRST ba |"', () => {
-      assertAutoComplete({
-        beforeCursor: "ALTER TABLE bar PARTITION (col='val') CHANGE boo baa INT FIRST ba ",
-        afterCursor: '',
-        expectedResult: {
-          lowerCase: false,
-          suggestKeywords: ['CASCADE', 'RESTRICT']
-        }
-      });
-    });
-
     it('should suggest keywords for "ALTER TABLE bar PARTITION (col=\'val\') CHANGE COLUMN boo baa INT AFTER ba |"', () => {
       assertAutoComplete({
         beforeCursor: "ALTER TABLE bar PARTITION (col='val') CHANGE COLUMN boo baa INT AFTER ba ",
@@ -1475,6 +1616,7 @@ describe('hiveAutocompleteParser.js ALTER statements', () => {
             'FILEFORMAT',
             'LOCATION',
             'OWNER',
+            'PARTITION SPEC',
             'SERDE',
             'SERDEPROPERTIES',
             'SKEWED LOCATION',
@@ -1484,6 +1626,17 @@ describe('hiveAutocompleteParser.js ALTER statements', () => {
       });
     });
 
+    it('should suggest keywords for "ALTER TABLE bar SET PARTITION |"', () => {
+      assertAutoComplete({
+        beforeCursor: 'ALTER TABLE bar SET PARTITION ',
+        afterCursor: '',
+        expectedResult: {
+          lowerCase: false,
+          suggestKeywords: ['SPEC']
+        }
+      });
+    });
+
     it('should suggest keywords for "ALTER TABLE bar SET FILEFORMAT |"', () => {
       assertAutoComplete({
         beforeCursor: 'ALTER TABLE bar SET FILEFORMAT ',
@@ -1677,16 +1830,16 @@ describe('hiveAutocompleteParser.js ALTER statements', () => {
         afterCursor: '',
         expectedResult: {
           lowerCase: false,
-          suggestKeywords: ['SERDEPROPERTIES']
+          suggestKeywords: ['SERDEPROPERTIES', 'TBLPROPERTIES']
         }
       });
     });
   });
 
   describe('ALTER VIEW', () => {
-    it('should handle "ALTER VIEW baa.boo AS SELECT * FROM bla;|"', () => {
+    it('should handle "ALTER VIEW baa.boo AS SELECT * FROM bla; |"', () => {
       assertAutoComplete({
-        beforeCursor: 'ALTER VIEW baa.boo AS SELECT * FROM bla;',
+        beforeCursor: 'ALTER VIEW baa.boo AS SELECT * FROM bla; ',
         afterCursor: '',
         noErrors: true,
         containsKeywords: ['SELECT'],
@@ -1764,9 +1917,9 @@ describe('hiveAutocompleteParser.js ALTER statements', () => {
       });
     });
 
-    it('should handle "ALTER VIEW boo SET TBLPROPERTIES ("baa"=\'boo\');|"', () => {
+    it('should handle "ALTER VIEW boo SET TBLPROPERTIES ("baa"=\'boo\'); |"', () => {
       assertAutoComplete({
-        beforeCursor: 'ALTER VIEW boo SET TBLPROPERTIES ("baa"=\'boo\');',
+        beforeCursor: 'ALTER VIEW boo SET TBLPROPERTIES ("baa"=\'boo\'); ',
         afterCursor: '',
         noErrors: true,
         containsKeywords: ['SELECT'],
@@ -1800,9 +1953,9 @@ describe('hiveAutocompleteParser.js ALTER statements', () => {
   });
 
   describe('MSCK', () => {
-    it('should handle "MSCK REPAIR TABLE boo.baa;|"', () => {
+    it('should handle "MSCK REPAIR TABLE boo.baa; |"', () => {
       assertAutoComplete({
-        beforeCursor: 'MSCK REPAIR TABLE boo.baa;',
+        beforeCursor: 'MSCK REPAIR TABLE boo.baa; ',
         afterCursor: '',
         noErrors: true,
         containsKeywords: ['SELECT'],
@@ -1812,9 +1965,9 @@ describe('hiveAutocompleteParser.js ALTER statements', () => {
       });
     });
 
-    it('should handle "MSCK REPAIR TABLE boo.baa SYNC PARTITIONS;|"', () => {
+    it('should handle "MSCK REPAIR TABLE boo.baa SYNC PARTITIONS; |"', () => {
       assertAutoComplete({
-        beforeCursor: 'MSCK REPAIR TABLE boo.baa SYNC PARTITIONS;',
+        beforeCursor: 'MSCK REPAIR TABLE boo.baa SYNC PARTITIONS; ',
         afterCursor: '',
         noErrors: true,
         containsKeywords: ['SELECT'],
@@ -1893,9 +2046,9 @@ describe('hiveAutocompleteParser.js ALTER statements', () => {
   });
 
   describe('RELOAD FUNCTION', () => {
-    it('should handle "RELOAD FUNCTION;|"', () => {
+    it('should handle "RELOAD FUNCTION; |"', () => {
       assertAutoComplete({
-        beforeCursor: 'RELOAD FUNCTION;',
+        beforeCursor: 'RELOAD FUNCTION; ',
         afterCursor: '',
         noErrors: true,
         containsKeywords: ['SELECT'],

+ 298 - 1
desktop/core/src/desktop/js/parse/sql/hive/test/hiveAutocompleteParser.Create.test.js

@@ -46,11 +46,152 @@ describe('hiveAutocompleteParser.js CREATE statements', () => {
     });
   });
 
+  it('should handle "CREATE EXTERNAL TABLE ice_t_identity_part (a int) PARTITIONED BY (b string) STORED BY ICEBERG; |"', () => {
+    assertAutoComplete({
+      beforeCursor:
+        'CREATE EXTERNAL TABLE ice_t_identity_part (a int) PARTITIONED BY (b string) STORED BY ICEBERG; ',
+      afterCursor: '',
+      noErrors: true,
+      containsKeywords: ['SELECT'],
+      expectedResult: {
+        lowerCase: false
+      }
+    });
+  });
+
+  it('should handle "create external table tbl_ice ... stored by iceberg ...; |"', () => {
+    assertAutoComplete({
+      beforeCursor:
+        "create external table tbl_ice(a int, b string, c int) partitioned by spec (bucket(16, a), truncate(3, b)) stored by iceberg stored as avro tblproperties ('format-version'='2'); ",
+      afterCursor: '',
+      noErrors: true,
+      containsKeywords: ['SELECT'],
+      expectedResult: {
+        lowerCase: true
+      }
+    });
+  });
+
+  it('should handle "create external table tbl_ice_other(a int, b string) stored by iceberg; |"', () => {
+    assertAutoComplete({
+      beforeCursor: 'create external table tbl_ice_other(a int, b string) stored by iceberg; ',
+      afterCursor: '',
+      noErrors: true,
+      containsKeywords: ['SELECT'],
+      expectedResult: {
+        lowerCase: true
+      }
+    });
+  });
+
+  it('should handle "CREATE EXTERNAL TABLE ice_orc (i int, s string, ts timestamp, d date) STORED BY ICEBERG STORED AS ORC; |"', () => {
+    assertAutoComplete({
+      beforeCursor:
+        'CREATE EXTERNAL TABLE ice_orc (i int, s string, ts timestamp, d date) STORED BY ICEBERG STORED AS ORC; ',
+      afterCursor: '',
+      noErrors: true,
+      containsKeywords: ['SELECT'],
+      expectedResult: {
+        lowerCase: false
+      }
+    });
+  });
+
+  it('should handle "CREATE EXTERNAL TABLE ice_t (i int, s string, ts timestamp, d date) STORED BY \'org.apache.iceberg.mr.hive.HiveIcebergStorageHandler\' STORED AS AVRO; |"', () => {
+    assertAutoComplete({
+      beforeCursor:
+        "CREATE EXTERNAL TABLE ice_t (i int, s string, ts timestamp, d date) STORED BY 'org.apache.iceberg.mr.hive.HiveIcebergStorageHandler' STORED AS AVRO; ",
+      afterCursor: '',
+      noErrors: true,
+      containsKeywords: ['SELECT'],
+      expectedResult: {
+        lowerCase: false
+      }
+    });
+  });
+
+  it("should handle \"CREATE EXTERNAL TABLE ice_t (i int, s string, ts timestamp, d date) STORED BY ICEBERG WITH SERDEPROPERTIES('dummy'='dummy_value') STORED AS ORC; |\"", () => {
+    assertAutoComplete({
+      beforeCursor:
+        "CREATE EXTERNAL TABLE ice_t (i int, s string, ts timestamp, d date) STORED BY ICEBERG WITH SERDEPROPERTIES('dummy'='dummy_value') STORED AS ORC; ",
+      afterCursor: '',
+      noErrors: true,
+      containsKeywords: ['SELECT'],
+      expectedResult: {
+        lowerCase: false
+      }
+    });
+  });
+
+  it("should handle \"create external table tbl_ice(a int, b string, c int) partitioned by spec (bucket(16, a), truncate(3, b)) stored by iceberg tblproperties ('format-version'='2'); |\"", () => {
+    assertAutoComplete({
+      beforeCursor:
+        "create external table tbl_ice(a int, b string, c int) partitioned by spec (bucket(16, a), truncate(3, b)) stored by iceberg tblproperties ('format-version'='2'); ",
+      afterCursor: '',
+      noErrors: true,
+      containsKeywords: ['SELECT'],
+      expectedResult: {
+        lowerCase: true
+      }
+    });
+  });
+
+  it('should handle "CREATE EXTERNAL TABLE ice_t_transform (year_field date, month_field date, day_field date, hour_field timestamp, truncate_field string, bucket_field int, identity_field int) PARTITIONED BY SPEC (year(year_field), month(month_field), day(day_field), hour(hour_field), truncate(2, truncate_field), bucket(2, bucket_field), identity_field) STORED BY ICEBERG; |"', () => {
+    assertAutoComplete({
+      beforeCursor:
+        'CREATE EXTERNAL TABLE ice_t_transform (year_field date, month_field date, day_field date, hour_field timestamp, truncate_field string, bucket_field int, identity_field int) PARTITIONED BY SPEC (year(year_field), month(month_field), day(day_field), hour(hour_field), truncate(2, truncate_field), bucket(2, bucket_field), identity_field) STORED BY ICEBERG; ',
+      afterCursor: '',
+      noErrors: true,
+      containsKeywords: ['SELECT'],
+      expectedResult: {
+        lowerCase: false
+      }
+    });
+  });
+
+  it('should handle "CREATE EXTERNAL TABLE ice_t_transform_prop (id int, year_field date, month_field date, day_field date, hour_field timestamp, truncate_field string, bucket_field int, identity_field int) STORED BY ICEBERG TBLPROPERTIES (\'iceberg.mr.table.partition.spec\'=\'{"spec-id":0,"fields":[{"name":"year_field_year","transform":"year","source-id":1,"field-id":1000},{"name":"month_field_month","transform":"month","source-id":2,"field-id":1001},{"name":"day_field_day","transform":"day","source-id":3,"field-id":1002},{"name":"hour_field_hour","transform":"hour","source-id":4,"field-id":1003},{"name":"truncate_field_trunc","transform":"truncate[2]","source-id":5,"field-id":1004},{"name":"bucket_field_bucket","transform":"bucket[2]","source-id":6,"field-id":1005},{"name":"identity_field","transform":"identity","source-id":7,"field-id":1006}]}\'); |"', () => {
+    assertAutoComplete({
+      beforeCursor:
+        'CREATE EXTERNAL TABLE ice_t_transform_prop (id int, year_field date, month_field date, day_field date, hour_field timestamp, truncate_field string, bucket_field int, identity_field int) STORED BY ICEBERG TBLPROPERTIES (\'iceberg.mr.table.partition.spec\'=\'{"spec-id":0,"fields":[{"name":"year_field_year","transform":"year","source-id":1,"field-id":1000},{"name":"month_field_month","transform":"month","source-id":2,"field-id":1001},{"name":"day_field_day","transform":"day","source-id":3,"field-id":1002},{"name":"hour_field_hour","transform":"hour","source-id":4,"field-id":1003},{"name":"truncate_field_trunc","transform":"truncate[2]","source-id":5,"field-id":1004},{"name":"bucket_field_bucket","transform":"bucket[2]","source-id":6,"field-id":1005},{"name":"identity_field","transform":"identity","source-id":7,"field-id":1006}]}\'); ',
+      afterCursor: '',
+      noErrors: true,
+      containsKeywords: ['SELECT'],
+      expectedResult: {
+        lowerCase: false
+      }
+    });
+  });
+
+  it('should handle "CREATE TABLE target STORED BY ICEBERG AS SELECT * FROM source; |"', () => {
+    assertAutoComplete({
+      beforeCursor: 'CREATE TABLE target STORED BY ICEBERG AS SELECT * FROM source; ',
+      afterCursor: '',
+      noErrors: true,
+      containsKeywords: ['SELECT'],
+      expectedResult: {
+        lowerCase: false
+      }
+    });
+  });
+
+  it('should handle "CREATE EXTERNAL TABLE foo PARTITIONED BY SPEC (year(year_field), month(month_field), day(day_field), hour(hour_field), truncate(2, truncate_field), bucket(2, bucket_field), identity_field) STORED BY ICEBERG; |"', () => {
+    assertAutoComplete({
+      beforeCursor:
+        'CREATE EXTERNAL TABLE foo PARTITIONED BY SPEC (year(year_field), month(month_field), day(day_field), hour(hour_field), truncate(2, truncate_field), bucket(2, bucket_field), identity_field) STORED BY ICEBERG; ',
+      afterCursor: '',
+      noErrors: true,
+      containsKeywords: ['SELECT'],
+      expectedResult: {
+        lowerCase: false
+      }
+    });
+  });
+
   it('should handle "CREATE ROLE baaa;|', () => {
     assertAutoComplete({
       beforeCursor: 'CREATE ROLE baaa;',
       afterCursor: '',
-      noError: true,
+      noErrors: true,
       containsKeywords: ['SELECT'],
       expectedResult: {
         lowerCase: false
@@ -65,11 +206,13 @@ describe('hiveAutocompleteParser.js CREATE statements', () => {
       expectedResult: {
         lowerCase: false,
         suggestKeywords: [
+          'CONNECTOR',
           'DATABASE',
           'EXTERNAL TABLE',
           'FUNCTION',
           'INDEX',
           'MATERIALIZED VIEW',
+          'REMOTE DATABASE',
           'ROLE',
           'SCHEDULED QUERY',
           'SCHEMA',
@@ -85,7 +228,125 @@ describe('hiveAutocompleteParser.js CREATE statements', () => {
     });
   });
 
+  describe('CREATE CONNECTOR', () => {
+    it("should handle \"CREATE CONNECTOR IF NOT EXISTS foo TYPE 'mysql' URL 'http://someURl' COMMENT 'Connector comment ' WITH DCPROPERTIES ('foo'='bar'); |\"", () => {
+      assertAutoComplete({
+        beforeCursor:
+          "CREATE CONNECTOR IF NOT EXISTS foo TYPE 'mysql' URL 'http://someURl' COMMENT 'Connector comment ' WITH DCPROPERTIES ('foo'='bar'); ",
+        afterCursor: '',
+        noErrors: true,
+        containsKeywords: ['SELECT'],
+        expectedResult: {
+          lowerCase: false
+        }
+      });
+    });
+
+    it('should suggest keywords for "CREATE CONNECTOR |"', () => {
+      assertAutoComplete({
+        beforeCursor: 'CREATE CONNECTOR ',
+        afterCursor: '',
+        expectedResult: {
+          lowerCase: false,
+          suggestKeywords: ['IF NOT EXISTS']
+        }
+      });
+    });
+
+    it('should suggest keywords for "CREATE CONNECTOR IF |"', () => {
+      assertAutoComplete({
+        beforeCursor: 'CREATE CONNECTOR IF ',
+        afterCursor: '',
+        expectedResult: {
+          lowerCase: false,
+          suggestKeywords: ['NOT EXISTS']
+        }
+      });
+    });
+
+    it('should suggest keywords for "CREATE CONNECTOR foo |"', () => {
+      assertAutoComplete({
+        beforeCursor: 'CREATE CONNECTOR foo ',
+        afterCursor: '',
+        expectedResult: {
+          lowerCase: false,
+          suggestKeywords: ['TYPE', 'URL', 'COMMENT', 'WITH DCPROPERTIES']
+        }
+      });
+    });
+
+    it('should suggest keywords for "CREATE CONNECTOR foo TYPE \'bar\' |"', () => {
+      assertAutoComplete({
+        beforeCursor: "CREATE CONNECTOR foo TYPE 'bar' ",
+        afterCursor: '',
+        expectedResult: {
+          lowerCase: false,
+          suggestKeywords: ['URL', 'COMMENT', 'WITH DCPROPERTIES']
+        }
+      });
+    });
+
+    it("should suggest keywords for \"CREATE CONNECTOR foo TYPE 'bar' URL 'http://someurl' |\"", () => {
+      assertAutoComplete({
+        beforeCursor: "CREATE CONNECTOR foo TYPE 'bar' URL 'http://someurl' ",
+        afterCursor: '',
+        expectedResult: {
+          lowerCase: false,
+          suggestKeywords: ['COMMENT', 'WITH DCPROPERTIES']
+        }
+      });
+    });
+
+    it("should suggest keywords for \"CREATE CONNECTOR foo TYPE 'bar' URL 'http://someurl' COMMENT 'some comment' |\"", () => {
+      assertAutoComplete({
+        beforeCursor:
+          "CREATE CONNECTOR foo TYPE 'bar' URL 'http://someurl' COMMENT 'some comment' ",
+        afterCursor: '',
+        expectedResult: {
+          lowerCase: false,
+          suggestKeywords: ['WITH DCPROPERTIES']
+        }
+      });
+    });
+
+    it("should suggest keywords for \"CREATE CONNECTOR foo TYPE 'bar' URL 'http://someurl' COMMENT 'some comment' WITH |\"", () => {
+      assertAutoComplete({
+        beforeCursor:
+          "CREATE CONNECTOR foo TYPE 'bar' URL 'http://someurl' COMMENT 'some comment' WITH ",
+        afterCursor: '',
+        expectedResult: {
+          lowerCase: false,
+          suggestKeywords: ['DCPROPERTIES']
+        }
+      });
+    });
+
+    it("should suggest keywords for \"CREATE CONNECTOR foo TYPE 'bar' URL 'http://someurl' WITH |\"", () => {
+      assertAutoComplete({
+        beforeCursor: "CREATE CONNECTOR foo TYPE 'bar' URL 'http://someurl' WITH ",
+        afterCursor: '',
+        expectedResult: {
+          lowerCase: false,
+          suggestKeywords: ['DCPROPERTIES']
+        }
+      });
+    });
+  });
+
   describe('CREATE DATABASE', () => {
+    it("should handle \"CREATE REMOTE DATABASE postgres_db1 USING foo WITH DBPROPERTIES ('connector.remoteDbName'='db1'); |\"", () => {
+      assertAutoComplete({
+        beforeCursor:
+          "CREATE REMOTE DATABASE postgres_db1 USING foo WITH DBPROPERTIES ('connector.remoteDbName'='db1'); ",
+        afterCursor: '',
+        noErrors: true,
+        containsKeywords: ['SELECT'],
+        expectedResult: {
+          lowerCase: false
+        }
+      });
+    });
+
     it('should suggest keywords for "CREATE DATABASE |"', () => {
       assertAutoComplete({
         beforeCursor: 'CREATE DATABASE ',
@@ -180,6 +441,7 @@ describe('hiveAutocompleteParser.js CREATE statements', () => {
       assertAutoComplete({
         beforeCursor: "CREATE TEMPORARY FUNCTION baaa AS 'boo.baa'; ",
         afterCursor: '',
+        noErrors: true,
         containsKeywords: ['SELECT'],
         expectedResult: {
           lowerCase: false
@@ -192,6 +454,7 @@ describe('hiveAutocompleteParser.js CREATE statements', () => {
         beforeCursor:
           "CREATE FUNCTION boo.baaa AS 'boo.baa' USING JAR 'boo.jar', FILE 'booo', ARCHIVE 'baa'; ",
         afterCursor: '',
+        noErrors: true,
         containsKeywords: ['SELECT'],
         expectedResult: {
           lowerCase: false
@@ -284,6 +547,7 @@ describe('hiveAutocompleteParser.js CREATE statements', () => {
           '("boo.baa"="ble", "blaa"=1) IN TABLE dbTwo.tblTwo ROW FORMAT DELIMITED STORED AS PARQUET LOCATION \'/baa/boo\' ' +
           'TBLPROPERTIES ("bla"=1) COMMENT "booo"; ',
         afterCursor: '',
+        noErrors: true,
         containsKeywords: ['SELECT'],
         expectedResult: {
           lowerCase: false
@@ -295,6 +559,7 @@ describe('hiveAutocompleteParser.js CREATE statements', () => {
       assertAutoComplete({
         beforeCursor: "CREATE INDEX bla ON TABLE db.tbl (a, b, c) AS 'boo.baa.bitmap'; ",
         afterCursor: '',
+        noErrors: true,
         containsKeywords: ['SELECT'],
         expectedResult: {
           lowerCase: false
@@ -642,6 +907,7 @@ describe('hiveAutocompleteParser.js CREATE statements', () => {
       assertAutoComplete({
         beforeCursor: 'CREATE ROLE boo; ',
         afterCursor: '',
+        noErrors: true,
         containsKeywords: ['SELECT'],
         expectedResult: {
           lowerCase: false
@@ -1276,6 +1542,37 @@ describe('hiveAutocompleteParser.js CREATE statements', () => {
       });
     });
 
+    it('should suggest keywords for "CREATE TABLE foo (id int) STORED BY |"', () => {
+      assertAutoComplete({
+        beforeCursor: 'CREATE TABLE foo (id int) STORED BY ',
+        afterCursor: '',
+        expectedResult: {
+          lowerCase: false,
+          suggestKeywords: ['ICEBERG']
+        }
+      });
+    });
+
+    it('should suggest keywords for "CREATE TABLE foo (id int) STORED BY ICEBERG STORED AS |"', () => {
+      assertAutoComplete({
+        beforeCursor: 'CREATE TABLE foo (id int) STORED BY ICEBERG STORED AS ',
+        afterCursor: '',
+        expectedResult: {
+          lowerCase: false,
+          suggestKeywords: [
+            'AVRO',
+            'INPUTFORMAT',
+            'JSONFILE',
+            'ORC',
+            'PARQUET',
+            'RCFILE',
+            'SEQUENCEFILE',
+            'TEXTFILE'
+          ]
+        }
+      });
+    });
+
     it('should suggest keywords for "CREATE TABLE foo (id int) ROW |"', () => {
       assertAutoComplete({
         beforeCursor: 'CREATE TABLE foo (id int) ROW ',

+ 24 - 2
desktop/core/src/desktop/js/parse/sql/hive/test/hiveAutocompleteParser.Describe.test.js

@@ -201,6 +201,17 @@ describe('hiveAutocompleteParser.js DESCRIBE statements', () => {
     });
   });
 
+  it('should handle "DESCRIBE CONNECTOR EXTENDED foo; |"', () => {
+    assertAutoComplete({
+      beforeCursor: 'DESCRIBE CONNECTOR EXTENDED foo;',
+      afterCursor: '',
+      containsKeywords: ['SELECT'],
+      expectedResult: {
+        lowerCase: false
+      }
+    });
+  });
+
   it('should handle "DESCRIBE DATABASE db;|"', () => {
     assertAutoComplete({
       beforeCursor: 'DESCRIBE DATABASE db;',
@@ -251,20 +262,31 @@ describe('hiveAutocompleteParser.js DESCRIBE statements', () => {
       afterCursor: '',
       expectedResult: {
         lowerCase: false,
-        suggestKeywords: ['DATABASE', 'EXTENDED', 'FORMATTED', 'FUNCTION', 'SCHEMA'],
+        suggestKeywords: ['CONNECTOR', 'DATABASE', 'EXTENDED', 'FORMATTED', 'FUNCTION', 'SCHEMA'],
         suggestTables: {},
         suggestDatabases: { appendDot: true }
       }
     });
   });
 
+  it('should suggest keywords for "DESCRIBE CONNECTOR |"', () => {
+    assertAutoComplete({
+      beforeCursor: 'DESCRIBE CONNECTOR ',
+      afterCursor: '',
+      expectedResult: {
+        lowerCase: false,
+        suggestKeywords: ['EXTENDED']
+      }
+    });
+  });
+
   it('should suggest tables for "DESCRIBE tbl|"', () => {
     assertAutoComplete({
       beforeCursor: 'DESCRIBE tbl',
       afterCursor: '',
       expectedResult: {
         lowerCase: false,
-        suggestKeywords: ['DATABASE', 'EXTENDED', 'FORMATTED', 'FUNCTION', 'SCHEMA'],
+        suggestKeywords: ['CONNECTOR', 'DATABASE', 'EXTENDED', 'FORMATTED', 'FUNCTION', 'SCHEMA'],
         suggestTables: {},
         suggestDatabases: { appendDot: true }
       }

+ 36 - 0
desktop/core/src/desktop/js/parse/sql/hive/test/hiveAutocompleteParser.Drop.test.js

@@ -41,6 +41,7 @@ describe('hiveAutocompleteParser.js DROP statements', () => {
       expectedResult: {
         lowerCase: false,
         suggestKeywords: [
+          'CONNECTOR',
           'DATABASE',
           'FUNCTION',
           'INDEX',
@@ -188,6 +189,41 @@ describe('hiveAutocompleteParser.js DROP statements', () => {
     });
   });
 
+  describe('DROP CONNECTOR', () => {
+    it('should handle "DROP CONNECTOR IF EXISTS foo; |"', () => {
+      assertAutoComplete({
+        beforeCursor: 'DROP CONNECTOR IF EXISTS foo;',
+        afterCursor: '',
+        containsKeywords: ['SELECT'],
+        expectedResult: {
+          lowerCase: false
+        }
+      });
+    });
+
+    it('should suggest databases for "DROP CONNECTOR |"', () => {
+      assertAutoComplete({
+        beforeCursor: 'DROP CONNECTOR ',
+        afterCursor: '',
+        expectedResult: {
+          lowerCase: false,
+          suggestKeywords: ['IF EXISTS']
+        }
+      });
+    });
+
+    it('should suggest databases for "DROP CONNECTOR IF |"', () => {
+      assertAutoComplete({
+        beforeCursor: 'DROP CONNECTOR IF ',
+        afterCursor: '',
+        expectedResult: {
+          lowerCase: false,
+          suggestKeywords: ['EXISTS']
+        }
+      });
+    });
+  });
+
   describe('DROP DATABASE', () => {
     it('should suggest databases for "DROP DATABASE |"', () => {
       assertAutoComplete({

+ 12 - 0
desktop/core/src/desktop/js/parse/sql/hive/test/hiveAutocompleteParser.Insert.test.js

@@ -47,6 +47,18 @@ describe('hiveAutocompleteParser.js INSERT statements', () => {
       });
     });
 
+    it('should handle "INSERT OVERWRITE TABLE target SELECT * FROM source; |"', () => {
+      assertAutoComplete({
+        beforeCursor: 'INSERT OVERWRITE TABLE target SELECT * FROM source; ',
+        afterCursor: '',
+        noErrors: true,
+        containsKeywords: ['SELECT'],
+        expectedResult: {
+          lowerCase: false
+        }
+      });
+    });
+
     it('should suggest keywords for "|"', () => {
       assertAutoComplete({
         beforeCursor: '',

+ 51 - 0
desktop/core/src/desktop/js/parse/sql/hive/test/hiveAutocompleteParser.Select.test.js

@@ -257,6 +257,57 @@ describe('hiveAutocompleteParser.js SELECT statements', () => {
       });
     });
 
+    it('should handle "SELECT * FROM (VALUES(1,2,3),(4,5,6)) as foo; |"', () => {
+      assertAutoComplete({
+        beforeCursor: 'SELECT * FROM (VALUES(1,2,3),(4,5,6)) as foo; ',
+        afterCursor: '',
+        noErrors: true,
+        containsKeywords: ['SELECT'],
+        expectedResult: {
+          lowerCase: false
+        }
+      });
+    });
+
+    it("should handle \"SELECT * FROM (VALUES(1,2,3),(4,5,6)) as foo JOIN (VALUES(1,'a'),(4,'b')) as bar ON foo.col1 = bar.col1; |\"", () => {
+      assertAutoComplete({
+        beforeCursor:
+          "SELECT * FROM (VALUES(1,2,3),(4,5,6)) as foo JOIN (VALUES(1,'a'),(4,'b')) as bar ON foo.col1 = bar.col1; ",
+        afterCursor: '',
+        noErrors: true,
+        containsKeywords: ['SELECT'],
+        expectedResult: {
+          lowerCase: false
+        }
+      });
+    });
+
+    it("should handle \"WITH t1 AS (VALUES('a', 'b'), ('b', 'c')) SELECT * FROM t1 WHERE col1 = 'a' UNION ALL SELECT * from t1 WHERE col1 = 'b'; |\"", () => {
+      assertAutoComplete({
+        beforeCursor:
+          "WITH t1 AS (VALUES('a', 'b'), ('b', 'c')) SELECT * FROM t1 WHERE col1 = 'a' UNION ALL SELECT * from t1 WHERE col1 = 'b'; ",
+        afterCursor: '',
+        noErrors: true,
+        containsKeywords: ['SELECT'],
+        expectedResult: {
+          lowerCase: false
+        }
+      });
+    });
+
+    it('should handle "SELECT t1.bigint_col FROM alltypestiny t1 WHERE t1.bigint_col > 1 AND NOT EXISTS (SELECT SUM(smallint_col) AS int_col FROM alltypestiny WHERE t1.date_string_col = string_col AND t1.timestamp_col = timestamp_col) GROUP BY t1.bigint_col; |"', () => {
+      assertAutoComplete({
+        beforeCursor:
+          'SELECT t1.bigint_col FROM alltypestiny t1 WHERE t1.bigint_col > 1 AND NOT EXISTS (SELECT SUM(smallint_col) AS int_col FROM alltypestiny WHERE t1.date_string_col = string_col AND t1.timestamp_col = timestamp_col) GROUP BY t1.bigint_col; ',
+        afterCursor: '',
+        noErrors: true,
+        containsKeywords: ['SELECT'],
+        expectedResult: {
+          lowerCase: false
+        }
+      });
+    });
+
     it("should handle \"SELECT bla NOT RLIKE 'ble', ble NOT REGEXP 'b' FROM tbl; |\"", () => {
       assertAutoComplete({
         beforeCursor: "SELECT bla NOT RLIKE 'ble', ble NOT REGEXP 'b' FROM tbl; ",

+ 15 - 0
desktop/core/src/desktop/js/parse/sql/hive/test/hiveAutocompleteParser.Show.test.js

@@ -44,6 +44,7 @@ describe('hiveAutocompleteParser.js SHOW statements', () => {
           'COLUMNS',
           'COMPACTIONS',
           'CONF',
+          'CONNECTORS',
           'CREATE TABLE',
           'CURRENT ROLES',
           'DATABASES',
@@ -97,6 +98,20 @@ describe('hiveAutocompleteParser.js SHOW statements', () => {
     });
   });
 
+  describe('SHOW CONNECTORS', () => {
+    it('should handle "SHOW CONNECTORS; |"', () => {
+      assertAutoComplete({
+        beforeCursor: 'SHOW CONNECTORS; ',
+        afterCursor: '',
+        noErrors: true,
+        containsKeywords: ['SELECT'],
+        expectedResult: {
+          lowerCase: false
+        }
+      });
+    });
+  });
+
   describe('SHOW CURRENT', () => {
     it('should handle "SHOW CURRENT ROLES;|"', () => {
       assertAutoComplete({

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


+ 1 - 1
desktop/core/src/desktop/js/parse/sql/impala/test/impalaAutocompleteParser.Create.test.js

@@ -50,7 +50,7 @@ describe('impalaAutocompleteParser.js CREATE statements', () => {
     assertAutoComplete({
       beforeCursor: 'CREATE ROLE baaa;',
       afterCursor: '',
-      noError: true,
+      noErrors: true,
       containsKeywords: ['SELECT'],
       expectedResult: {
         lowerCase: false

+ 1 - 1
desktop/core/src/desktop/js/parse/sql/presto/test/prestoAutocompleteParser.Create.test.js

@@ -50,7 +50,7 @@ describe('prestoAutocompleteParser.js CREATE statements', () => {
     assertAutoComplete({
       beforeCursor: 'CREATE ROLE baaa;',
       afterCursor: '',
-      noError: true,
+      noErrors: true,
       containsKeywords: ['SELECT'],
       expectedResult: {
         lowerCase: false

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

@@ -757,6 +757,7 @@ export const initSyntaxParser = parser => {
   const IGNORED_EXPECTED = {
     ';': true,
     '.': true,
+    CREATE_REMOTE: true,
     EOF: true,
     UNSIGNED_INTEGER: true,
     UNSIGNED_INTEGER_E: true,

+ 1 - 0
desktop/core/src/desktop/js/sql/reference/hive/reservedKeywords.ts

@@ -37,6 +37,7 @@ export const RESERVED_WORDS: Set<string> = new Set([
   'COMMIT',
   'CONF',
   'CONSTRAINT',
+  'CONNECTOR',
   'CREATE',
   'CROSS',
   'CUBE',

文件差异内容过多而无法显示
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_177049669.json


文件差异内容过多而无法显示
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_177050456.json


文件差异内容过多而无法显示
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_27362034.json


文件差异内容过多而无法显示
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_27362036.json


文件差异内容过多而无法显示
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_27838462.json


文件差异内容过多而无法显示
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_27842758.json


文件差异内容过多而无法显示
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_30754722.json


文件差异内容过多而无法显示
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_34838882.json


文件差异内容过多而无法显示
+ 0 - 0
desktop/core/src/desktop/static/desktop/docs/hive/_40509928.json


文件差异内容过多而无法显示
+ 0 - 0
desktop/core/src/desktop/templates/sql_doc_index.mako


+ 19 - 18
tools/ace-editor/lib/ace/mode/hive_highlight_rules.js

@@ -25,24 +25,25 @@ define(function (require, exports, module) {
     // regexps are ordered -> the first match is used
 
     var keywords =
-      'ABORT|ADD|ADMIN|AFTER|ALL|ALTER|ANALYZE|AND|ARCHIVE|AS|ASC|AST|AUTHORIZATION|AVRO|BETWEEN|BUCKET|BUCKETS|BY|' +
+      'ABORT|ADD|ADMIN|AFTER|ALL|ALTER|ANALYZE|AND|ARCHIVE|AS|ASC|AST|AUTHORIZATION|BETWEEN|BUCKET|BUCKETS|BY|' +
       'CACHE|CASCADE|CASE|CBO|CHANGE|CHECK|CLUSTER|CLUSTERED|COLLECTION|COLUMN|COLUMNS|COMMENT|COMPACT|COMPACTIONS|' +
-      'COMPUTE|CONCATENATE|CONF|CONSTRAINT|COST|CREATE|CROSS|CUBE|CURRENT|DATA|DATABASE|DATABASES|DBPROPERTIES|' +
-      'DEFAULT|DEFERRED|DEFINED|DELETE|DEPENDENCY|DESC|DESCRIBE|DETAIL|DIRECTORY|DISABLE|DISTINCT|DISTRIBUTE|' +
-      'DISTRIBUTED|DIV|DROP|ELSE|ENABLE|END|ESCAPED|EXCHANGE|EXISTS|EXPLAIN|EXPORT|EXPRESSION|EXTENDED|EXTERNAL|' +
-      'FIELDS|FILE|FILEFORMAT|FIRST|FOLLOWING|FOR|FOREIGN|FORMAT|FORMATTED|FROM|FULL|FUNCTION|FUNCTIONS|GRANT|GROUP|' +
-      'GROUPING|HAVING|IDXPROPERTIES|IF|IMPORT|IN|INDEX|INDEXES|INNER|INPATH|INPUTFORMAT|INSERT|INTO|IS|ITEMS|JAR|' +
-      'JOIN|JOINCOST|KEY|KEYS|LAST|LATERAL|LEFT|LIKE|LIMIT|LINES|LITERAL|LOAD|LOCAL|LOCATION|LOCK|LOCKS|MACRO|' +
-      'MATCHED|MATERIALIZED|MERGE|METADATA|MSCK|NO_DROP|NONE|NORELY|NOSCAN|NOT|NOVALIDATE|NULLS|OF|OFFLINE|ON|ONLY|' +
-      'OPERATOR|OPTION|OR|ORDER|OUT|OUTER|OUTPUTFORMAT|OVER|OVERWRITE|OWNER|PARTITION|PARTITIONED|PARTITIONS|' +
-      'PERCENT|PRECEDING|PRIMARY|PRIVILEGES|PURGE|QUARTER|RANGE|REBUILD|RECOVER|REFERENCES|REGEXP|RELOAD|RELY|' +
-      'RENAME|REPAIR|REPLACE|REPLICATION|RESTRICT|REVOKE|REWRITE|RIGHT|RLIKE|ROLE|ROLES|ROLLUP|ROW|ROWS|SCHEMA|' +
-      'SCHEMAS|SELECT|SEMI|SERDEPROPERTIES|SET|SETS|SHOW|SHOW_DATABASE|SKEWED|SORT|SORTED|STATISTICS|STORED|SUMMARY|' +
-      'SYNC|TABLE|TABLES|TABLESAMPLE|TBLPROPERTIES|TEMPORARY|TERMINATED|THEN|TO|TOUCH|TRANSACTIONAL|TRANSACTIONS|' +
-      'TRUNCATE|UNARCHIVE|UNBOUNDED|UNION|UNIQUE|UPDATE|USE|USER|USING|VALUES|VECTORIZATION|VIEW|VIEWS|WAIT|WHEN|' +
-      'WHERE|WINDOW|WITH';
+      'COMPUTE|CONCATENATE|CONF|CONNECTOR|CONNECTORS|CONSTRAINT|COST|CREATE|CROSS|CUBE|CURRENT|DATA|DATABASE|' +
+      'DATABASES|DBPROPERTIES|DCPROPERTIES|DEFAULT|DEFERRED|DEFINED|DELETE|DEPENDENCY|DESC|DESCRIBE|DETAIL|DIRECTORY|' +
+      'DISABLE|DISTINCT|DISTRIBUTE|DISTRIBUTED|DIV|DROP|ELSE|ENABLE|END|ESCAPED|EXCHANGE|EXISTS|EXPLAIN|EXPORT|' +
+      'EXPRESSION|EXTENDED|EXTERNAL|FIELDS|FILE|FILEFORMAT|FIRST|FOLLOWING|FOR|FOREIGN|FORMAT|FORMATTED|FROM|FULL|' +
+      'FUNCTION|FUNCTIONS|GRANT|GROUP|GROUPING|HAVING|IDXPROPERTIES|IF|IMPORT|IN|INDEX|INDEXES|INNER|INPATH|' +
+      'INPUTFORMAT|INSERT|INTO|IS|ITEMS|JAR|JOIN|JOINCOST|KEY|KEYS|LAST|LATERAL|LEFT|LIKE|LIMIT|LINES|LITERAL|LOAD|' +
+      'LOCAL|LOCATION|LOCK|LOCKS|MACRO|MATCHED|MATERIALIZED|MERGE|METADATA|MSCK|NO_DROP|NONE|NORELY|NOSCAN|NOT|' +
+      'NOVALIDATE|NULLS|OF|OFFLINE|ON|ONLY|OPERATOR|OPTION|OR|ORDER|OUT|OUTER|OUTPUTFORMAT|OVER|OVERWRITE|OWNER|' +
+      'PARTITION|PARTITIONED|PARTITIONS|PERCENT|PRECEDING|PRIMARY|PRIVILEGES|PURGE|QUARTER|RANGE|REBUILD|RECOVER|' +
+      'REFERENCES|REGEXP|RELOAD|RELY|REMOTE|RENAME|REPAIR|REPLACE|REPLICATION|RESTRICT|REVOKE|REWRITE|RIGHT|RLIKE|' +
+      'ROLE|ROLES|ROLLUP|ROW|ROWS|SCHEMA|SCHEMAS|SELECT|SEMI|SERDEPROPERTIES|SET|SETS|SHOW|SHOW_DATABASE|SKEWED|SORT|' +
+      'SORTED|SPEC|STATISTICS|STORED|SUMMARY|SYNC|TABLE|TABLES|TABLESAMPLE|TBLPROPERTIES|TEMPORARY|TERMINATED|THEN|' +
+      'TO|TOUCH|TRANSACTIONAL|TRANSACTIONS|TRUNCATE|TYPE|UNARCHIVE|UNBOUNDED|UNION|UNIQUE|UPDATE|URL|USE|USER|USING|' +
+      'VALUES|VECTORIZATION|VIEW|VIEWS|WAIT|WHEN|WHERE|WINDOW|WITH';
 
-    var builtinConstants = 'FALSE|NULL|TRUE';
+    var builtinConstants =
+      'AVRO|DELIMITED|FALSE|ICEBERG|JSONFILE|NULL|ORC|PARQUET|RCFILE|SEQUENCEFILE|SERDE|TEXTFILE|TRUE';
 
     var builtinFunctions =
       'ABS|ACOS|ADD_MONTHS|AES_DECRYPT|AES_ENCRYPT|ARRAY|ARRAY_CONTAINS|ASCII|ASIN|ATAN|AVG|BASE64|BIN|BINARY|' +
@@ -62,8 +63,8 @@ define(function (require, exports, module) {
       'XPATH_BOOLEAN|XPATH_DOUBLE|XPATH_FLOAT|XPATH_INT|XPATH_LONG|XPATH_NUMBER|XPATH_SHORT|XPATH_STRING|YEAR';
 
     var dataTypes =
-      'ARRAY|BIGINT|BINARY|BOOLEAN|CHAR|DATE|DECIMAL|DELIMITED|DOUBLE|FLOAT|INT|INTEGER|JSONFILE|MAP|ORC|PARQUET|PRECISION|' +
-      'RCFILE|SEQUENCEFILE|SERDE|SMALLINT|STRING|STRUCT|TEXTFILE|TIMESTAMP|TINYINT|UNIONTYPE|VARCHAR';
+      'ARRAY|BIGINT|BINARY|BOOLEAN|CHAR|DATE|DECIMAL|DOUBLE|FLOAT|INT|INTEGER|MAP|PRECISION|SMALLINT|STRING|STRUCT|' +
+      'TIMESTAMP|TINYINT|UNIONTYPE|VARCHAR';
 
     var keywordMapper = this.createKeywordMapper({
         "support.function": builtinFunctions,

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