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

HUE-5693 [editor] Set autocompletion argument types for avg() to numeric for Impala

Johan Ahlen 8 жил өмнө
parent
commit
8734f5f005

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

@@ -859,7 +859,7 @@ var SqlFunctions = (function () {
       },
       avg: {
         returnTypes: ['DOUBLE'],
-        arguments: [[{type: 'T'}]],
+        arguments: [[{type: 'NUMBER'}]],
         signature: 'avg([DISTINCT|ALL] col)',
         description: 'An aggregate function that returns the average value from a set of numbers. Its single argument can be numeric column, or the numeric result of a function or expression applied to the column value. Rows with a NULL value for the specified column are ignored. If the table is empty, or all the values supplied to AVG are NULL, AVG returns NULL.'
       },

+ 1 - 1
desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecSelect.js

@@ -1767,7 +1767,7 @@
           { name: 'APPX_MEDIAN', dialect: 'impala', containsKeywords: ['ALL', 'DISTINCT'] },
           { name: 'AVG', dialect: 'generic', containsKeywords: ['DISTINCT'] },
           { name: 'AVG', dialect: 'hive', containsKeywords: ['DISTINCT'] },
-          { name: 'AVG', dialect: 'impala', containsKeywords: ['ALL', 'DISTINCT'] },
+          { name: 'AVG', dialect: 'impala', types: ['NUMBER'], containsKeywords: ['ALL', 'DISTINCT'] },
           { name: 'collect_set', dialect: 'hive', containsKeywords: ['DISTINCT'] },
           { name: 'COLLECT_LIST', dialect: 'hive', containsKeywords: ['DISTINCT'] },
           { name: 'COUNT', dialect: 'generic', containsKeywords: ['*', 'DISTINCT'] },