소스 검색

HUE-4313 [editor] The new autocompleter should accept non-reserved keywords for DBs, tables, columns etc.

Johan Ahlen 9 년 전
부모
커밋
1127d73855

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 254 - 186
desktop/core/src/desktop/static/desktop/js/autocomplete/sql.jison


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
desktop/core/src/desktop/static/desktop/js/autocomplete/sql.js


+ 15 - 0
desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecSelect.js

@@ -725,6 +725,21 @@ define([
         });
       });
 
+      it('should suggest columns for "SELECT | FROM transactions"', function () {
+        assertAutoComplete({
+          beforeCursor: 'SELECT ',
+          afterCursor: ' FROM transactions',
+          hasLocations: true,
+          expectedResult: {
+            lowerCase: false,
+            suggestKeywords: ['*', 'ALL', 'DISTINCT'],
+            suggestAggregateFunctions: true,
+            suggestFunctions: {},
+            suggestColumns: { table: 'transactions' }
+          }
+        });
+      });
+
       it('should suggest aliases for "SELECT | FROM testTableA tta, testTableB"', function() {
         assertAutoComplete({
           beforeCursor: 'SELECT ',

+ 12 - 0
desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecShow.js

@@ -1292,6 +1292,18 @@ define([
         });
       });
 
+      it('should suggest keywords for "SHOW | ROLES"', function() {
+        assertAutoComplete({
+          beforeCursor: 'SHOW ',
+          afterCursor: ' ROLES',
+          dialect: 'impala',
+          expectedResult: {
+            lowerCase: false,
+            suggestKeywords: ['CURRENT']
+          }
+        });
+      });
+
       it('should handle "SHOW CURRENT ROLES;|"', function() {
         assertAutoComplete({
           beforeCursor: 'SHOW CURRENT ROLES;',

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.