/** * Decides whether a command needs to be executed. * <br/><b>NOTE: This method has a side-effect.</b> If the criteria of this command always evaluate to true, * and the simplifyCriteria flag is true, then the command criteria are set to null. * @param command * @param simplifyCriteria whether to simplify the criteria of the command if they always evaluate to true * @return true if this command should be executed by the connector; false otherwise. * @throws TeiidComponentException * @throws ExpressionEvaluationException * @since 4.2 */ public static boolean shouldExecute(Command command, boolean simplifyCriteria) throws TeiidComponentException, ExpressionEvaluationException { return shouldExecute(command, simplifyCriteria, false); }
/** * Decides whether a command needs to be executed. * <br/><b>NOTE: This method has a side-effect.</b> If the criteria of this command always evaluate to true, * and the simplifyCriteria flag is true, then the command criteria are set to null. * @param command * @param simplifyCriteria whether to simplify the criteria of the command if they always evaluate to true * @return true if this command should be executed by the connector; false otherwise. * @throws TeiidComponentException * @throws ExpressionEvaluationException * @since 4.2 */ public static boolean shouldExecute(Command command, boolean simplifyCriteria) throws TeiidComponentException, ExpressionEvaluationException { return shouldExecute(command, simplifyCriteria, false); }
/** * Decides whether a command needs to be executed. * <br/><b>NOTE: This method has a side-effect.</b> If the criteria of this command always evaluate to true, * and the simplifyCriteria flag is true, then the command criteria are set to null. * @param command * @param simplifyCriteria whether to simplify the criteria of the command if they always evaluate to true * @return true if this command should be executed by the connector; false otherwise. * @throws TeiidComponentException * @throws ExpressionEvaluationException * @since 4.2 */ public static boolean shouldExecute(Command command, boolean simplifyCriteria) throws TeiidComponentException, ExpressionEvaluationException { return shouldExecute(command, simplifyCriteria, false); }
protected boolean prepareNextCommand(Command atomicCommand) throws TeiidComponentException, TeiidProcessingException { rewriteAndEvaluate(atomicCommand, getEvaluator(Collections.emptyMap()), this.getContext(), this.getContext().getMetadata()); return RelationalNodeUtil.shouldExecute(atomicCommand, true); }
protected boolean prepareNextCommand(Command atomicCommand) throws TeiidComponentException, TeiidProcessingException { rewriteAndEvaluate(atomicCommand, getEvaluator(Collections.emptyMap()), this.getContext(), this.getContext().getMetadata()); return RelationalNodeUtil.shouldExecute(atomicCommand, true); }
protected boolean prepareNextCommand(Command atomicCommand) throws TeiidComponentException, TeiidProcessingException { rewriteAndEvaluate(atomicCommand, getEvaluator(Collections.emptyMap()), this.getContext(), this.getContext().getMetadata()); return RelationalNodeUtil.shouldExecute(atomicCommand, true); }
AccessNode.rewriteAndEvaluate(updateCommand, eval, context, context.getMetadata()); needProcessing = RelationalNodeUtil.shouldExecute(updateCommand, true); if (needProcessing) { commandsToExecute.add(updateCommand);
AccessNode.rewriteAndEvaluate(updateCommand, eval, context, context.getMetadata()); needProcessing = RelationalNodeUtil.shouldExecute(updateCommand, true); if (needProcessing) { commandsToExecute.add(updateCommand);
AccessNode.rewriteAndEvaluate(updateCommand, eval, context, context.getMetadata()); needProcessing = RelationalNodeUtil.shouldExecute(updateCommand, true); if (needProcessing) { commandsToExecute.add(updateCommand);
@Test public void testShouldExecuteAgg() throws Exception { Query query = (Query)QueryParser.getQueryParser().parseCommand("SELECT count(*) FROM pm1.g1 where false"); //$NON-NLS-1$ assertTrue(RelationalNodeUtil.shouldExecute(query, false)); }
@Test public void testShouldExecuteLimitZero() throws Exception { Query query = (Query)QueryParser.getQueryParser().parseCommand("SELECT e1, e2 FROM pm1.g1 LIMIT 0"); //$NON-NLS-1$ assertFalse(RelationalNodeUtil.shouldExecute(query, false)); }
@Test public void testShouldExecuteUpdate() throws Exception { Update update = new Update(); update.setGroup(new GroupSymbol("test")); //$NON-NLS-1$ update.addChange(new ElementSymbol("e1"), new Constant("1")); //$NON-NLS-1$ //$NON-NLS-2$ assertTrue(RelationalNodeUtil.shouldExecute(update, false)); update.setChangeList(new SetClauseList()); assertFalse(RelationalNodeUtil.shouldExecute(update, false)); }
boolean result = RelationalNodeUtil.shouldExecute(atomicCommand, true);
boolean result = RelationalNodeUtil.shouldExecute(atomicCommand, true);
boolean result = RelationalNodeUtil.shouldExecute(atomicCommand, true);
if (!RelationalNodeUtil.shouldExecute(exists.getCommand(), false, true)) { return exists.isNegated()?TRUE_CRITERIA:FALSE_CRITERIA; rewriteWithExplicitArray(sub.getExpression(), sub); rewriteSubqueryContainer(sub, true); if (!RelationalNodeUtil.shouldExecute(sub.getCommand(), false, true)) { return sub.isNegated()?TRUE_CRITERIA:FALSE_CRITERIA;
if (!RelationalNodeUtil.shouldExecute(exists.getCommand(), false, true)) { return exists.isNegated()?TRUE_CRITERIA:FALSE_CRITERIA; rewriteWithExplicitArray(sub.getExpression(), sub); rewriteSubqueryContainer(sub, true); if (!RelationalNodeUtil.shouldExecute(sub.getCommand(), false, true)) { return sub.isNegated()?TRUE_CRITERIA:FALSE_CRITERIA;
if (!RelationalNodeUtil.shouldExecute(exists.getCommand(), false, true)) { return exists.isNegated()?TRUE_CRITERIA:FALSE_CRITERIA; rewriteWithExplicitArray(sub.getExpression(), sub); rewriteSubqueryContainer(sub, true); if (!RelationalNodeUtil.shouldExecute(sub.getCommand(), false, true)) { return sub.isNegated()?TRUE_CRITERIA:FALSE_CRITERIA;
if (criteria.getCommand() != null && !RelationalNodeUtil.shouldExecute(criteria.getCommand(), false, true)) {
if (criteria.getCommand() != null && !RelationalNodeUtil.shouldExecute(criteria.getCommand(), false, true)) {