Skip to content

Commit

Permalink
TEIID-4932 adding a doc of the udf repository
Browse files Browse the repository at this point in the history
  • Loading branch information
shawkins committed Oct 1, 2018
1 parent 1820f0a commit 7ac7cd8
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion reference/Metadata_Repositories.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ This is only applicable on source models (and is also the default), when used th

This is applicable to both source and view models. See link:DDL_Metadata.adoc[DDL Metadata] for more information on how to use this feature.

== FILE
== DDL-FILE

[source,xml]
.*Sample vdb.xml file*
Expand All @@ -50,6 +50,31 @@ This is applicable to both source and view models. See link:DDL_Metadata.adoc[DD

DDL is applicable to both source and view models in zip VDB deployments. See link:DDL_Metadata.adoc[DDL Metadata] for more information on how to use this feature.

== UDF (11.2+)

[source,xml]
.*Sample vdb.xml file*
----
<vdb name="{vdb-name}" version="1">
<model name="{model-name}" type="VIRTUAL">
<property name="importer.schemaName" value="org.foo.Class"/>
<metadata type="UDF"></metadata>
</model>
</vdb>
----

[source,ddl]
.*Sample ddl file*
----
CREATE DATABASE {vdb-name} VERSION '1';
USE DATABASE {vdb-name} VERSION '1';
CREATE VIRTUAL SCHEMA {model-name};
IMPORT FOREIGN SCHEMA "org.foo.Class" FROM REPOSITORY UDF INTO {model-name};
----

The logic will import all static functions that return non-void results, or import the user defined aggregate function if
the class implements the UserDefinedAggregate interface.

== Chaining Repositories

When defining the metadata type for a model, multiple metadata elements can be used. All the repository instances defined are consulted in the order configured to gather the metadata for the given model. For example:
Expand Down

0 comments on commit 7ac7cd8

Please sign in to comment.