浏览代码

HUE-1970 [impala] COMPUTE STATS table_name

Added to the autocomplete and highlighting
Enrico Berti 11 年之前
父节点
当前提交
8746f4b

+ 1 - 1
apps/beeswax/src/beeswax/templates/execute.mako

@@ -1290,7 +1290,7 @@ $(document).ready(function () {
         var _after = (_afterArr.length > 0)?_afterArr[0].replace(/;+$/, ""):"";
         CodeMirror.possibleTable = false;
         CodeMirror.tableFieldMagic = false;
-        if ((_before.toUpperCase().indexOf(" FROM ") > -1 || _before.toUpperCase().indexOf(" TABLE ") > -1) && _before.toUpperCase().indexOf(" ON ") == -1 && _before.toUpperCase().indexOf(" WHERE ") == -1 ||
+        if ((_before.toUpperCase().indexOf(" FROM ") > -1 || _before.toUpperCase().indexOf(" TABLE ") > -1 || _before.toUpperCase().indexOf(" STATS ") > -1) && _before.toUpperCase().indexOf(" ON ") == -1 && _before.toUpperCase().indexOf(" WHERE ") == -1 ||
             _before.toUpperCase().indexOf("REFRESH") > -1 || _before.toUpperCase().indexOf("METADATA") > -1 || _before.toUpperCase().indexOf("DESCRIBE") > -1) {
           CodeMirror.possibleTable = true;
         }

+ 1 - 1
desktop/core/static/js/codemirror-hql.js

@@ -296,7 +296,7 @@ CodeMirror.defineMode("sql", function (config, parserConfig) {
 
   CodeMirror.defineMIME("text/x-impalaql", {
     name: "sql",
-    keywords: set("all and as by case comment create database databases delimited describe distinct drop exists explain external fields format from group having if insert into join like limit lines location not or order overwrite partitioned refresh row schema schemas select show stored table tables terminated union use when where invalidate metadata"),
+    keywords: set("all and as by case comment create database databases delimited describe distinct drop exists explain external fields format from group having if insert into join like limit lines location not or order overwrite partitioned refresh row schema schemas select show stored table tables terminated union use when where invalidate metadata compute stats"),
     builtin: set("tinyint smallint int bigint boolean float double string timestamp parquetfile sequencefile textfile rcfile"),
     functions: set("abs acos ascii asin atan avg bin cast ceil ceiling coalesce concat concat_ws count conv cos date_add date_sub datediff day dayname dayofmonth dayofweek degrees e exp find_in_set floor fnv_hash from_unixtime from_utc_timestamp greatest group_concat hex hour if initcap instr isnull lcase least length ln locate log log10 log2 lower lpad ltrim max min minute month ndv negative now nvl parse_url pi pmod positive pow power quotient radians rand regexp_extract repeat reverse round rpad rtrim second sign sin space sqrt substr substring sum tan to_date to_utc_timestamp translate trim ucase unhex unix_timestamp upper user weekofyear year"),
     atoms: set("false true null"),

+ 1 - 1
desktop/core/static/js/codemirror-isql-hint.js

@@ -68,7 +68,7 @@
     });
   };
 
-  var impalaSQLKeywords = "ALL AND AS BY CASE COMMENT CREATE DATABASE DATABASES DELIMITED DESCRIBE DISTINCT DROP EXISTS EXPLAIN EXTERNAL FIELDS FORMAT FROM GROUP HAVING IF INSERT INTO JOIN LIKE LIMIT LINES LOCATION NOT OR ORDER OVERWRITE PARTITIONED REFRESH ROW SCHEMA SCHEMAS SELECT SHOW STORED TABLE TABLES TERMINATED UNION USE WHEN WHERE INVALIDATE METADATA";
+  var impalaSQLKeywords = "ALL AND AS BY CASE COMMENT CREATE DATABASE DATABASES DELIMITED DESCRIBE DISTINCT DROP EXISTS EXPLAIN EXTERNAL FIELDS FORMAT FROM GROUP HAVING IF INSERT INTO JOIN LIKE LIMIT LINES LOCATION NOT OR ORDER OVERWRITE PARTITIONED REFRESH ROW SCHEMA SCHEMAS SELECT SHOW STORED TABLE TABLES TERMINATED UNION USE WHEN WHERE INVALIDATE METADATA COMPUTE STATS";
   var impalaSQLKeywordsU = impalaSQLKeywords.split(" ");
   var impalaSQLKeywordsL = impalaSQLKeywords.toLowerCase().split(" ");