Search in sources :

Example 1 with CreateFunctionHandler

use of org.apache.hadoop.hive.ql.parse.repl.load.message.CreateFunctionHandler in project hive by apache.

the class LoadFunction method tasks.

public TaskTracker tasks() throws IOException, SemanticException {
    URI fromURI = EximUtil.getValidatedURI(context.hiveConf, stripQuotes(event.rootDir().toUri().toString()));
    Path fromPath = new Path(fromURI.getScheme(), fromURI.getAuthority(), fromURI.getPath());
    try {
        CreateFunctionHandler handler = new CreateFunctionHandler();
        List<Task<? extends Serializable>> tasks = handler.handle(new MessageHandler.Context(dbNameToLoadIn, null, fromPath.toString(), null, null, context.hiveConf, context.hiveDb, null, LOG));
        createFunctionReplLogTask(tasks, handler.getFunctionName());
        tasks.forEach(tracker::addTask);
        return tracker;
    } catch (Exception e) {
        throw new SemanticException(ErrorMsg.INVALID_PATH.getMsg(), e);
    }
}
Also used : Path(org.apache.hadoop.fs.Path) Task(org.apache.hadoop.hive.ql.exec.Task) Serializable(java.io.Serializable) MessageHandler(org.apache.hadoop.hive.ql.parse.repl.load.message.MessageHandler) URI(java.net.URI) CreateFunctionHandler(org.apache.hadoop.hive.ql.parse.repl.load.message.CreateFunctionHandler) IOException(java.io.IOException) SemanticException(org.apache.hadoop.hive.ql.parse.SemanticException) SemanticException(org.apache.hadoop.hive.ql.parse.SemanticException)

Aggregations

IOException (java.io.IOException)1 Serializable (java.io.Serializable)1 URI (java.net.URI)1 Path (org.apache.hadoop.fs.Path)1 Task (org.apache.hadoop.hive.ql.exec.Task)1 SemanticException (org.apache.hadoop.hive.ql.parse.SemanticException)1 CreateFunctionHandler (org.apache.hadoop.hive.ql.parse.repl.load.message.CreateFunctionHandler)1 MessageHandler (org.apache.hadoop.hive.ql.parse.repl.load.message.MessageHandler)1