Răsfoiți Sursa

[parser] Handle partition columns only in Impala insert statement (#1231)

* Fix issue when there is  only partition column in parittion clause

* Added testcase and generated grammar

* Fix lint issue

Co-authored-by: Romain Rigaux <romain.rigaux@gmail.com>
sachinunravel 5 ani în urmă
părinte
comite
181e5afdb8

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

@@ -908,6 +908,7 @@ PartitionSpecList_EDIT
 
 PartitionExpression
  : ColumnIdentifier '=' ValueExpression
+ | ColumnIdentifier
  ;
 
 PartitionExpression_EDIT

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


+ 12 - 0
desktop/core/src/desktop/js/parse/sql/impala/test/impalaAutocompleteParser.Insert.test.js

@@ -471,5 +471,17 @@ describe('impalaAutocompleteParser.js INSERT statements', () => {
         }
       });
     });
+
+    it('should handle "INSERT INTO TABLE boo.t1(a, b) PARTITION (a) VALUES (1, 2);|"', () => {
+      assertAutoComplete({
+        beforeCursor: 'INSERT INTO TABLE boo.t1 (a, b) PARTITION (a) VALUES (1, 2);',
+        afterCursor: '',
+        noErrors: true,
+        containsKeywords: ['SELECT'],
+        expectedResult: {
+          lowerCase: false
+        }
+      });
+    });
   });
 });

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