Browse Source

HUE-1649 [beeswax] Autocomplete error

Fixed case for WHERE on new lines and added keywords for the end of queries
Enrico Berti 12 years ago
parent
commit
6ed1960

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

@@ -815,7 +815,7 @@ ${layout.menubar(section='query')}
       function fieldsAutocomplete(cm) {
       function fieldsAutocomplete(cm) {
         CodeMirror.possibleSoloField = true;
         CodeMirror.possibleSoloField = true;
         try {
         try {
-          var _possibleTables = $.trim(codeMirror.getValue().substr(codeMirror.getValue().toUpperCase().indexOf("FROM ") + 4)).split(" ");
+          var _possibleTables = $.trim(codeMirror.getValue(" ").substr(codeMirror.getValue().toUpperCase().indexOf("FROM ") + 4)).split(" ");
           var _foundTable = "";
           var _foundTable = "";
           for (var i = 0; i < _possibleTables.length; i++) {
           for (var i = 0; i < _possibleTables.length; i++) {
             if ($.trim(_possibleTables[i]) != "" && _foundTable == "") {
             if ($.trim(_possibleTables[i]) != "" && _foundTable == "") {

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

@@ -72,7 +72,7 @@
   var hiveQLKeywordsU = hiveQLKeywords.split(" ");
   var hiveQLKeywordsU = hiveQLKeywords.split(" ");
   var hiveQLKeywordsL = hiveQLKeywords.toLowerCase().split(" ");
   var hiveQLKeywordsL = hiveQLKeywords.toLowerCase().split(" ");
 
 
-  var hiveQLKeywordsAfterTables = "JOIN ON WHERE";
+  var hiveQLKeywordsAfterTables = "JOIN ON WHERE ORDER BY ASC DESC LIMIT";
   var hiveQLKeywordsAfterTablesU = hiveQLKeywordsAfterTables.split(" ");
   var hiveQLKeywordsAfterTablesU = hiveQLKeywordsAfterTables.split(" ");
   var hiveQLKeywordsAfterTablesL = hiveQLKeywordsAfterTables.toLowerCase().split(" ");
   var hiveQLKeywordsAfterTablesL = hiveQLKeywordsAfterTables.toLowerCase().split(" ");