Search in sources :

Example 1 with CBOFallbackStrategy

use of org.apache.hadoop.hive.ql.parse.CBOFallbackStrategy in project hive by apache.

the class ReExecDriver method checkHookConfig.

private void checkHookConfig() throws CommandProcessorException {
    String strategies = coreDriver.getConf().getVar(ConfVars.HIVE_QUERY_REEXECUTION_STRATEGIES);
    CBOFallbackStrategy fallbackStrategy = CBOFallbackStrategy.valueOf(coreDriver.getConf().getVar(ConfVars.HIVE_CBO_FALLBACK_STRATEGY));
    if (fallbackStrategy.allowsRetry() && (strategies == null || !Arrays.stream(strategies.split(",")).anyMatch("recompile_without_cbo"::equals))) {
        String errorMsg = "Invalid configuration. If fallbackStrategy is set to " + fallbackStrategy.name() + " then " + ConfVars.HIVE_QUERY_REEXECUTION_STRATEGIES.varname + " should contain 'recompile_without_cbo'";
        CONSOLE.printError(errorMsg);
        throw new CommandProcessorException(errorMsg);
    }
}
Also used : CommandProcessorException(org.apache.hadoop.hive.ql.processors.CommandProcessorException) CBOFallbackStrategy(org.apache.hadoop.hive.ql.parse.CBOFallbackStrategy)

Aggregations

CBOFallbackStrategy (org.apache.hadoop.hive.ql.parse.CBOFallbackStrategy)1 CommandProcessorException (org.apache.hadoop.hive.ql.processors.CommandProcessorException)1