This article is in response to the thred http://community.jboss.org/thread/170698 that is looking for the Teiid Runtime use of the metadata that has been produced by the Teiid Designer. Based on the metadata exposed by the Teiid Desinger the below table shows which fields are required and how that information is being used in Teiid runtime currently as of Teiid version 7.5. A ODS file attached if you like to modify.
TABLE | Type | In Designer | In Metadata API | Required By Runtime | Description |
FullName | String | Yes | Yes | Yes | Name of the Table |
NameInSource | String | Yes | Yes | Yes | Name of Table in the source system, for view this can be empty, also used on variety of use cases |
Cardinality | Integer | Yes | Yes | Yes | Cardinality is used to calculate the cost of source node access |
TableType | Integer | Yes | Yes | Yes | Table,View,Document,XmlMappingClass,XmlStagingTable,MaterializedTable |
IsVirtual | Boolean | Yes | Yes | Yes | If this Table is a view |
IsSystem | Boolean | Yes | Yes | No | Only used for System metadata |
IsMaterialized | Boolean | Yes | Yes | Yes | To identify that the table is materialized |
SupportsUpdate | Boolean | Yes | Yes | Yes | To allow updates on the table |
PrimaryKeyID | String | Yes | KeyRecord | Yes | Used for creating indexes on temp tables, create default update/delete procedures, and in costing |
ForeignKeyIDs | Collection | Yes | List<ForeignKey> | Yes | Used in join planning for allowed criteria and to establish key preservation |
IndexIDs | Collection | Yes | List<KeyRecord> | Yes | Used for creating non-unique indexes on temp tables and in planning (estimate predicate cost) |
UniqueKeyIDs | Collection | Yes | List<KeyRecord> | Yes | Used for creating unique indexes on temp tables and in planning (estimate predicate cost) |
AccessPatternIDs | Collection | Yes | List<KeyRecord> | Yes | Used for enforcing the criteria on query |
MaterializedTableID | String | Yes | Table | Yes | Reference to Materialization table |
insertEnabled | Boolean | ** | Yes | Yes | Flag for checking insert procedure is enabled |
deleteEnabled | Boolean | ** | Yes | Yes | Flag for checking delete procedure is enabled |
updateEnabled | Boolean | ** | Yes | Yes | Flag for checking update procedure is enabled |
Select Transformation | String | ** | Yes | Yes | Transformation for Select in case of View |
Insert Plan | String | ** | Yes | Yes | Transformation for Insert in case of View |
Update Plan | String | ** | Yes | Yes | Transformation for Update in case of View |
Delete Plan | String | ** | Yes | Yes | Transformation for Delete in case of View |
Bindings | Collection | ** | Yes | Yes | XML mapping class input set bindings |
SchemaPaths | Collection | ** | Yes | Yes | XML Document |
COLUMN | Type | In Designer | In Metadata API | Required By Runtime | Description |
FullName | String | Yes | Yes | Yes | Name of the column |
NameInSource | String | Yes | Yes | Yes | Name of the column in source system |
IsSelectable | Boolean | Yes | Yes | Yes | Column is allowed in select |
IsUpdatable | Boolean | Yes | Yes | Yes | Column is allowed in Update/Insert/Delete |
NullType | Integer | Yes | Yes | Yes | Used for validation if null value allowed and if null can be used as default insert value |
IsAutoIncrementable | Boolean | Yes | Yes | Yes | During insert used to validate if a value is required or not |
IsCaseSensitive | Boolean | Yes | Yes | No | Used in System Metadata |
IsSigned | Boolean | Yes | Yes | No | Used in System Metadata |
IsCurrency | Boolean | Yes | Yes | No | Used in System Metadata |
IsFixedLength | Boolean | Yes | Yes | No | Used in System Metadata |
IsTranformationInputParameter | Boolean | Yes | No | No | No longer used |
SearchType | Integer | Yes | Yes | Yes | Used for defining the capability of the source |
Length | Integer | Yes | Yes | No | Used in System Metadata |
Scale | Integer | Yes | Yes | No | Used in System Metadata |
Precision | Integer | Yes | Yes | No | Used in System Metadata |
CharOctetLength | Integer | Yes | Yes | No | Used in System Metadata |
Radix | Integer | Yes | Yes | No | Used in System Metadata |
DistinctValues | Integer | Yes | Yes | No | Used for cost calculations, System metadata |
NullValues | Integer | Yes | Yes | No | Used for cost calculations, System metadata |
MinValue | String | Yes | Yes | No | Used for cost calculations, System metadata |
MaxValue | String | Yes | Yes | No | Used for cost calculations, System metadata |
Format | String | Yes | Yes | No | Used for cost calculations, System metadata |
RuntimeType | String | Yes | Yes | Yes | Must be consistent with DatatypeObjectID |
NativeType | String | Yes | Yes | Yes | Translators can use this field to further plan |
DatatypeObjectID | String | Yes | No | Yes | Used to set the Datatype |
DefaultValue | String | Yes | Yes | Yes | Used for Insert and procedure execute operations when the values are not supplied |
Position | Integer | Yes | Yes | Yes | 1 based position of the column in the table/resultset |
PRIMARY KEY | Type | In Designer | In Metadata API | Required By Runtime | Description |
FullName | String | Yes | Yes | Yes | See the KeyRecord, See Table |
NameInSource | String | Yes | Yes | No | |
ColumnIDs | Collection | Yes | Yes | Yes | |
UNIQUE KEY | Type | In Designer | In Metadata API | Required By Runtime | Description |
FullName | String | Yes | Yes | Yes | See the KeyRecord, See Table |
NameInSource | String | Yes | Yes | No | |
ColumnIDs | Collection | Yes | Yes | Yes | |
INDEX | Type | In Designer | In Metadata API | Required By Runtime | Description |
FullName | String | Yes | Yes | Yes | See the KeyRecord, See Table |
NameInSource | String | Yes | Yes | No | |
ColumnIDs | Collection | Yes | Yes | Yes | |
ACCESS PATTERNS | Type | In Designer | In Metadata API | Required By Runtime | Description |
FullName | String | Yes | Yes | Yes | See the KeyRecord, See Table |
NameInSource | String | Yes | Yes | No | |
ColumnIDs | Collection | Yes | Yes | Yes | |
RESULT SET | Type | In Designer | In Metadata API | Required By Runtime | Description |
FullName | String | Yes | Yes | Yes | See Procedure |
NameInSource | String | Yes | Yes | No | |
ColumnIDs | Collection | Yes | Yes | Yes | |
FOREIGN KEY | Type | In Designer | In Metadata API | Required By Runtime | Description |
FullName | String | Yes | Yes | Yes | See the KeyRecord, See Table |
NameInSource | String | Yes | Yes | No | |
ColumnIDs | Collection | Yes | Yes | Yes | |
UniqueKeyID | String | Yes | Yes | Yes | |
DATATYPE (note - not currently extensible) | Type | In Designer | In Metadata API | Required By Runtime | Description |
FullName | String | Yes | Yes | No | Only used for System metadata |
NameInSource | String | Yes | Yes | No | Only used for System metadata |
Length | Integer | Yes | Yes | No | Only used for System metadata |
PrecisionLength | Integer | Yes | Yes | No | Only used for System metadata |
Scale | Integer | Yes | Yes | No | Only used for System metadata |
Radix | Integer | Yes | Yes | No | Only used for System metadata |
IsSigned | Boolean | Yes | Yes | No | Only used for System metadata |
IsAutoIncrement | Boolean | Yes | Yes | No | Only used for System metadata |
IsCaseSensitive | Boolean | Yes | Yes | No | Only used for System metadata |
Type | Integer | Yes | Yes | No | Only used for System metadata |
SearchType | Integer | Yes | Yes | No | Only used for System metadata |
NullType | Integer | Yes | Yes | No | Only used for System metadata |
JavaClassName | String | Yes | Yes | Yes | Maps to runtime type based on java class name |
RuntimeTypeName | String | Yes | Yes | No | Only used for System metadata |
DatatypeID | String | Yes | Yes | No | Only used for System metadata |
BaseTypeID | String | Yes | Yes | No | Only used for System metadata |
PrimitiveTypeID | String | Yes | Yes | No | Only used for System metadata |
VarietyType | Integer | Yes | Yes | No | Only used for System metadata |
VarietyProps | Collection | Yes | Yes | No | Only used for System metadata |
PROCEDURE | Type | In Designer | In Metadata API | Required By Runtime | Description |
FullName | String | Yes | Yes | Name of the Procedure | |
NameInSource | String | Yes | Yes | Name of procedure in source if this is source model | |
IsFunction | Boolean | Yes | Yes | If this represents a source function | |
IsVirtual | Boolean | Yes | Yes | If this is a virtual procedure | |
ParametersIDs | Collection | Yes | Yes | Parameter List | |
ResultSetID | String | Yes | Yes | Result set columns | |
UpdateCount | Integer | Yes | Yes | Update count defines the number of sources being updated, only applicable for virtual procedures | |
PROCEDURE PARAMETER | Type | In Designer | In Metadata API | Required By Runtime | Description |
ObjectID | String | Yes | ?? | Same as Column | |
FullName | String | Yes | Yes | Same as Column | |
nameInSource | String | Yes | Yes | Same as Column | |
defaultValue | String | Yes | Yes | Same as Column | |
RuntimeType | String | Yes | Yes | Same as Column | |
DatatypeObjectID | String | Yes | Yes | Same as Column | |
Length | Integer | Yes | Yes | Same as Column | |
Radix | Integer | Yes | Yes | Same as Column | |
Scale | Integer | Yes | Yes | Same as Column | |
NullType | Integer | Yes | Yes | Same as Column | |
Precision | Integer | Yes | Yes | Same as Column | |
Position | Integer | Yes | Yes | Same as Column | |
Type | String | Yes | Yes | Yes | Defines parameter is IN/OUT/RETURN |
Optional | Boolean | Yes | Yes | No | Defines if the parameter is optional or not, only used system metadata |
SQL TRANSFORMATION(**) | Type | In Designer | In Metadata API | Required By Runtime | Description |
VirtualGroupName | String | Yes | No | Yes | See Table, the properties defined on Table |
TransformedObjectID | String | Yes | No | Yes | See Table, the properties defined on Table |
TransformationObjectID | String | Yes | No | Yes | See Table, the properties defined on Table |
TransformationSql | String | Yes | No | Yes | See Table, the properties defined on Table |
Bindings | Collection | Yes | No | No | See Table, the properties defined on Table |
SchemaPaths | Collection | Yes | No | No | See Table, the properties defined on Table |
VDB | Type | In Designer | In Metadata API | Required By Runtime | Description |
FullName | String | Yes | vdb.xml | Yes | Name of the VDB |
NameInSource | String | ?? | No | No | Not required |
Version | String | Yes | vdb.xml | Yes | VDB version |
Identifier | String | Yes | No | No | Not required |
Description | String | Yes | vdb.xml | No | Used by System metadata |
ProducerName | String | Yes | No | No | Not required |
ProducerVersion | String | Yes | No | No | Not required |
Provider | String | Yes | No | No | Not required |
TimeLastChanged | String | Yes | No | No | Not required |
TimeLastProduced | String | Yes | No | No | Not required |
ModelIDs | Collection | yes | vdb.xml | Yes | Defines the model list in a VDB |
ANNOTATION | Type | In Designer | In Metadata API | Required By Runtime | Description |
FullName | String | Yes | Yes | No | Used by System metadata, as description on procedure parameter |
NameInSource | String | Yes | No | No | Not required |
Description | String | Yes | No | No | Not required |
Designer UI Interactions to control metadata:
- Costing: When importing from a jdbc source, you can get the cardinality automatically set at modeling time. For most sources aproximate table cardinalities are available from approximate indexes. If approximate indexes are not selected, then manual updates can be done or the modeling cost update action can be run (for non-oracle sources this will typically issue aggregate queries to obtain statistics). Additionally, there is a admin option to set cost information on the server, but the metadata isn't maintained after the server shutdown unless a MetadataRepository is configured.
Comments