Răsfoiți Sursa

HUE-9118 [impala] INTEGER is introduced as a synonym for INT

Romain 5 ani în urmă
părinte
comite
b095cb2486

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

@@ -181,6 +181,7 @@
 'INSENSITIVE'                              { return 'INSENSITIVE'; }
 'INSERT'                                   { parser.determineCase(yytext); parser.addStatementTypeLocation('INSERT', yylloc); return 'INSERT'; }
 'INT'                                      { return 'INT'; }
+'INTEGER'                                  { return 'INTEGER'; }
 'INTERMEDIATE'                             { return 'INTERMEDIATE'; }
 'INTERSECT'                                { return 'INTERSECT'; }
 'INTERSECTION'                             { return 'INTERSECTION'; }

+ 2 - 0
desktop/core/src/desktop/js/parse/jison/sql/impala/sql_main.jison

@@ -291,6 +291,7 @@ NonStartingToken
  | 'INPATH'
  | 'INSENSITIVE'
  | 'INT'
+ | 'INTEGER'
  | 'INTERMEDIATE'
  | 'INTERSECT'
  | 'INTERSECTION'
@@ -1187,6 +1188,7 @@ PrimitiveType
  : 'TINYINT'
  | 'SMALLINT'
  | 'INT'
+ | 'INTEGER'
  | 'BIGINT'
  | 'BOOLEAN'
  | 'FLOAT'

Fișier diff suprimat deoarece este prea mare
+ 0 - 0
desktop/core/src/desktop/js/parse/sql/impala/impalaAutocompleteParser.js


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
desktop/core/src/desktop/js/parse/sql/impala/impalaSyntaxParser.js


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

@@ -248,6 +248,7 @@ const initSqlParser = function(parser) {
       'DOUBLE',
       'FLOAT',
       'INT',
+      'INTEGER',
       'REAL',
       'SMALLINT',
       'TIMESTAMP',

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

@@ -553,6 +553,17 @@ describe('impalaAutocompleteParser.js CREATE statements', () => {
       });
     });
 
+    it('should handle for "CREATE TABLE foo (id INTEGER);|"', () => {
+      assertAutoComplete({
+        beforeCursor: 'CREATE TABLE foo (id INTEGER);',
+        afterCursor: '',
+        containsKeywords: ['SELECT'],
+        expectedResult: {
+          lowerCase: false
+        }
+      });
+    });
+
     it('should suggest keywords for "CREATE TABLE foo (id |"', () => {
       assertAutoComplete({
         beforeCursor: 'CREATE TABLE foo (id ',

+ 4 - 4
desktop/core/src/desktop/js/parse/sql/impala/test/impalaAutocompleteParser.Select.test.js

@@ -2183,7 +2183,7 @@ describe('impalaAutocompleteParser.js SELECT statements', () => {
       assertAutoComplete({
         beforeCursor: 'select cast(bla as ',
         afterCursor: '',
-        containsKeywords: ['INT', 'STRING'],
+        containsKeywords: ['INT', 'INTEGER', 'STRING'],
         expectedResult: {
           lowerCase: true
         }
@@ -2194,7 +2194,7 @@ describe('impalaAutocompleteParser.js SELECT statements', () => {
       assertAutoComplete({
         beforeCursor: 'SELECT CAST(bla AS ',
         afterCursor: ' FROM bar;',
-        containsKeywords: ['INT', 'STRING'],
+        containsKeywords: ['INT', 'INTEGER', 'STRING'],
         expectedResult: {
           lowerCase: false
         }
@@ -2205,7 +2205,7 @@ describe('impalaAutocompleteParser.js SELECT statements', () => {
       assertAutoComplete({
         beforeCursor: 'SELECT CAST(bla AS ST',
         afterCursor: ') FROM bar;',
-        containsKeywords: ['INT', 'STRING'],
+        containsKeywords: ['INT', 'INTEGER', 'STRING'],
         expectedResult: {
           lowerCase: false
         }
@@ -2216,7 +2216,7 @@ describe('impalaAutocompleteParser.js SELECT statements', () => {
       assertAutoComplete({
         beforeCursor: 'SELECT CAST(AS ',
         afterCursor: '',
-        containsKeywords: ['INT', 'STRING'],
+        containsKeywords: ['INT', 'INTEGER', 'STRING'],
         expectedResult: {
           lowerCase: false
         }

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff