private boolean isSatisfiable(RexNode second, DataContext dataValues) { if (dataValues == null) { return false; } ImmutableList<RexNode> constExps = ImmutableList.of(second); final RexExecutable exec = executor.getExecutable(builder, constExps, rowType); Object[] result; exec.setDataContext(dataValues); try { result = exec.execute(); } catch (Exception e) { // TODO: CheckSupport should not allow this exception to be thrown // Need to monitor it and handle all the cases raising them. LOGGER.warn("Exception thrown while checking if => {}: {}", second, e.getMessage()); return false; } return result != null && result.length == 1 && result[0] instanceof Boolean && (Boolean) result[0]; }
private boolean isSatisfiable(RexNode second, DataContext dataValues) { if (dataValues == null) { return false; } ImmutableList<RexNode> constExps = ImmutableList.of(second); final RexExecutable exec = executor.getExecutable(builder, constExps, rowType); Object[] result; exec.setDataContext(dataValues); try { result = exec.execute(); } catch (Exception e) { // TODO: CheckSupport should not allow this exception to be thrown // Need to monitor it and handle all the cases raising them. LOGGER.warn("Exception thrown while checking if => {}: {}", second, e.getMessage()); return false; } return result != null && result.length == 1 && result[0] instanceof Boolean && (Boolean) result[0]; }
.build(); final RexExecutable exec = executor.getExecutable(rexBuilder, constExps, rowType); exec.setDataContext(testContext);
.build(); final RexExecutable exec = executor.getExecutable(rexBuilder, constExps, rowType); exec.setDataContext(testContext);