public Type getType() { if (isFunction()) { if (isVirtual()) { return Type.UDF; } return Type.Function; } if (isVirtual()) { return Type.StoredQuery; } return Type.StoredProc; }
static FunctionMethod replaceProcedureWithFunction(MetadataFactory factory, Procedure proc) throws MetadataException { if (proc.isFunction() && proc.getQueryPlan() != null) { return null; } FunctionMethod method = createFunctionMethod(proc); //remove the old proc factory.getSchema().getResolvingOrder().remove(factory.getSchema().getResolvingOrder().size() - 1); factory.getSchema().getProcedures().remove(proc.getName()); factory.getSchema().addFunction(method); return method; }
static FunctionMethod replaceProcedureWithFunction(MetadataFactory factory, Procedure proc) throws MetadataException { if (proc.isFunction() && proc.getQueryPlan() != null) { return null; } FunctionMethod method = createFunctionMethod(proc); //remove the old proc factory.getSchema().getResolvingOrder().remove(factory.getSchema().getResolvingOrder().size() - 1); factory.getSchema().getProcedures().remove(proc.getName()); factory.getSchema().addFunction(method); return method; }
static FunctionMethod replaceProcedureWithFunction(MetadataFactory factory, Procedure proc) throws MetadataException { if (proc.isFunction() && proc.getQueryPlan() != null) { return null; } FunctionMethod method = createFunctionMethod(proc); //remove the old proc factory.getSchema().getResolvingOrder().remove(factory.getSchema().getResolvingOrder().size() - 1); factory.getSchema().getProcedures().remove(proc.getName()); factory.getSchema().addFunction(method); return method; }
public static FunctionTree getFunctionProcedures(Schema schema) { UDFSource dummySource = new UDFSource(Collections.EMPTY_LIST); FunctionTree ft = null; for (Procedure p : schema.getProcedures().values()) { if (p.isFunction() && p.getQueryPlan() != null) { if (ft == null) { ft = new FunctionTree(schema.getName(), dummySource, false); } FunctionMethod fm = SQLParserUtil.createFunctionMethod(p); FunctionDescriptor fd = ft.addFunction(schema.getName(), dummySource, fm, false); fd.setProcedure(p); } } return ft; }
public static FunctionTree getFunctionProcedures(Schema schema) { UDFSource dummySource = new UDFSource(Collections.EMPTY_LIST); FunctionTree ft = null; for (Procedure p : schema.getProcedures().values()) { if (p.isFunction() && p.getQueryPlan() != null) { if (ft == null) { ft = new FunctionTree(schema.getName(), dummySource, false); } FunctionMethod fm = SQLParserUtil.createFunctionMethod(p); FunctionDescriptor fd = ft.addFunction(schema.getName(), dummySource, fm, false); fd.setProcedure(p); } } return ft; }
public static FunctionTree getFunctionProcedures(Schema schema) { UDFSource dummySource = new UDFSource(Collections.EMPTY_LIST); FunctionTree ft = null; for (Procedure p : schema.getProcedures().values()) { if (p.isFunction() && p.getQueryPlan() != null) { if (ft == null) { ft = new FunctionTree(schema.getName(), dummySource, false); } FunctionMethod fm = SQLParserUtil.createFunctionMethod(p); FunctionDescriptor fd = ft.addFunction(schema.getName(), dummySource, fm, false); fd.setProcedure(p); } } return ft; }
records.addAll(p.getResultSet().getColumns()); if (p.isVirtual() && !p.isFunction()) { String proc = this.getProcedureDefinition(vdbName, vdbVersion, p); if (proc != null) {
} else if (p.isFunction() && param.getType() != ProcedureParameter.Type.In) { metadataValidator.log(report, model, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31165, p.getFullName(), param.getFullName())); metadataValidator.log(report, model, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31077, p.getFullName(), model.getName())); if (p.isFunction()) { if (!hasReturn) { metadataValidator.log(report, model, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31166, p.getFullName()));
} else if (p.isFunction() && param.getType() != ProcedureParameter.Type.In) { metadataValidator.log(report, model, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31165, p.getFullName(), param.getFullName())); metadataValidator.log(report, model, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31077, p.getFullName(), model.getName())); if (p.isFunction()) { if (!hasReturn) { metadataValidator.log(report, model, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31166, p.getFullName()));
} else if (p.isFunction() && param.getType() != ProcedureParameter.Type.In) { metadataValidator.log(report, model, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31165, p.getFullName(), param.getFullName())); metadataValidator.log(report, model, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31077, p.getFullName(), model.getName())); if (p.isFunction()) { if (!hasReturn) { metadataValidator.log(report, model, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31166, p.getFullName()));
if (procedureRecord.isFunction()) { FunctionParameter outputParam = null; List<FunctionParameter> args = new ArrayList<FunctionParameter>(procedureRecord.getParameters().size() - 1);
if (procedureRecord.isFunction()) { FunctionParameter outputParam = null; List<FunctionParameter> args = new ArrayList<FunctionParameter>(procedureRecord.getParameters().size() - 1);
assertFalse(proc.isFunction());
assertFalse(proc.isFunction());
append(FOREIGN); append(SPACE).append(procedure.isFunction()?FUNCTION:PROCEDURE).append(SPACE).append(SQLStringVisitor.escapeSinglePart(procedure.getName())); append(LPAREN);
append(FOREIGN); append(SPACE).append(procedure.isFunction()?FUNCTION:PROCEDURE).append(SPACE).append(SQLStringVisitor.escapeSinglePart(procedure.getName())); append(LPAREN);
append(FOREIGN); append(SPACE).append(procedure.isFunction()?FUNCTION:PROCEDURE).append(SPACE).append(SQLStringVisitor.escapeSinglePart(procedure.getName())); append(LPAREN);