Browse Source

[editor] Add database, table and column verification for Spark SQL

With this change we'll also check whether SQL entities exist or not in the Spark SQL syntax checker.
Johan Åhlén 3 years ago
parent
commit
8911a7c95c

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

@@ -1412,7 +1412,11 @@ export default class AceLocationHandler implements Disposable {
           }
         });
 
-        if (this.getDialect() === IMPALA_DIALECT || this.getDialect() === HIVE_DIALECT) {
+        if (
+          this.getDialect() === IMPALA_DIALECT ||
+          this.getDialect() === HIVE_DIALECT ||
+          this.getDialect() === SPARKSQL_DIALECT
+        ) {
           this.verifyExists(tokensToVerify, e.data.activeStatementLocations);
         }
         huePubSub.publish('editor.active.locations', lastKnownLocations);

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

@@ -1330,7 +1330,11 @@ class AceLocationHandler {
         }
       });
 
-      if (self.dialect() === DIALECT.impala || self.dialect() === DIALECT.hive) {
+      if (
+        self.dialect() === DIALECT.impala ||
+        self.dialect() === DIALECT.hive ||
+        self.dialect() === DIALECT.sparksql
+      ) {
         self.verifyExists(tokensToVerify, e.data.activeStatementLocations);
       }
       huePubSub.publish('editor.active.locations', lastKnownLocations);