Selaa lähdekoodia

HUE-7738 [editor] Remove argument type resolution from sqlFunctions

Johan Ahlen 5 vuotta sitten
vanhempi
commit
23592fad4c

+ 127 - 0
desktop/core/src/desktop/js/sql/reference/sqlReferenceRepository.test.js

@@ -0,0 +1,127 @@
+// Licensed to Cloudera, Inc. under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  Cloudera, Inc. licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+import { getArgumentTypes } from './sqlReferenceRepository';
+
+describe('sqlReferenceRepository.js', () => {
+  const hiveConn = { dialect: 'hive' };
+  const impalaConn = { dialect: 'impala' };
+
+  jest.mock('sql/reference/impala/udfReference', () => ({
+    UDF_CATEGORIES: [
+      {
+        functions: {
+          cos: {
+            returnTypes: ['DOUBLE'],
+            arguments: [[{ type: 'DOUBLE' }]],
+            signature: 'cos(DOUBLE a)',
+            draggable: 'cos()',
+            description: ''
+          },
+          concat: {
+            returnTypes: ['STRING'],
+            arguments: [[{ type: 'STRING' }], [{ type: 'STRING', multiple: true }]],
+            signature: 'concat(STRING a, STRING b...)',
+            draggable: 'concat()',
+            description: ''
+          },
+          strleft: {
+            returnTypes: ['STRING'],
+            arguments: [[{ type: 'STRING' }], [{ type: 'INT' }]],
+            signature: 'strleft(STRING a, INT num_chars)',
+            draggable: 'strleft()',
+            description: ''
+          }
+        }
+      }
+    ]
+  }));
+
+  jest.mock('sql/reference/hive/udfReference', () => ({
+    UDF_CATEGORIES: [
+      {
+        functions: {
+          cos: {
+            returnTypes: ['DOUBLE'],
+            arguments: [[{ type: 'DECIMAL' }, { type: 'DOUBLE' }]],
+            signature: 'cos(DECIMAL|DOUBLE a)',
+            draggable: 'cos()',
+            description: ''
+          },
+          concat: {
+            returnTypes: ['STRING'],
+            arguments: [[{ type: 'STRING', multiple: true }, { type: 'BINARY', multiple: true }]],
+            signature: 'concat(STRING|BINARY a, STRING|BINARY b...)',
+            draggable: 'concat()',
+            description: ''
+          },
+          reflect: {
+            returnTypes: ['T'],
+            arguments: [
+              [{ type: 'STRING' }],
+              [{ type: 'STRING' }],
+              [{ type: 'T', multiple: true, optional: true }]
+            ],
+            signature: 'reflect(class, method[, arg1[, arg2..]])',
+            draggable: 'reflect()',
+            description: ''
+          }
+        }
+      }
+    ]
+  }));
+
+  it('should give the expected argument types at a specific position', async () => {
+    expect(await getArgumentTypes(hiveConn, 'cos', 1)).toEqual(['DECIMAL', 'DOUBLE']);
+    expect(await getArgumentTypes(hiveConn, 'cos', 2)).toEqual([]);
+    expect(await getArgumentTypes(impalaConn, 'cos', 1)).toEqual(['DOUBLE']);
+    expect(await getArgumentTypes(impalaConn, 'cos', 2)).toEqual([]);
+
+    expect(await getArgumentTypes(hiveConn, 'concat', 10)).toEqual(['BINARY', 'STRING']);
+    expect(await getArgumentTypes(impalaConn, 'concat', 10)).toEqual(['STRING']);
+  });
+
+  it('should handle functions with different type of arguments', async () => {
+    expect(await getArgumentTypes(hiveConn, 'reflect', 1)).toEqual(['STRING']);
+    expect(await getArgumentTypes(hiveConn, 'reflect', 2)).toEqual(['STRING']);
+    expect(await getArgumentTypes(hiveConn, 'reflect', 3)).toEqual(['T']);
+    expect(await getArgumentTypes(hiveConn, 'reflect', 200)).toEqual(['T']);
+  });
+
+  it('should handle functions with an infinite amount of arguments', async () => {
+    expect(await getArgumentTypes(impalaConn, 'greatest', 1)).toEqual(['T']);
+    expect(await getArgumentTypes(impalaConn, 'greatest', 200)).toEqual(['T']);
+
+    expect(await getArgumentTypes(hiveConn, 'strleft', 1)).toEqual(['T']);
+    expect(await getArgumentTypes(hiveConn, 'strleft', 2)).toEqual(['T']);
+    expect(await getArgumentTypes(hiveConn, 'strleft', 3)).toEqual(['T']);
+    expect(await getArgumentTypes(hiveConn, 'strleft', 200)).toEqual(['T']);
+  });
+
+  it('should not return types for arguments out of bounds', async () => {
+    expect(await getArgumentTypes(impalaConn, 'strleft', 1)).toEqual(['STRING']);
+    expect(await getArgumentTypes(impalaConn, 'strleft', 2)).toEqual(['INT']);
+    expect(await getArgumentTypes(impalaConn, 'strleft', 3)).toEqual([]);
+    expect(await getArgumentTypes(impalaConn, 'strleft', 200)).toEqual([]);
+  });
+
+  it("should return T for any argument if the udf isn't found", async () => {
+    expect(await getArgumentTypes(hiveConn, 'blabla', 2)).toEqual(['T']);
+    expect(await getArgumentTypes(hiveConn, 'blabla', 200)).toEqual(['T']);
+    expect(await getArgumentTypes(impalaConn, 'blabla', 2)).toEqual(['T']);
+    expect(await getArgumentTypes(impalaConn, 'blabla', 200)).toEqual(['T']);
+  });
+});

