Search in sources :

Example 71 with Function

use of org.apache.hadoop.hive.metastore.api.Function in project hive by apache.

the class TestFunctions method testCreateFunctionNullFunctionType.

@Test(expected = MetaException.class)
public void testCreateFunctionNullFunctionType() throws Exception {
    Function function = testFunctions[0];
    function.setFunctionName("test_function_2");
    function.setFunctionType(null);
    client.createFunction(function);
}
Also used : Function(org.apache.hadoop.hive.metastore.api.Function) Test(org.junit.Test) MetastoreCheckinTest(org.apache.hadoop.hive.metastore.annotation.MetastoreCheckinTest)

Example 72 with Function

use of org.apache.hadoop.hive.metastore.api.Function in project hive by apache.

the class TestFunctions method testAlterFunctionNoSuchDatabase.

@Test(expected = MetaException.class)
public void testAlterFunctionNoSuchDatabase() throws Exception {
    // Choosing the 2nd function, since the 1st one is duplicated in the dummy database
    Function originalFunction = testFunctions[1];
    Function newFunction = getNewFunction();
    client.alterFunction("no_such_database", originalFunction.getFunctionName(), newFunction);
}
Also used : Function(org.apache.hadoop.hive.metastore.api.Function) Test(org.junit.Test) MetastoreCheckinTest(org.apache.hadoop.hive.metastore.annotation.MetastoreCheckinTest)

Example 73 with Function

use of org.apache.hadoop.hive.metastore.api.Function in project hive by apache.

the class TestFunctions method testGetFunctionNoSuchFunctionInThisDatabase.

@Test(expected = NoSuchObjectException.class)
public void testGetFunctionNoSuchFunctionInThisDatabase() throws Exception {
    // Choosing the 2nd function, since the 1st one is duplicated in the dummy database
    Function function = testFunctions[1];
    client.getFunction(OTHER_DATABASE, function.getFunctionName());
}
Also used : Function(org.apache.hadoop.hive.metastore.api.Function) Test(org.junit.Test) MetastoreCheckinTest(org.apache.hadoop.hive.metastore.annotation.MetastoreCheckinTest)

Example 74 with Function

use of org.apache.hadoop.hive.metastore.api.Function in project hive by apache.

the class TestFunctions method testCreateFunctionNullFunctionName.

@Test(expected = MetaException.class)
public void testCreateFunctionNullFunctionName() throws Exception {
    Function function = testFunctions[0];
    function.setFunctionName(null);
    client.createFunction(function);
}
Also used : Function(org.apache.hadoop.hive.metastore.api.Function) Test(org.junit.Test) MetastoreCheckinTest(org.apache.hadoop.hive.metastore.annotation.MetastoreCheckinTest)

Example 75 with Function

use of org.apache.hadoop.hive.metastore.api.Function in project hive by apache.

the class TestFunctions method testAlterFunctionAlreadyExists.

@Test(expected = MetaException.class)
public void testAlterFunctionAlreadyExists() throws Exception {
    Function originalFunction = testFunctions[0];
    Function newFunction = testFunctions[1];
    client.alterFunction(originalFunction.getDbName(), originalFunction.getFunctionName(), newFunction);
}
Also used : Function(org.apache.hadoop.hive.metastore.api.Function) Test(org.junit.Test) MetastoreCheckinTest(org.apache.hadoop.hive.metastore.annotation.MetastoreCheckinTest)

Aggregations

Function (org.apache.hadoop.hive.metastore.api.Function)90 Test (org.junit.Test)54 MetastoreCheckinTest (org.apache.hadoop.hive.metastore.annotation.MetastoreCheckinTest)40 ResourceUri (org.apache.hadoop.hive.metastore.api.ResourceUri)22 NoSuchObjectException (org.apache.hadoop.hive.metastore.api.NoSuchObjectException)13 ArrayList (java.util.ArrayList)12 MetaException (org.apache.hadoop.hive.metastore.api.MetaException)11 IOException (java.io.IOException)10 FunctionBuilder (org.apache.hadoop.hive.metastore.client.builder.FunctionBuilder)9 Database (org.apache.hadoop.hive.metastore.api.Database)7 HashSet (java.util.HashSet)6 Path (org.apache.hadoop.fs.Path)6 TException (org.apache.thrift.TException)6 HiveConf (org.apache.hadoop.hive.conf.HiveConf)5 NotificationEvent (org.apache.hadoop.hive.metastore.api.NotificationEvent)4 Partition (org.apache.hadoop.hive.metastore.api.Partition)4 Before (org.junit.Before)4 List (java.util.List)3 FunctionType (org.apache.hadoop.hive.metastore.api.FunctionType)3 GetAllFunctionsResponse (org.apache.hadoop.hive.metastore.api.GetAllFunctionsResponse)3