@Override public List<?> translate(Function function) { function.setName(SourceSystemFunctions.ADD_OP); Expression param1 = function.getParameters().get(0); Expression param2 = function.getParameters().get(1); Function indexOf = new Function("indexof", Arrays.asList(param2, param1), TypeFacility.RUNTIME_TYPES.INTEGER); //$NON-NLS-1$ indexOf.setMetadataObject(function.getMetadataObject()); function.getParameters().set(0, indexOf); function.getParameters().set(1, new Literal(1, TypeFacility.RUNTIME_TYPES.INTEGER)); return null; } });
@Override public List<?> translate(Function function) { function.setName(SourceSystemFunctions.ADD_OP); Expression param1 = function.getParameters().get(0); Expression param2 = function.getParameters().get(1); Function indexOf = new Function("indexof", Arrays.asList(param2, param1), TypeFacility.RUNTIME_TYPES.INTEGER); //$NON-NLS-1$ indexOf.setMetadataObject(function.getMetadataObject()); function.getParameters().set(0, indexOf); function.getParameters().set(1, new Literal(1, TypeFacility.RUNTIME_TYPES.INTEGER)); return null; } });
FunctionMethod method = obj.getMetadataObject(); if (name.startsWith(method.getCategory())) { name = name.substring(method.getCategory().length()+1);
private BaseColumn setCurrentExpression(Expression leftExpression) { BaseColumn old = currentExpression; if (leftExpression instanceof ColumnReference) { ColumnReference cr = (ColumnReference)leftExpression; currentExpression = cr.getMetadataObject(); } else if (leftExpression instanceof Function) { Function function = (Function)leftExpression; currentExpression = function.getMetadataObject().getOutputParameter(); } else { currentExpression = null; } //we are really looking for the native type, if it's not set then don't bother if (currentExpression != null && currentExpression.getNativeType() == null) { currentExpression = null; } return old; }
public void visit(Function obj) { FunctionMethod f = obj.getMetadataObject(); if (f != null) { String nativeQuery = f.getProperty(TEIID_NATIVE_QUERY, false); if (nativeQuery != null) { List<Argument> args = new ArrayList<Argument>(obj.getParameters().size()); for (Expression p : obj.getParameters()) { args.add(new Argument(Direction.IN, p, p.getType(), null)); } parseNativeQueryParts(nativeQuery, args, buffer, this); return; } } super.visit(obj); }
&& "boolean".equals(((Function)left).getMetadataObject().getOutputParameter().getRuntimeType())) { visitComparisonWithBooleanFunction(obj);
FunctionMethod method = obj.getMetadataObject(); if (name.startsWith(method.getCategory())) { name = name.substring(method.getCategory().length()+1);
Boolean avoidProjection = Boolean.valueOf(((Function) teiidExpr).getMetadataObject().getProperty(MongoDBExecutionFactory.AVOID_PROJECTION, false)); return addToProject(mongoExpr, true, columnDetails, processingDerivedColumn||!avoidProjection, projectedName);