-
1. Re: How to manually setup the cardinality for a datasource table at dynamic VDB source(physical) model
shawkins Jan 31, 2013 3:02 PM (in response to yjma2001)1 of 1 people found this helpfulThere is not a great built-in story here. Since you can directly set the cardinality via DDL create table statements, you can use both a dynamic import (where you would exclude anything you were explicitly creating) and DDL together by specifying multiple metadata repositories.
Or once the vdb is loaded (which you could use https://issues.jboss.org/browse/TEIID-2182 to get the event) you can issue setTableStats procedure calls - https://docs.jboss.org/author/display/TEIID/System+Procedures
Alternatively you can use a custom MetadataRepository to modify your metadata as it is loaded.
An enhancement would be to allow the sysadmin metadata procedures (or functionally equivalent statements) to be called in DDL which would simply this scenario.
Steve
-
2. Re: How to manually setup the cardinality for a datasource table at dynamic VDB source(physical) model
yjma2001 Jan 31, 2013 4:30 PM (in response to shawkins)Hi Steve:
Great information. Just want to make sure I truely understand:
(1) Could you please explain a little bit more on "you can use both a dynamic import (where you would exclude anything you were explicitly creating) and DDL together by specifying multiple metadata repositories" in you response? Some example or documenation will be great.
(2) For "Alternatively you can use a custom MetadataRepository to modify your metadata as it is loaded." in your response, is there a way to plugin the customized MetadataRepositoy into teiid or we have to change teiid code directly?
(3) do you have any time frame for the enhancement you mentioned above?
Thanks
Jack
-
3. Re: How to manually setup the cardinality for a datasource table at dynamic VDB source(physical) model
shawkins Jan 31, 2013 5:31 PM (in response to yjma2001)1 of 1 people found this helpful1) DDL and import intermixed:
{code}
<model visible = "true" type = "PHYSICAL" name = "portfolio">
<metadata type = "NATIVE,DDL"><![CDATA[
CREATE FOREIGN TABLE stock (
symbol varchar,
price decimal
) OPTIONS (CARDINALITY 10000);
]]>
</metadata>
</model>
{code}
Note the metadata type specifies both NATIVE and DDL.
2) See https://docs.jboss.org/author/display/TEIID/Custom+Metadata+Repository for using a custom repository. The metadata element would look similar to the above and could be chained in the same way as to mix the different metadata types.
3) There isn't an enhancement request for this yet, but it is generally useful for the dynamic case.
Steve
-
4. Re: How to manually setup the cardinality for a datasource table at dynamic VDB source(physical) model
yjma2001 Jan 31, 2013 7:45 PM (in response to shawkins)Hi Steve:
Thanks a lot.Those are very useful information. I need time to digest those options. And at mean time, could I submit a enhance request for creating a metadata procedure to add the cardinality to the data source table without using DDL ( CREATE FOREIGN TABLE)? Exactly like you said, this functionality is very useful for dynamic VDB.
Thanks
Jack
-
5. Re: How to manually setup the cardinality for a datasource table at dynamic VDB source(physical) model
shawkins Feb 1, 2013 1:30 PM (in response to yjma2001)Yes, go ahead and log an enhancement.
Thanks,
Steve
-
6. Re: How to manually setup the cardinality for a datasource table at dynamic VDB source(physical) model
rareddy Feb 1, 2013 1:31 PM (in response to yjma2001)I believe this JIRA https://issues.jboss.org/browse/TEIID-992 was exactly created for that. It is in my bucket for long time. May be this good time to discuss how we want this implemented. If we provide some DDL constructs that would be helpful, like
ALTER TABLE/VIEW ... ADD OPTION
CARDINALITY 10000
Ramesh..
-
7. Re: How to manually setup the cardinality for a datasource table at dynamic VDB source(physical) model
yjma2001 Feb 1, 2013 4:22 PM (in response to rareddy)Hi Ramesh/Steve:
Yes, this is same ssue. this just we are looking for, a easy way to set cardinality for a source table, We vote for it. Could we have it at 8.3?
Thanks
Jack
-
8. Re: How to manually setup the cardinality for a datasource table at dynamic VDB source(physical) model
shawkins Feb 1, 2013 4:27 PM (in response to yjma2001)You should create a new issue or a sub-issue of TEIID-992 specifically for this case. TEIID-992 is pretty general and encompasses other aspects of updating (mostly automated) stats.
Steve
-
9. Re: How to manually setup the cardinality for a datasource table at dynamic VDB source(physical) model
yjma2001 Feb 1, 2013 6:29 PM (in response to shawkins)Hi Steve:
An issue https://issues.jboss.org/browse/TEIID-2372 opened. I linked this issue to Teiid-992 as well. Hopefully you could have it resolved at 8.3.
Thanks
Jack