public void pushCall(String value) throws QueryProcessingException { if (recursionStack == null) { recursionStack = new LinkedList<String>(); } else if (recursionStack.contains(value)) { throw new QueryProcessingException(QueryPlugin.Event.TEIID30347, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30347, value)); } recursionStack.push(value); }
@Test public void testDynamicRecursion() throws Exception { TransformationMetadata metadata = TestUpdateValidator.example1(); TestUpdateValidator.createView("select 'a' as x, 2 as y", metadata, GX); Table t = metadata.getMetadataStore().getSchemas().get(VM1).getTables().get(GX); t.setDeletePlan("FOR EACH ROW BEGIN ATOMIC insert into gx (x, y) values (old.x, old.y); END"); t.setUpdatePlan(""); t.setInsertPlan("FOR EACH ROW BEGIN execute immediate 'delete from gx where gx.x = new.x'; END"); String sql = "insert into gx (x, y) select e1, e2 from pm1.g1"; FakeDataManager dm = new FakeDataManager(); FakeDataStore.addTable("pm1.g1", dm, metadata); CommandContext context = createCommandContext(); BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities(); ProcessorPlan plan = TestProcessor.helpGetPlan(TestResolver.helpResolve(sql, metadata), metadata, new DefaultCapabilitiesFinder(caps), context); try { helpProcess(plan, context, dm, null); fail(); } catch (QueryProcessingException e) { assertEquals("TEIID30168 Couldn't execute the dynamic SQL command \"EXECUTE IMMEDIATE 'delete from gx where gx.x = new.x'\" with the SQL statement \"delete from gx where gx.x = new.x\" due to: TEIID30347 There is a recursive invocation of group 'I gx'. Please correct the SQL.", e.getMessage()); } }
public void pushCall(String value) throws QueryProcessingException { if (recursionStack == null) { recursionStack = new LinkedList<String>(); } else if (recursionStack.contains(value)) { throw new QueryProcessingException(QueryPlugin.Event.TEIID30347, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30347, value)); } recursionStack.push(value); }
public void pushCall(String value) throws QueryProcessingException { if (recursionStack == null) { recursionStack = new LinkedList<String>(); } else if (recursionStack.contains(value)) { throw new QueryProcessingException(QueryPlugin.Event.TEIID30347, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30347, value)); } recursionStack.push(value); }
private static void evaluateConstraint(Command atomicCommand, Evaluator eval, Criteria constraint, Map<ElementSymbol, Expression> values) throws BlockedException, TeiidComponentException, QueryProcessingException { Criteria clone = (Criteria) constraint.clone(); ExpressionMappingVisitor.mapExpressions(clone, values); try { if (!eval.evaluate(clone, null)) { throw new QueryProcessingException(QueryPlugin.Event.TEIID31130, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31130, atomicCommand)); } } catch (ExpressionEvaluationException e) { throw new QueryProcessingException(QueryPlugin.Event.TEIID31130, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31130, atomicCommand)); } }
private static void evaluateConstraint(Command atomicCommand, Evaluator eval, Criteria constraint, Map<ElementSymbol, Expression> values) throws BlockedException, TeiidComponentException, QueryProcessingException { Criteria clone = (Criteria) constraint.clone(); ExpressionMappingVisitor.mapExpressions(clone, values); try { if (!eval.evaluate(clone, null)) { throw new QueryProcessingException(QueryPlugin.Event.TEIID31130, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31130, atomicCommand)); } } catch (ExpressionEvaluationException e) { throw new QueryProcessingException(QueryPlugin.Event.TEIID31130, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31130, atomicCommand)); } }
private static void evaluateConstraint(Command atomicCommand, Evaluator eval, Criteria constraint, Map<ElementSymbol, Expression> values) throws BlockedException, TeiidComponentException, QueryProcessingException { Criteria clone = (Criteria) constraint.clone(); ExpressionMappingVisitor.mapExpressions(clone, values); try { if (!eval.evaluate(clone, null)) { throw new QueryProcessingException(QueryPlugin.Event.TEIID31130, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31130, atomicCommand)); } } catch (ExpressionEvaluationException e) { throw new QueryProcessingException(QueryPlugin.Event.TEIID31130, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31130, atomicCommand)); } }
throw new QueryProcessingException(QueryPlugin.Event.TEIID30232, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30232, matViewName)); for (Object[] param : params) { if (param == null || ids.size() != param.length) { throw new QueryProcessingException(QueryPlugin.Event.TEIID30231, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30231, matViewName, ids.size(), param == null ? 0 : param.length));
throw new QueryProcessingException(QueryPlugin.Event.TEIID30232, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30232, matViewName)); for (Object[] param : params) { if (param == null || ids.size() != param.length) { throw new QueryProcessingException(QueryPlugin.Event.TEIID30231, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30231, matViewName, ids.size(), param == null ? 0 : param.length));
throw new QueryProcessingException(QueryPlugin.Event.TEIID30232, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30232, matViewName)); for (Object[] param : params) { if (param == null || ids.size() != param.length) { throw new QueryProcessingException(QueryPlugin.Event.TEIID30231, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30231, matViewName, ids.size(), param == null ? 0 : param.length));
private Object validateMatView(QueryMetadataInterface metadata, String viewName) throws TeiidComponentException, TeiidProcessingException { try { Object groupID = metadata.getGroupID(viewName); if (!metadata.hasMaterialization(groupID) || metadata.getMaterialization(groupID) != null) { throw new QueryProcessingException(QueryPlugin.Event.TEIID30233, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30233, viewName)); } return groupID; } catch (QueryMetadataException e) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30234, e); } }
private Object validateMatView(QueryMetadataInterface metadata, String viewName) throws TeiidComponentException, TeiidProcessingException { try { Object groupID = metadata.getGroupID(viewName); if (!metadata.hasMaterialization(groupID) || metadata.getMaterialization(groupID) != null) { throw new QueryProcessingException(QueryPlugin.Event.TEIID30233, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30233, viewName)); } return groupID; } catch (QueryMetadataException e) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30234, e); } }
private Object validateMatView(QueryMetadataInterface metadata, String viewName) throws TeiidComponentException, TeiidProcessingException { try { Object groupID = metadata.getGroupID(viewName); if (!metadata.hasMaterialization(groupID) || metadata.getMaterialization(groupID) != null) { throw new QueryProcessingException(QueryPlugin.Event.TEIID30233, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30233, viewName)); } return groupID; } catch (QueryMetadataException e) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30234, e); } }
throw new QueryProcessingException(QueryPlugin.Util .getString("ExecDynamicSqlInstruction.4")); //$NON-NLS-1$ throw new QueryProcessingException(QueryPlugin.Util .getString("ExecDynamicSqlInstruction.6", sourceTypeName, sourceExpr, dynamicTypeName)); //$NON-NLS-1$
throw new QueryProcessingException(QueryPlugin.Util .getString("ExecDynamicSqlInstruction.4")); //$NON-NLS-1$ throw new QueryProcessingException(QueryPlugin.Util .getString("ExecDynamicSqlInstruction.6", sourceTypeName, sourceExpr, dynamicTypeName)); //$NON-NLS-1$
throw new QueryProcessingException(QueryPlugin.Util .getString("ExecDynamicSqlInstruction.4")); //$NON-NLS-1$ throw new QueryProcessingException(QueryPlugin.Util .getString("ExecDynamicSqlInstruction.6", sourceTypeName, sourceExpr, dynamicTypeName)); //$NON-NLS-1$
throw new QueryProcessingException(QueryPlugin.Event.TEIID30561, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30561, accessNode.getCommand()));
throw new QueryProcessingException(QueryPlugin.Event.TEIID30561, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30561, accessNode.getCommand()));
throw new QueryProcessingException(QueryPlugin.Event.TEIID30561, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30561, accessNode.getCommand()));
throw new QueryProcessingException(QueryPlugin.Event.TEIID31295, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31295, elementSymbol));