Package org.teiid.query.function

Examples of org.teiid.query.function.UDFSource


 
  private static TransformationMetadata buildTransformationMetaData(VDBMetaData vdb, LinkedHashMap<String, Resource> visibilityMap, MetadataStoreGroup stores, UDFMetaData udf, FunctionTree systemFunctions, MetadataStore[] additionalStores) {
    Collection <FunctionTree> udfs = new ArrayList<FunctionTree>();
    if (udf != null) {     
      for (Map.Entry<String, Collection<FunctionMethod>> entry : udf.getFunctions().entrySet()) {
        udfs.add(new FunctionTree(entry.getKey(), new UDFSource(entry.getValue()), true));
      }
    }
   
    CompositeMetadataStore compositeStore = new CompositeMetadataStore(stores.getStores());
    for (MetadataStore s:additionalStores) {
      compositeStore.addMetadataStore(s);
      for (Schema schema:s.getSchemas().values()) {
        if (!schema.getFunctions().isEmpty()) {
          udfs.add(new FunctionTree(schema.getName(), new UDFSource(schema.getFunctions().values()), true));
        }
      }
    }
   
    TransformationMetadata metadata =  new TransformationMetadata(vdb, compositeStore, visibilityMap, systemFunctions, udfs);
View Full Code Here


      Collection <FunctionMethod> methods = null;
      Collection<FunctionTree> trees = null;
      if (udfFile != null) {
        String schema = FileUtils.getFilenameWithoutExtension(udfFile.getPath());
        methods = FunctionMetadataReader.loadFunctionMethods(udfFile.openStream());
        trees = Arrays.asList(new FunctionTree(schema, new UDFSource(methods), true));
      }
      SystemFunctionManager sfm = new SystemFunctionManager();
      vdbmetadata = new TransformationMetadata(null, new CompositeMetadataStore(Arrays.asList(getSystem(), imf.getMetadataStore(getSystem().getDatatypes()))), imf.getEntriesPlusVisibilities(), sfm.getSystemFunctions(), trees);
      VDB_CACHE.put(vdbURL, vdbmetadata);
      return vdbmetadata;
View Full Code Here

  public void setUDF(final Collection<FunctionMethod> methods) {
    this.metadata = new BasicQueryMetadataWrapper(this.metadata) {
      @Override
      public FunctionLibrary getFunctionLibrary() {
        SystemFunctionManager sfm = new SystemFunctionManager();
        return new FunctionLibrary(sfm.getSystemFunctions(), new FunctionTree("foo", new UDFSource(methods)))//$NON-NLS-1$
      }
    };
  }
View Full Code Here

      vdbMetaData.setVersion(1);
      List<FunctionTree> udfs = new ArrayList<FunctionTree>();
      for (Schema schema : metadataStore.getSchemas().values()) {
      vdbMetaData.addModel(FakeMetadataFactory.createModel(schema.getName(), schema.isPhysical()));
      if (!schema.getFunctions().isEmpty()) {
        udfs.add(new FunctionTree(schema.getName(), new UDFSource(schema.getFunctions().values()), true));
      }
    }
      return new TransformationMetadata(vdbMetaData, store, null, FakeMetadataFactory.SFM.getSystemFunctions(), udfs);
  }
View Full Code Here

TOP

Related Classes of org.teiid.query.function.UDFSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.