org.teiid.metadata.Procedure.getQueryPlan()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(8.1k)|赞(0)|评价(0)|浏览(89)

本文整理了Java中org.teiid.metadata.Procedure.getQueryPlan()方法的一些代码示例,展示了Procedure.getQueryPlan()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Procedure.getQueryPlan()方法的具体详情如下:
包路径:org.teiid.metadata.Procedure
类名称:Procedure
方法名:getQueryPlan

Procedure.getQueryPlan介绍

暂无

代码示例

代码示例来源:origin: org.jboss.teiid/teiid-engine

public String getQuery() {
    return p.getQueryPlan();
  }
}

代码示例来源:origin: org.teiid/teiid-engine

public String getQuery() {
    return p.getQueryPlan();
  }
}

代码示例来源:origin: teiid/teiid

public String getQuery() {
    return p.getQueryPlan();
  }
}

代码示例来源:origin: org.jboss.teiid/teiid-engine

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;
}

代码示例来源:origin: org.teiid/teiid-engine

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;
}

代码示例来源:origin: teiid/teiid

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;
}

代码示例来源:origin: org.jboss.teiid/teiid-engine

public static void alterProcedureDefinition(final VDBMetaData vdb, final Procedure p, final String sql, boolean updateStore) {
  TransformationMetadata metadata = vdb.getAttachment(TransformationMetadata.class);
  DatabaseStore store = vdb.getAttachment(DatabaseStore.class);
  
  try {
    Command command = QueryParser.getQueryParser().parseProcedure(p.getQueryPlan(), false);
    QueryResolver.resolveCommand(command, new GroupSymbol(p.getFullName()), Command.TYPE_STORED_PROCEDURE, metadata, false);
    MetadataValidator.determineDependencies(p, command);
  } catch (TeiidException e) {
    //should have been caught in validation, but this logic
    //is also not mature so since there is no lock on the vdb
    //it is possible that the plan is no longer valid at this point due
    //to a concurrent execution
  }
  p.setQueryPlan(sql);
  p.setLastModified(System.currentTimeMillis());
  metadata.addToMetadataCache(p, "transformation/"+StoredProcedure.class.getSimpleName().toUpperCase(), null); //$NON-NLS-1$
}

代码示例来源:origin: org.teiid/teiid-engine

public static void alterProcedureDefinition(final VDBMetaData vdb, final Procedure p, final String sql, boolean updateStore) {
  TransformationMetadata metadata = vdb.getAttachment(TransformationMetadata.class);
  DatabaseStore store = vdb.getAttachment(DatabaseStore.class);
  
  try {
    Command command = QueryParser.getQueryParser().parseProcedure(p.getQueryPlan(), false);
    QueryResolver.resolveCommand(command, new GroupSymbol(p.getFullName()), Command.TYPE_STORED_PROCEDURE, metadata, false);
    MetadataValidator.determineDependencies(p, command);
  } catch (TeiidException e) {
    //should have been caught in validation, but this logic
    //is also not mature so since there is no lock on the vdb
    //it is possible that the plan is no longer valid at this point due
    //to a concurrent execution
  }
  p.setQueryPlan(sql);
  p.setLastModified(System.currentTimeMillis());
  metadata.addToMetadataCache(p, "transformation/"+StoredProcedure.class.getSimpleName().toUpperCase(), null); //$NON-NLS-1$
}

代码示例来源:origin: teiid/teiid

public static void alterProcedureDefinition(final VDBMetaData vdb, final Procedure p, final String sql, boolean updateStore) {
  TransformationMetadata metadata = vdb.getAttachment(TransformationMetadata.class);
  DatabaseStore store = vdb.getAttachment(DatabaseStore.class);
  
  try {
    Command command = QueryParser.getQueryParser().parseProcedure(p.getQueryPlan(), false);
    QueryResolver.resolveCommand(command, new GroupSymbol(p.getFullName()), Command.TYPE_STORED_PROCEDURE, metadata, false);
    MetadataValidator.determineDependencies(p, command);
  } catch (TeiidException e) {
    //should have been caught in validation, but this logic
    //is also not mature so since there is no lock on the vdb
    //it is possible that the plan is no longer valid at this point due
    //to a concurrent execution
  }
  p.setQueryPlan(sql);
  p.setLastModified(System.currentTimeMillis());
  metadata.addToMetadataCache(p, "transformation/"+StoredProcedure.class.getSimpleName().toUpperCase(), null); //$NON-NLS-1$
}

代码示例来源:origin: teiid/teiid

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;
}

代码示例来源:origin: org.jboss.teiid/teiid-engine

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;
}

代码示例来源:origin: org.teiid/teiid-engine

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;
}

代码示例来源:origin: teiid/teiid

@Test
public void testMultipleCommands() throws Exception {
  String ddl = "CREATE VIEW V1 AS SELECT * FROM PM1.G1; " +
      "CREATE PROCEDURE FOO(P1 integer) RETURNS (e1 integer, e2 varchar) AS SELECT * FROM PM1.G1;";
  
  Schema s = helpParse(ddl, "model").getSchema();
  Map<String, Table> tableMap = s.getTables();
  Table table = tableMap.get("V1");
  assertNotNull(table);
  assertEquals("SELECT * FROM PM1.G1", table.getSelectTransformation());
  
  Map<String, Procedure> procedureMap = s.getProcedures();
  Procedure p = procedureMap.get("FOO");
  assertNotNull(p);
  assertEquals("SELECT * FROM PM1.G1;", p.getQueryPlan());
  
}

代码示例来源:origin: org.jboss.teiid/teiid-engine

metadataValidator.log(report, model, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31166, p.getFullName()));
if (p.isVirtual() && p.getQueryPlan() == null) {
  metadataValidator.log(report, model, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31167, p.getFullName()));

代码示例来源:origin: teiid/teiid

assertEquals("any", proc.getProperties().get("RANDOM"));	
assertEquals("/*+ cache */ BEGIN\nSELECT * FROM foo;\nEND", proc.getQueryPlan());

代码示例来源:origin: org.jboss.teiid/teiid-engine

String plan = procedure.getQueryPlan();
append(plan);

代码示例来源:origin: teiid/teiid

Procedure p = (Procedure)record;
if (p.isVirtual()) {
  if (p.getQueryPlan() == null) {
    metadataValidator.log(report, model, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31081, p.getFullName(), model.getName()));

代码示例来源:origin: org.jboss.teiid/teiid-engine

Procedure p = (Procedure)record;
if (p.isVirtual()) {
  if (p.getQueryPlan() == null) {
    metadataValidator.log(report, model, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31081, p.getFullName(), model.getName()));

代码示例来源:origin: teiid/teiid

String plan = procedure.getQueryPlan();
append(plan);

代码示例来源:origin: org.teiid/teiid-engine

String plan = procedure.getQueryPlan();
append(plan);

相关文章