@@ -0,0 +1,1623 @@
+package com.kylinolap.job.common;%0A%0Aimport com.google.common.collect.Lists;%0Aimport com.kylinolap.common.util.HiveClient;%0Aimport com.kylinolap.job.dao.JobPO;%0Aimport com.kylinolap.job.exception.ExecuteException;%0Aimport com.kylinolap.job.execution.ExecutableContext;%0Aimport com.kylinolap.job.execution.ExecuteResult;%0Aimport com.kylinolap.job.impl.threadpool.AbstractExecutable;%0Aimport org.apache.commons.lang.StringUtils;%0A%0Aimport java.util.Collections;%0Aimport java.util.List;%0A%0A/**%0A * Created by qianzhou on 1/15/15.%0A */%0Apublic class HqlExecutable extends AbstractExecutable %7B%0A%0A    private static final String HQL = %22hql%22;%0A%0A    public HqlExecutable() %7B%0A    %7D%0A%0A    public HqlExecutable(JobPO job) %7B%0A        super(job);%0A    %7D%0A%0A    @Override%0A    protected ExecuteResult doWork(ExecutableContext context) throws ExecuteException %7B%0A        try %7B%0A            HiveClient hiveClient = new HiveClient();%0A            for (String hql: getHqls()) %7B%0A                hiveClient.executeHQL(hql);%0A            %7D%0A            return new ExecuteResult(ExecuteResult.State.SUCCEED);%0A        %7D catch (Exception e) %7B%0A            logger.error(%22error run hive query:%22 + getHqls(), e);%0A            return new ExecuteResult(ExecuteResult.State.ERROR, e.getLocalizedMessage());%0A        %7D%0A    %7D%0A%0A    public void setHqls(List%3CString%3E hqls) %7B%0A        setParam(HQL, StringUtils.join(hqls, %22,%22));%0A    %7D%0A%0A    private List%3CString%3E getHqls() %7B%0A        final String hqls = getParam(HQL);%0A        if (hqls != null) %7B%0A            return Lists.newArrayList(StringUtils.split(hqls, %22,%22));%0A        %7D else %7B%0A            return Collections.emptyList();%0A        %7D%0A    %7D%0A%0A%7D%0A

add HqlExecutable