Эх сурвалжийг харах

[editor] Enable the syntax checker for SparkSQL

Johan Åhlén 3 жил өмнө
parent
commit
676d5f4d78

+ 4 - 1
desktop/core/src/desktop/js/apps/editor/components/aceEditor/AceLocationHandler.ts

@@ -60,6 +60,7 @@ export const GET_ACTIVE_LOCATIONS_EVENT = 'get.active.editor.locations';
 
 
 const HIVE_DIALECT = 'hive';
 const HIVE_DIALECT = 'hive';
 const IMPALA_DIALECT = 'impala';
 const IMPALA_DIALECT = 'impala';
+const SPARKSQL_DIALECT = 'sparksql';
 
 
 const STATEMENT_COUNT_AROUND_ACTIVE = 10;
 const STATEMENT_COUNT_AROUND_ACTIVE = 10;
 
 
@@ -776,7 +777,9 @@ export default class AceLocationHandler implements Disposable {
   checkForSyntaxErrors(statementLocation: ParsedLocation, cursorPosition: Ace.Position): void {
   checkForSyntaxErrors(statementLocation: ParsedLocation, cursorPosition: Ace.Position): void {
     if (
     if (
       this.sqlSyntaxWorkerSub &&
       this.sqlSyntaxWorkerSub &&
-      (this.getDialect() === IMPALA_DIALECT || this.getDialect() === HIVE_DIALECT)
+      (this.getDialect() === IMPALA_DIALECT ||
+        this.getDialect() === HIVE_DIALECT ||
+        this.getDialect() === SPARKSQL_DIALECT)
     ) {
     ) {
       const AceRange = ace.require('ace/range').Range;
       const AceRange = ace.require('ace/range').Range;
       const editorChangeTime = this.editor.lastChangeTime;
       const editorChangeTime = this.editor.lastChangeTime;

+ 1 - 0
desktop/core/src/desktop/js/apps/editor/snippet.js

@@ -77,6 +77,7 @@ export const DIALECT = {
   mapreduce: 'mapreduce',
   mapreduce: 'mapreduce',
   pig: 'pig',
   pig: 'pig',
   distcp: 'distcp',
   distcp: 'distcp',
+  sparksql: 'sparksql',
   sqoop1: 'sqoop1'
   sqoop1: 'sqoop1'
 };
 };
 
 

+ 3 - 1
desktop/core/src/desktop/js/ko/bindings/ace/aceLocationHandler.js

@@ -712,7 +712,9 @@ class AceLocationHandler {
     const self = this;
     const self = this;
     if (
     if (
       self.sqlSyntaxWorkerSub !== null &&
       self.sqlSyntaxWorkerSub !== null &&
-      (self.dialect() === DIALECT.impala || self.dialect() === DIALECT.hive)
+      (self.dialect() === DIALECT.impala ||
+        self.dialect() === DIALECT.hive ||
+        self.dialect() === DIALECT.sparksql)
     ) {
     ) {
       const AceRange = ace.require('ace/range').Range;
       const AceRange = ace.require('ace/range').Range;
       const editorChangeTime = self.editor.lastChangeTime;
       const editorChangeTime = self.editor.lastChangeTime;