@Override public void addInputDirect(List<?> tuple, CommandContext commandContext) throws FunctionExecutionException, ExpressionEvaluationException, TeiidComponentException { if (type == Type.RANK) { if (count == Long.MAX_VALUE) { throw new ExpressionEvaluationException(QueryPlugin.Event.TEIID31289, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31289)); } count++; } }
@Override public void addInputDirect(List<?> tuple, CommandContext commandContext) throws FunctionExecutionException, ExpressionEvaluationException, TeiidComponentException { if (type == Type.RANK) { if (count == Integer.MAX_VALUE) { throw new ExpressionEvaluationException(QueryPlugin.Event.TEIID31174, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31174)); } count++; } }
@Override public void addInputDirect(List<?> tuple, CommandContext commandContext) throws FunctionExecutionException, ExpressionEvaluationException, TeiidComponentException { if (type == Type.RANK) { if (count == Long.MAX_VALUE) { throw new ExpressionEvaluationException(QueryPlugin.Event.TEIID31289, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31289)); } count++; } }
@Override public void addInputDirect(List<?> tuple, CommandContext commandContext) throws FunctionExecutionException, ExpressionEvaluationException, TeiidComponentException { if (type == Type.RANK) { if (count == Integer.MAX_VALUE) { throw new ExpressionEvaluationException(QueryPlugin.Event.TEIID31174, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31174)); } count++; } }
@Override public void addInputDirect(List<?> tuple, CommandContext commandContext) throws FunctionExecutionException, ExpressionEvaluationException, TeiidComponentException { if (type == Type.RANK) { if (count == Integer.MAX_VALUE) { throw new ExpressionEvaluationException(QueryPlugin.Event.TEIID31174, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31174)); } count++; } }
@Override public Object getResult(CommandContext commandContext) throws FunctionExecutionException, ExpressionEvaluationException, TeiidComponentException { if (type == Type.DENSE_RANK) { if (count == Integer.MAX_VALUE) { throw new ExpressionEvaluationException(QueryPlugin.Event.TEIID31174, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31174)); } count++; return count; } int result = ++lastCount; lastCount = count; return result; }
@Override public Object getResult(CommandContext commandContext) throws FunctionExecutionException, ExpressionEvaluationException, TeiidComponentException { if (type == Type.DENSE_RANK) { if (count == Long.MAX_VALUE) { throw new ExpressionEvaluationException(QueryPlugin.Event.TEIID31289, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31289)); } count++; return count; } long result = ++lastCount; lastCount = count; return result; }
public static Object commandPayload(CommandContext context, String param) throws ExpressionEvaluationException, FunctionExecutionException{ Serializable payload = context.getCommandPayload(); if(payload == null) { return null; } // 1-arg form - assume payload is a Properties object if(payload instanceof Properties) { return ((Properties)payload).getProperty(param); } // Payload was bad throw new ExpressionEvaluationException(QueryPlugin.Event.TEIID30413, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30413, "commandPayload", payload.getClass().getName())); //$NON-NLS-1$ }
private Object evaluateTextLine(List<?> tuple, TextLine function) throws ExpressionEvaluationException, BlockedException, TeiidComponentException, FunctionExecutionException { List<DerivedColumn> args = function.getExpressions(); Evaluator.NameValuePair<Object>[] nameValuePairs = getNameValuePairs(tuple, args, true, true); try { return new ArrayImpl(TextLine.evaluate(Arrays.asList(nameValuePairs), defaultExtractor, function)); } catch (TransformationException e) { throw new ExpressionEvaluationException(e); } catch (TeiidProcessingException e) { throw new ExpressionEvaluationException(e); } }
private Object evaluateTextLine(List<?> tuple, TextLine function) throws ExpressionEvaluationException, BlockedException, TeiidComponentException, FunctionExecutionException { List<DerivedColumn> args = function.getExpressions(); Evaluator.NameValuePair<Object>[] nameValuePairs = getNameValuePairs(tuple, args, true, true); try { return new ArrayImpl(TextLine.evaluate(Arrays.asList(nameValuePairs), defaultExtractor, function)); } catch (TransformationException e) { throw new ExpressionEvaluationException(e); } catch (TeiidProcessingException e) { throw new ExpressionEvaluationException(e); } }
private Object evaluateTextLine(List<?> tuple, TextLine function) throws ExpressionEvaluationException, BlockedException, TeiidComponentException, FunctionExecutionException { List<DerivedColumn> args = function.getExpressions(); Evaluator.NameValuePair<Object>[] nameValuePairs = getNameValuePairs(tuple, args, true, true); try { return new ArrayImpl(TextLine.evaluate(Arrays.asList(nameValuePairs), defaultExtractor, function)); } catch (TransformationException e) { throw new ExpressionEvaluationException(e); } catch (TeiidProcessingException e) { throw new ExpressionEvaluationException(e); } }
public static Pattern getPattern(String newPattern, String originalPattern, int flags) throws ExpressionEvaluationException { List<?> key = Arrays.asList(newPattern, flags); Pattern p = patternCache.get(key); if (p == null) { try { p = Pattern.compile(newPattern, Pattern.DOTALL); patternCache.put(key, p); } catch(PatternSyntaxException e) { throw new ExpressionEvaluationException(QueryPlugin.Event.TEIID30448, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30448, new Object[]{originalPattern, e.getMessage()})); } } return p; }
public static Pattern getPattern(String newPattern, String originalPattern, int flags) throws ExpressionEvaluationException { List<?> key = Arrays.asList(newPattern, flags); Pattern p = patternCache.get(key); if (p == null) { try { p = Pattern.compile(newPattern, Pattern.DOTALL); patternCache.put(key, p); } catch(PatternSyntaxException e) { throw new ExpressionEvaluationException(QueryPlugin.Event.TEIID30448, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30448, new Object[]{originalPattern, e.getMessage()})); } } return p; }
public Object evaluate(Expression expression, List<?> tuple) throws ExpressionEvaluationException, BlockedException, TeiidComponentException { try { return internalEvaluate(expression, tuple); } catch (ExpressionEvaluationException e) { throw new ExpressionEvaluationException(QueryPlugin.Event.TEIID30328, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30328, new Object[] {expression, e.getMessage()})); } }
public Object evaluate(Expression expression, List<?> tuple) throws ExpressionEvaluationException, BlockedException, TeiidComponentException { try { return internalEvaluate(expression, tuple); } catch (ExpressionEvaluationException e) { throw new ExpressionEvaluationException(QueryPlugin.Event.TEIID30328, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30328, new Object[] {expression, e.getMessage()})); } }
public Object evaluate(Expression expression, List<?> tuple) throws ExpressionEvaluationException, BlockedException, TeiidComponentException { try { return internalEvaluate(expression, tuple); } catch (ExpressionEvaluationException e) { throw new ExpressionEvaluationException(QueryPlugin.Event.TEIID30328, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30328, new Object[] {expression, e.getMessage()})); } }
private boolean evaluate(IsNullCriteria criteria, List<?> tuple) throws ExpressionEvaluationException, BlockedException, TeiidComponentException { // Evaluate expression Object value = null; try { value = evaluate(criteria.getExpression(), tuple); } catch(ExpressionEvaluationException e) { throw new ExpressionEvaluationException(QueryPlugin.Event.TEIID30323, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30323, criteria)); } return (value == null ^ criteria.isNegated()); }
private boolean evaluate(IsNullCriteria criteria, List<?> tuple) throws ExpressionEvaluationException, BlockedException, TeiidComponentException { // Evaluate expression Object value = null; try { value = evaluate(criteria.getExpression(), tuple); } catch(ExpressionEvaluationException e) { throw new ExpressionEvaluationException(QueryPlugin.Event.TEIID30323, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30323, criteria)); } return (value == null ^ criteria.isNegated()); }
private boolean evaluate(IsNullCriteria criteria, List<?> tuple) throws ExpressionEvaluationException, BlockedException, TeiidComponentException { // Evaluate expression Object value = null; try { value = evaluate(criteria.getExpression(), tuple); } catch(ExpressionEvaluationException e) { throw new ExpressionEvaluationException(QueryPlugin.Event.TEIID30323, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30323, criteria)); } return (value == null ^ criteria.isNegated()); }
private boolean evaluate(ExistsCriteria criteria, List<?> tuple) throws BlockedException, TeiidComponentException, ExpressionEvaluationException { ValueIterator valueIter; try { valueIter = evaluateSubquery(criteria, tuple); } catch (TeiidProcessingException e) { throw new ExpressionEvaluationException(e); } if(valueIter.hasNext()) { return !criteria.isNegated(); } return criteria.isNegated(); }