@Override public void addInputDirect(List<?> tuple, CommandContext commandContext) throws TeiidComponentException, TeiidProcessingException { if (values == null) { values = new Object[argIndexes.length + (fd.requiresContext()?1:0)]; } if (fd.requiresContext()) { values[0] = commandContext; } for (int i = 0; i < argIndexes.length; i++) { values[i + (fd.requiresContext()?1:0)] = tuple.get(argIndexes[i]); } fd.invokeFunction(values, commandContext, instance); }
@Override public void addInputDirect(List<?> tuple, CommandContext commandContext) throws TeiidComponentException, TeiidProcessingException { if (values == null) { values = new Object[argIndexes.length + (fd.requiresContext()?1:0)]; } if (fd.requiresContext()) { values[0] = commandContext; } for (int i = 0; i < argIndexes.length; i++) { values[i + (fd.requiresContext()?1:0)] = tuple.get(argIndexes[i]); } fd.invokeFunction(values, commandContext, instance); }
@Override public void addInputDirect(List<?> tuple, CommandContext commandContext) throws TeiidComponentException, TeiidProcessingException { if (values == null) { values = new Object[argIndexes.length + (fd.requiresContext()?1:0)]; } if (fd.requiresContext()) { values[0] = commandContext; } for (int i = 0; i < argIndexes.length; i++) { values[i + (fd.requiresContext()?1:0)] = tuple.get(argIndexes[i]); } fd.invokeFunction(values, commandContext, instance); }
in[i+1] = inputs[i]; actualOutput = descriptor.invokeFunction(in, null, null); actualOutput = descriptor.invokeFunction(inputs, null, null);
Object result = descriptor.invokeFunction(new Object[] {context, ((Constant)rightExpr).getValue(), format}, null, this.context ); result = leftFunction.getFunctionDescriptor().invokeFunction(new Object[] {context, result, format }, null, this.context ); if (Constant.COMPARATOR.compare(value, result) != 0) { return getSimpliedCriteria(crit, leftExpr, crit.getOperator() != CompareCriteria.EQ, true);
Object result = descriptor.invokeFunction(new Object[] {context, ((Constant)rightExpr).getValue(), format}, null, this.context ); result = leftFunction.getFunctionDescriptor().invokeFunction(new Object[] {context, result, format }, null, this.context ); if (Constant.COMPARATOR.compare(value, result) != 0) { return getSimpliedCriteria(crit, leftExpr, crit.getOperator() != CompareCriteria.EQ, true);
Object result = descriptor.invokeFunction(new Object[] {context, ((Constant)rightExpr).getValue(), format}, null, this.context ); result = leftFunction.getFunctionDescriptor().invokeFunction(new Object[] {context, result, format }, null, this.context ); if (Constant.COMPARATOR.compare(value, result) != 0) { return getSimpliedCriteria(crit, leftExpr, crit.getOperator() != CompareCriteria.EQ, true);
Constant const2 = (Constant)rightExpr; try { Object result = descriptor.invokeFunction(new Object[] { const2.getValue(), const1.getValue() }, null, this.context ); combinedConst = new Constant(result, descriptor.getReturnType()); } catch(FunctionExecutionException e) {
Constant const2 = (Constant)rightExpr; try { Object result = descriptor.invokeFunction(new Object[] { const2.getValue(), const1.getValue() }, null, this.context ); combinedConst = new Constant(result, descriptor.getReturnType()); } catch(FunctionExecutionException e) {
Constant const2 = (Constant)rightExpr; try { Object result = descriptor.invokeFunction(new Object[] { const2.getValue(), const1.getValue() }, null, this.context ); combinedConst = new Constant(result, descriptor.getReturnType()); } catch(FunctionExecutionException e) {
@Test public void testVarbinary() throws Exception { FunctionMethod method = new FunctionMethod( "dummy", null, null, PushDown.CANNOT_PUSHDOWN, TestFunctionTree.class.getName(), "toString", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ Arrays.asList(new FunctionParameter("in", DataTypeManager.DefaultDataTypes.VARBINARY)), //$NON-NLS-1$ new FunctionParameter("output", DataTypeManager.DefaultDataTypes.STRING), //$NON-NLS-1$ true, Determinism.DETERMINISTIC); FunctionTree sys = RealMetadataFactory.SFM.getSystemFunctions(); FunctionLibrary fl = new FunctionLibrary(sys, new FunctionTree("foo", new UDFSource(Arrays.asList(method)), true)); FunctionDescriptor fd = fl.findFunction("dummy", new Class<?>[] {DataTypeManager.DefaultDataClasses.VARBINARY}); String hello = "hello"; assertEquals(hello, fd.invokeFunction(new Object[] {new BinaryType(hello.getBytes())}, null, null)); }
return fd.invokeFunction(values, context, null);
return fd.invokeFunction(values, context, null);
return fd.invokeFunction(values, context, null);