浏览代码

HUE-5777 [editor] current_timestamp is missing () in autocomplete

Hive don't mind the ()
Impala requires the ()
current_date is only for Hive
Romain Rigaux 8 年之前
父节点
当前提交
bf047c3

+ 2 - 2
desktop/core/src/desktop/static/desktop/js/sqlAutocompleter3.js

@@ -469,7 +469,7 @@ var SqlAutocompleter3 = (function () {
           Object.keys(functionsToSuggest).forEach(function (name) {
             functionSuggestions.push({
               category: CATEGORIES.UDF,
-              value: name === 'current_date' || name === 'current_timestamp' ? name : name + '()',
+              value: name + '()',
               meta: functionsToSuggest[name].returnTypes.join('|'),
               weightAdjust: functionsToSuggest[name].returnTypes.filter(function (otherType) {
                   return otherType === colRef.type.toUpperCase();
@@ -489,7 +489,7 @@ var SqlAutocompleter3 = (function () {
         Object.keys(functionsToSuggest).forEach(function (name) {
           functionSuggestions.push({
             category: CATEGORIES.UDF,
-            value: name === 'current_date' || name === 'current_timestamp' ? name : name + '()',
+            value: name + '()',
             meta: functionsToSuggest[name].returnTypes.join('|'),
             weightAdjust: functionsToSuggest[name].returnTypes.filter(function (otherType) {
               return otherType === types[0].toUpperCase();

+ 2 - 2
desktop/core/src/desktop/static/desktop/js/sqlFunctions.js

@@ -1028,7 +1028,7 @@ var SqlFunctions = (function () {
       current_timestamp: {
         returnTypes: ['TIMESTAMP'],
         arguments: [],
-        signature: 'current_timestamp',
+        signature: 'current_timestamp()',
         description: 'Returns the current timestamp at the start of query evaluation (as of Hive 1.2.0). All calls of current_timestamp within the same query return the same value.'
       },
       datediff: {
@@ -2523,7 +2523,7 @@ var SqlFunctions = (function () {
     var functionsToSuggest = getFunctionsWithReturnTypes(dialect, returnTypes, includeAggregate, includeAnalytic);
     Object.keys(functionsToSuggest).forEach(function (name) {
       completions.push({
-        value: name === 'current_date' || name === 'current_timestamp' ? name : name + '()',
+        value: name + '()',
         meta: functionsToSuggest[name].returnTypes.join('|'),
         weight: returnTypes.filter(function (type) {
           return functionsToSuggest[name].returnTypes.filter(