Sfoglia il codice sorgente

HUE-5459 [editor] Improve autocomplete keyword completion around DESCRIBE

Johan Ahlen 9 anni fa
parent
commit
aeff61e

+ 12 - 0
desktop/core/src/desktop/static/desktop/js/autocomplete/jison/sql_main.jison

@@ -1085,6 +1085,18 @@ HiveDescribeStatement_EDIT
    {
      addTablePrimary($3);
    }
+ | '<hive>DESCRIBE' OptionalExtendedOrFormatted 'CURSOR' SchemaQualifiedTableIdentifier DerivedColumnChain
+   {
+     if (!$2) {
+       suggestKeywords(['EXTENDED', 'FORMATTED']);
+     }
+   }
+ | '<hive>DESCRIBE' OptionalExtendedOrFormatted 'CURSOR' SchemaQualifiedTableIdentifier
+   {
+     if (!$2) {
+       suggestKeywords(['EXTENDED', 'FORMATTED']);
+     }
+   }
  | '<hive>DESCRIBE' OptionalExtendedOrFormatted SchemaQualifiedTableIdentifier 'CURSOR'
    {
      addTablePrimary($3);

File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/js/autocomplete/sql.js


+ 26 - 0
desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecDescribe.js

@@ -87,6 +87,32 @@
         });
       });
 
+      it('should handle DESCRIBE | tbl;', function () {
+        assertAutoComplete({
+          beforeCursor: 'DESCRIBE ',
+          afterCursor: ' tbl;',
+          dialect: 'hive',
+          hasLocations: true,
+          containsKeywords: ['EXTENDED', 'FORMATTED'],
+          expectedResult: {
+            lowerCase: false
+          }
+        });
+      });
+
+      it('should handle DESCRIBE ext| db.tbl;', function () {
+        assertAutoComplete({
+          beforeCursor: 'DESCRIBE ext',
+          afterCursor: ' db.tbl;',
+          dialect: 'hive',
+          hasLocations: true,
+          containsKeywords: ['EXTENDED', 'FORMATTED'],
+          expectedResult: {
+            lowerCase: false
+          }
+        });
+      });
+
       it('should handle "DESCRIBE FORMATTED tbl;|"', function() {
         assertAutoComplete({
           beforeCursor: 'DESCRIBE FORMATTED tbl;',

Some files were not shown because too many files changed in this diff