瀏覽代碼

HUE-6958 [autocomplete] Update autocompleter for the Hive LIMIT clause

Johan Ahlen 8 年之前
父節點
當前提交
bd3f66b

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

@@ -2279,7 +2279,9 @@ OptionalLimitClause
 
 LimitClause
  : 'LIMIT' UnsignedNumericLiteral
+ | 'LIMIT' UnsignedNumericLiteral ',' UnsignedNumericLiteral
  | 'LIMIT' 'VARIABLE_REFERENCE'
+ | 'LIMIT' 'VARIABLE_REFERENCE' ',' 'VARIABLE_REFERENCE'
  | '<impala>LIMIT' ValueExpression
  ;
 

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

@@ -5791,6 +5791,19 @@
       });
 
       describe('Hive specific', function () {
+        it('should handle "SELECT * FROM testTable LIMIT 5,6; |"', function() {
+          assertAutoComplete({
+            beforeCursor: 'SELECT * FROM testTable LIMIT 5,6; ',
+            afterCursor: '',
+            dialect: 'hive',
+            noErrors: true,
+            containsKeywords: ['SELECT'],
+            expectedResult: {
+              lowerCase: false
+            }
+          });
+        });
+
         it('should not suggest anything for "SELECT COUNT(*) AS boo FROM testTable GROUP BY baa LIMIT |"', function() {
           assertAutoComplete({
             beforeCursor: 'SELECT COUNT(*) AS boo FROM testTable GROUP BY baa LIMIT ',

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


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


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