+ 0 - 652
desktop/core/src/desktop/js/sql/sqlFunctions.js

@@ -4165,627 +4165,6 @@ const SqlFunctions = (function() {
     ]
   };
 
-  const typeImplicitConversion = {
-    hive: {
-      BOOLEAN: {
-        BOOLEAN: true,
-        TIMESTAMP: false,
-        DATE: false,
-        BINARY: false,
-        TINYINT: false,
-        SMALLINT: false,
-        INT: false,
-        INTEGER: false,
-        BIGINT: false,
-        FLOAT: false,
-        DOUBLE: false,
-        DECIMAL: false,
-        NUMBER: false,
-        STRING: false,
-        CHAR: false,
-        VARCHAR: false,
-        T: true
-      },
-      TIMESTAMP: {
-        BOOLEAN: false,
-        TIMESTAMP: true,
-        DATE: false,
-        BINARY: false,
-        TINYINT: false,
-        SMALLINT: false,
-        INT: false,
-        INTEGER: false,
-        BIGINT: false,
-        FLOAT: false,
-        DOUBLE: false,
-        DECIMAL: false,
-        NUMBER: false,
-        STRING: false,
-        CHAR: false,
-        VARCHAR: false,
-        T: true
-      },
-      DATE: {
-        BOOLEAN: false,
-        TIMESTAMP: false,
-        DATE: true,
-        BINARY: false,
-        TINYINT: false,
-        SMALLINT: false,
-        INT: false,
-        INTEGER: false,
-        BIGINT: false,
-        FLOAT: false,
-        DOUBLE: false,
-        DECIMAL: false,
-        NUMBER: false,
-        STRING: false,
-        CHAR: false,
-        VARCHAR: false,
-        T: true
-      },
-      BINARY: {
-        BOOLEAN: false,
-        TIMESTAMP: false,
-        DATE: false,
-        BINARY: true,
-        TINYINT: false,
-        SMALLINT: false,
-        INT: false,
-        INTEGER: false,
-        BIGINT: false,
-        FLOAT: false,
-        DOUBLE: false,
-        DECIMAL: false,
-        NUMBER: false,
-        STRING: false,
-        CHAR: false,
-        VARCHAR: false,
-        T: true
-      },
-      TINYINT: {
-        BOOLEAN: false,
-        TIMESTAMP: false,
-        DATE: false,
-        BINARY: false,
-        TINYINT: true,
-        SMALLINT: false,
-        INT: false,
-        INTEGER: false,
-        BIGINT: false,
-        FLOAT: false,
-        DOUBLE: false,
-        DECIMAL: false,
-        NUMBER: true,
-        STRING: false,
-        CHAR: false,
-        VARCHAR: false,
-        T: true
-      },
-      SMALLINT: {
-        BOOLEAN: false,
-        TIMESTAMP: false,
-        DATE: false,
-        BINARY: false,
-        TINYINT: true,
-        SMALLINT: true,
-        INT: false,
-        INTEGER: false,
-        BIGINT: false,
-        FLOAT: false,
-        DOUBLE: false,
-        DECIMAL: false,
-        NUMBER: true,
-        STRING: false,
-        CHAR: false,
-        VARCHAR: false,
-        T: true
-      },
-      INT: {
-        BOOLEAN: false,
-        TIMESTAMP: false,
-        DATE: false,
-        BINARY: false,
-        TINYINT: true,
-        SMALLINT: true,
-        INT: true,
-        INTEGER: true,
-        BIGINT: false,
-        FLOAT: false,
-        DOUBLE: false,
-        DECIMAL: false,
-        NUMBER: true,
-        STRING: false,
-        CHAR: false,
-        VARCHAR: false,
-        T: true
-      },
-      BIGINT: {
-        BOOLEAN: false,
-        TIMESTAMP: false,
-        DATE: false,
-        BINARY: false,
-        TINYINT: true,
-        SMALLINT: true,
-        INT: true,
-        INTEGER: true,
-        BIGINT: true,
-        FLOAT: false,
-        DOUBLE: false,
-        DECIMAL: false,
-        NUMBER: true,
-        STRING: false,
-        CHAR: false,
-        VARCHAR: false,
-        T: true
-      },
-      FLOAT: {
-        BOOLEAN: false,
-        TIMESTAMP: false,
-        DATE: false,
-        BINARY: false,
-        TINYINT: true,
-        SMALLINT: true,
-        INT: true,
-        INTEGER: true,
-        BIGINT: true,
-        FLOAT: true,
-        DOUBLE: false,
-        DECIMAL: false,
-        NUMBER: true,
-        STRING: false,
-        CHAR: false,
-        VARCHAR: false,
-        T: true
-      },
-      DOUBLE: {
-        BOOLEAN: false,
-        TIMESTAMP: false,
-        DATE: false,
-        BINARY: false,
-        TINYINT: true,
-        SMALLINT: true,
-        INT: true,
-        INTEGER: true,
-        BIGINT: true,
-        FLOAT: true,
-        DOUBLE: true,
-        DECIMAL: false,
-        NUMBER: true,
-        STRING: true,
-        CHAR: true,
-        VARCHAR: true,
-        T: true
-      },
-      DECIMAL: {
-        BOOLEAN: false,
-        TIMESTAMP: false,
-        DATE: false,
-        BINARY: false,
-        TINYINT: true,
-        SMALLINT: true,
-        INT: true,
-        INTEGER: true,
-        BIGINT: true,
-        FLOAT: true,
-        DOUBLE: true,
-        DECIMAL: true,
-        NUMBER: true,
-        STRING: true,
-        CHAR: true,
-        VARCHAR: true,
-        T: true
-      },
-      NUMBER: {
-        BOOLEAN: false,
-        TIMESTAMP: false,
-        DATE: false,
-        BINARY: false,
-        TINYINT: true,
-        SMALLINT: true,
-        INT: true,
-        INTEGER: true,
-        BIGINT: true,
-        FLOAT: true,
-        DOUBLE: true,
-        DECIMAL: true,
-        NUMBER: true,
-        STRING: true,
-        CHAR: true,
-        VARCHAR: true,
-        T: true
-      },
-      STRING: {
-        BOOLEAN: false,
-        TIMESTAMP: true,
-        DATE: true,
-        BINARY: false,
-        TINYINT: true,
-        SMALLINT: true,
-        INT: true,
-        INTEGER: true,
-        BIGINT: true,
-        FLOAT: true,
-        DOUBLE: true,
-        DECIMAL: true,
-        NUMBER: true,
-        STRING: true,
-        CHAR: true,
-        VARCHAR: true,
-        T: true
-      },
-      CHAR: {
-        BOOLEAN: false,
-        TIMESTAMP: true,
-        DATE: true,
-        BINARY: false,
-        TINYINT: true,
-        SMALLINT: true,
-        INT: true,
-        INTEGER: true,
-        BIGINT: true,
-        FLOAT: true,
-        DOUBLE: true,
-        DECIMAL: true,
-        NUMBER: true,
-        STRING: true,
-        CHAR: true,
-        VARCHAR: true,
-        T: true
-      },
-      VARCHAR: {
-        BOOLEAN: false,
-        TIMESTAMP: true,
-        DATE: true,
-        BINARY: false,
-        TINYINT: true,
-        SMALLINT: true,
-        INT: true,
-        INTEGER: true,
-        BIGINT: true,
-        FLOAT: true,
-        DOUBLE: true,
-        DECIMAL: true,
-        NUMBER: true,
-        STRING: true,
-        CHAR: true,
-        VARCHAR: true,
-        T: true
-      },
-      T: {
-        BOOLEAN: true,
-        TIMESTAMP: true,
-        DATE: true,
-        BINARY: true,
-        TINYINT: true,
-        SMALLINT: true,
-        INT: true,
-        INTEGER: true,
-        BIGINT: true,
-        FLOAT: true,
-        DOUBLE: true,
-        DECIMAL: true,
-        NUMBER: true,
-        STRING: true,
-        CHAR: true,
-        VARCHAR: true,
-        T: true
-      }
-    },
-    impala: {
-      BOOLEAN: {
-        BOOLEAN: true,
-        TIMESTAMP: false,
-        TINYINT: false,
-        SMALLINT: false,
-        INT: false,
-        BIGINT: false,
-        DOUBLE: false,
-        REAL: false,
-        DECIMAL: false,
-        FLOAT: false,
-        NUMBER: false,
-        CHAR: false,
-        VARCHAR: false,
-        STRING: false,
-        T: true
-      },
-      TIMESTAMP: {
-        BOOLEAN: false,
-        TIMESTAMP: true,
-        TINYINT: false,
-        SMALLINT: false,
-        INT: false,
-        BIGINT: false,
-        DOUBLE: false,
-        REAL: false,
-        DECIMAL: false,
-        FLOAT: false,
-        NUMBER: false,
-        CHAR: false,
-        VARCHAR: false,
-        STRING: true,
-        T: true
-      },
-      TINYINT: {
-        BOOLEAN: false,
-        TIMESTAMP: false,
-        TINYINT: true,
-        SMALLINT: false,
-        INT: false,
-        BIGINT: false,
-        DOUBLE: false,
-        REAL: false,
-        DECIMAL: false,
-        FLOAT: false,
-        NUMBER: true,
-        CHAR: false,
-        VARCHAR: false,
-        STRING: false,
-        T: true
-      },
-      SMALLINT: {
-        BOOLEAN: false,
-        TIMESTAMP: false,
-        TINYINT: true,
-        SMALLINT: true,
-        INT: false,
-        BIGINT: false,
-        DOUBLE: false,
-        REAL: false,
-        DECIMAL: false,
-        FLOAT: false,
-        NUMBER: true,
-        CHAR: false,
-        VARCHAR: false,
-        STRING: false,
-        T: true
-      },
-      INT: {
-        BOOLEAN: false,
-        TIMESTAMP: false,
-        TINYINT: true,
-        SMALLINT: true,
-        INT: true,
-        BIGINT: false,
-        DOUBLE: false,
-        REAL: false,
-        DECIMAL: false,
-        FLOAT: false,
-        NUMBER: true,
-        CHAR: false,
-        VARCHAR: false,
-        STRING: false,
-        T: true
-      },
-      BIGINT: {
-        BOOLEAN: false,
-        TIMESTAMP: false,
-        TINYINT: true,
-        SMALLINT: true,
-        INT: true,
-        BIGINT: true,
-        DOUBLE: false,
-        REAL: false,
-        DECIMAL: false,
-        FLOAT: false,
-        NUMBER: true,
-        CHAR: false,
-        VARCHAR: false,
-        STRING: false,
-        T: true
-      },
-      DOUBLE: {
-        BOOLEAN: false,
-        TIMESTAMP: false,
-        TINYINT: true,
-        SMALLINT: true,
-        INT: true,
-        BIGINT: true,
-        DOUBLE: true,
-        REAL: true,
-        DECIMAL: false,
-        FLOAT: true,
-        NUMBER: true,
-        CHAR: false,
-        VARCHAR: false,
-        STRING: false,
-        T: true
-      },
-      REAL: {
-        BOOLEAN: false,
-        TIMESTAMP: false,
-        TINYINT: true,
-        SMALLINT: true,
-        INT: true,
-        BIGINT: true,
-        DOUBLE: true,
-        REAL: true,
-        DECIMAL: false,
-        FLOAT: true,
-        NUMBER: true,
-        CHAR: false,
-        VARCHAR: false,
-        STRING: false,
-        T: true
-      },
-      DECIMAL: {
-        BOOLEAN: false,
-        TIMESTAMP: false,
-        TINYINT: true,
-        SMALLINT: true,
-        INT: true,
-        BIGINT: true,
-        DOUBLE: true,
-        REAL: true,
-        DECIMAL: true,
-        FLOAT: true,
-        NUMBER: true,
-        CHAR: false,
-        VARCHAR: false,
-        STRING: false,
-        T: true
-      },
-      FLOAT: {
-        BOOLEAN: false,
-        TIMESTAMP: false,
-        TINYINT: true,
-        SMALLINT: true,
-        INT: true,
-        BIGINT: true,
-        DOUBLE: false,
-        REAL: false,
-        DECIMAL: false,
-        FLOAT: true,
-        NUMBER: true,
-        CHAR: false,
-        VARCHAR: false,
-        STRING: false,
-        T: true
-      },
-      NUMBER: {
-        BOOLEAN: false,
-        TIMESTAMP: false,
-        TINYINT: true,
-        SMALLINT: true,
-        INT: true,
-        BIGINT: true,
-        DOUBLE: true,
-        REAL: true,
-        DECIMAL: true,
-        FLOAT: true,
-        NUMBER: true,
-        CHAR: false,
-        VARCHAR: false,
-        STRING: false,
-        T: true
-      },
-      CHAR: {
-        BOOLEAN: false,
-        TIMESTAMP: false,
-        TINYINT: false,
-        SMALLINT: false,
-        INT: false,
-        BIGINT: false,
-        DOUBLE: false,
-        REAL: false,
-        DECIMAL: false,
-        FLOAT: false,
-        NUMBER: false,
-        CHAR: true,
-        VARCHAR: false,
-        STRING: false,
-        T: true
-      },
-      VARCHAR: {
-        BOOLEAN: false,
-        TIMESTAMP: false,
-        TINYINT: false,
-        SMALLINT: false,
-        INT: false,
-        BIGINT: false,
-        DOUBLE: false,
-        REAL: false,
-        DECIMAL: false,
-        FLOAT: false,
-        NUMBER: false,
-        CHAR: true,
-        VARCHAR: true,
-        STRING: false,
-        T: true
-      },
-      STRING: {
-        BOOLEAN: false,
-        TIMESTAMP: true,
-        TINYINT: false,
-        SMALLINT: false,
-        INT: false,
-        BIGINT: false,
-        DOUBLE: false,
-        REAL: false,
-        DECIMAL: false,
-        FLOAT: false,
-        NUMBER: false,
-        CHAR: true,
-        VARCHAR: false,
-        STRING: true,
-        T: true
-      },
-      T: {
-        BOOLEAN: true,
-        TIMESTAMP: true,
-        TINYINT: true,
-        SMALLINT: true,
-        INT: true,
-        BIGINT: true,
-        DOUBLE: true,
-        REAL: true,
-        DECIMAL: true,
-        FLOAT: true,
-        NUMBER: true,
-        CHAR: true,
-        VARCHAR: true,
-        STRING: true,
-        T: true
-      }
-    }
-  };
-
-  const stripPrecision = function(types) {
-    const result = [];
-    types.forEach(type => {
-      if (type.indexOf('(') > -1) {
-        result.push(type.substring(0, type.indexOf('(')));
-      } else {
-        result.push(type);
-      }
-    });
-    return result;
-  };
-
-  /**
-   * Matches types based on implicit conversion i.e. if you expect a BIGINT then INT is ok but not BOOLEAN etc.
-   *
-   * @param dialect
-   * @param expectedTypes
-   * @param actualRawTypes
-   * @returns {boolean}
-   */
-  const matchesType = function(dialect, expectedTypes, actualRawTypes) {
-    if (dialect !== 'hive') {
-      dialect = 'impala';
-    }
-    if (expectedTypes.length === 1 && expectedTypes[0] === 'T') {
-      return true;
-    }
-    const actualTypes = stripPrecision(actualRawTypes);
-    if (
-      actualTypes.indexOf('ARRAY') !== -1 ||
-      actualTypes.indexOf('MAP') !== -1 ||
-      actualTypes.indexOf('STRUCT') !== -1
-    ) {
-      return true;
-    }
-    for (let i = 0; i < expectedTypes.length; i++) {
-      for (let j = 0; j < actualTypes.length; j++) {
-        // To support future unknown types
-        if (
-          typeof typeImplicitConversion[dialect][expectedTypes[i]] === 'undefined' ||
-          typeof typeImplicitConversion[dialect][expectedTypes[i]][actualTypes[j]] == 'undefined'
-        ) {
-          return true;
-        }
-        if (
-          typeImplicitConversion[dialect][expectedTypes[i]] &&
-          typeImplicitConversion[dialect][expectedTypes[i]][actualTypes[j]]
-        ) {
-          return true;
-        }
-      }
-    }
-    return false;
-  };
-
   const findFunction = function(dialect, functionName) {
     return (
       BIT_FUNCTIONS[dialect][functionName] ||
@@ -4804,35 +4183,6 @@ const SqlFunctions = (function() {
     );
   };
 
-  const getArgumentTypes = function(dialect, functionName, argumentPosition) {
-    if (dialect !== 'hive' && dialect !== 'impala') {
-      return ['T'];
-    }
-    const foundFunction = findFunction(dialect, functionName);
-    if (!foundFunction) {
-      return ['T'];
-    }
-    const args = foundFunction.arguments;
-    if (argumentPosition > args.length) {
-      const multiples = args[args.length - 1].filter(type => {
-        return type.multiple;
-      });
-      if (multiples.length > 0) {
-        return multiples
-          .map(argument => {
-            return argument.type;
-          })
-          .sort();
-      }
-      return [];
-    }
-    return args[argumentPosition - 1]
-      .map(argument => {
-        return argument.type;
-      })
-      .sort();
-  };
-
   const getReturnTypes = function(dialect, functionName) {
     if (dialect !== 'hive' && dialect !== 'impala') {
       return ['T'];
@@ -4845,10 +4195,8 @@ const SqlFunctions = (function() {
   };
 
   return {
-    getArgumentTypes: getArgumentTypes,
     CATEGORIZED_FUNCTIONS: CATEGORIZED_FUNCTIONS,
     getReturnTypes: getReturnTypes,
-    matchesType: matchesType,
     findFunction: findFunction
   };
 })();

+ 0 - 73
desktop/core/src/desktop/js/sql/sqlFunctions.test.js

@@ -1,73 +0,0 @@
-// Licensed to Cloudera, Inc. under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  Cloudera, Inc. licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import { SqlFunctions } from './sqlFunctions';
-
-describe('sqlFunctions.js', () => {
-  it('should give the expected argument types at a specific position', () => {
-    expect(SqlFunctions.getArgumentTypes('hive', 'cos', 1)).toEqual(['DECIMAL', 'DOUBLE']);
-    expect(SqlFunctions.getArgumentTypes('hive', 'cos', 2)).toEqual([]);
-    expect(SqlFunctions.getArgumentTypes('impala', 'cos', 1)).toEqual(['DOUBLE']);
-    expect(SqlFunctions.getArgumentTypes('impala', 'cos', 2)).toEqual([]);
-
-    expect(SqlFunctions.getArgumentTypes('hive', 'greatest', 1)).toEqual(['T']);
-    expect(SqlFunctions.getArgumentTypes('hive', 'greatest', 200)).toEqual(['T']);
-    expect(SqlFunctions.getArgumentTypes('impala', 'greatest', 1)).toEqual(['T']);
-    expect(SqlFunctions.getArgumentTypes('impala', 'greatest', 200)).toEqual(['T']);
-
-    expect(SqlFunctions.getArgumentTypes('hive', 'strleft', 1)).toEqual(['T']);
-    expect(SqlFunctions.getArgumentTypes('hive', 'strleft', 2)).toEqual(['T']);
-    expect(SqlFunctions.getArgumentTypes('hive', 'strleft', 3)).toEqual(['T']);
-    expect(SqlFunctions.getArgumentTypes('hive', 'strleft', 200)).toEqual(['T']);
-    expect(SqlFunctions.getArgumentTypes('impala', 'strleft', 1)).toEqual(['STRING']);
-    expect(SqlFunctions.getArgumentTypes('impala', 'strleft', 2)).toEqual(['INT']);
-    expect(SqlFunctions.getArgumentTypes('impala', 'strleft', 3)).toEqual([]);
-    expect(SqlFunctions.getArgumentTypes('impala', 'strleft', 200)).toEqual([]);
-
-    expect(SqlFunctions.getArgumentTypes('hive', 'concat', 10)).toEqual(['BINARY', 'STRING']);
-    expect(SqlFunctions.getArgumentTypes('impala', 'concat', 10)).toEqual(['STRING']);
-
-    expect(SqlFunctions.getArgumentTypes('hive', 'substring_index', 1)).toEqual(['STRING']);
-    expect(SqlFunctions.getArgumentTypes('hive', 'substring_index', 2)).toEqual(['STRING']);
-    expect(SqlFunctions.getArgumentTypes('hive', 'substring_index', 3)).toEqual(['INT']);
-    expect(SqlFunctions.getArgumentTypes('hive', 'substring_index', 200)).toEqual([]);
-    expect(SqlFunctions.getArgumentTypes('impala', 'substring_index', 1)).toEqual(['T']);
-    expect(SqlFunctions.getArgumentTypes('impala', 'substring_index', 2)).toEqual(['T']);
-    expect(SqlFunctions.getArgumentTypes('impala', 'substring_index', 3)).toEqual(['T']);
-    expect(SqlFunctions.getArgumentTypes('impala', 'substring_index', 200)).toEqual(['T']);
-
-    expect(SqlFunctions.getArgumentTypes('hive', 'weeks_add', 1)).toEqual(['T']);
-    expect(SqlFunctions.getArgumentTypes('hive', 'weeks_add', 2)).toEqual(['T']);
-    expect(SqlFunctions.getArgumentTypes('hive', 'weeks_add', 3)).toEqual(['T']);
-    expect(SqlFunctions.getArgumentTypes('hive', 'weeks_add', 200)).toEqual(['T']);
-    expect(SqlFunctions.getArgumentTypes('impala', 'weeks_add', 1)).toEqual(['TIMESTAMP']);
-    expect(SqlFunctions.getArgumentTypes('impala', 'weeks_add', 2)).toEqual(['BIGINT', 'INT']);
-    expect(SqlFunctions.getArgumentTypes('impala', 'weeks_add', 3)).toEqual([]);
-    expect(SqlFunctions.getArgumentTypes('impala', 'weeks_add', 200)).toEqual([]);
-
-    expect(SqlFunctions.getArgumentTypes('hive', 'reflect', 1)).toEqual(['STRING']);
-    expect(SqlFunctions.getArgumentTypes('hive', 'reflect', 2)).toEqual(['STRING']);
-    expect(SqlFunctions.getArgumentTypes('hive', 'reflect', 3)).toEqual(['T']);
-    expect(SqlFunctions.getArgumentTypes('hive', 'reflect', 200)).toEqual(['T']);
-    expect(SqlFunctions.getArgumentTypes('impala', 'reflect', 1)).toEqual(['T']);
-    expect(SqlFunctions.getArgumentTypes('impala', 'reflect', 200)).toEqual(['T']);
-
-    expect(SqlFunctions.getArgumentTypes('hive', 'blabla', 2)).toEqual(['T']);
-    expect(SqlFunctions.getArgumentTypes('hive', 'blabla', 200)).toEqual(['T']);
-    expect(SqlFunctions.getArgumentTypes('impala', 'blabla', 2)).toEqual(['T']);
-    expect(SqlFunctions.getArgumentTypes('impala', 'blabla', 200)).toEqual(['T']);
-  });
-});