Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
v2.4.1
-
None
Description
The root cause is in org.apache.kylin.common.util.HiveCmdBuilder#build
case BEELINE: String tmpHqlPath = null; StringBuilder hql = new StringBuilder(); try { tmpHqlPath = "/tmp/" + System.currentTimeMillis() + ".hql"; for (String statement : statements) { hql.append(statement); hql.append("\n"); } String createFileCmd = String.format(CREATE_HQL_TMP_FILE_TEMPLATE, tmpHqlPath, hql); buf.append(createFileCmd); buf.append("\n"); buf.append(beelineShell); buf.append(" "); buf.append(beelineParams); buf.append(parseProps()); buf.append(" -f "); buf.append(tmpHqlPath); buf.append(";ret_code=$?;rm -f "); buf.append(tmpHqlPath); buf.append(";exit $ret_code"); } finally { if (tmpHqlPath != null && logger.isDebugEnabled()) { logger.debug("The SQL to execute in beeline: \n" + hql); } } break;
A temp hql file will be created when creating flat table, the file name is the current time stamp. But if two jobs triggered with same time, there will be only one file, and jobs may be failed