2 Replies Latest reply on Jan 23, 2013 7:27 PM by markaddleman

    Abusing TEIID-196 for Poor man's dynamic tables

    markaddleman

      Hi -

       

      I was looking through TEIID-196 and got an evil thought:  Could we use it to bring in tables from a model after the VDB has been started? 

       

      We have data sources that dynamically create and destroy tables.  I was thinking that if our server was notified when the data source creates a table, it could issue a CREATE FOREIGN TEMPORARY TABLE on the particular source.  I assume that this would make Teiid aware of the new table so that it could be included in command operations.  Obviously, the translator would have to perform the appropriate mappings but I don't see how that would be any different than if the table had been surfaced to Teiid through the normal getMetadata() call.

       

      The only problem I can see is that the table is session scoped.  This is an annoyance but not a road block in our current use case (though, likely a problem for future use cases). 

       

       

      Thoughts?

        • 1. Re: Abusing TEIID-196 for Poor man's dynamic tables
          shawkins

          > Could we use it to bring in tables from a model after the VDB has been started?

           

          Yes my intent is to not force this to only source temporary tables.  From our perspecitve the notion of temporary here is really just scoping.  Having it be at a session scope allows us to use the existing temp logic and not worry about cluster propogation, etc.

           

          Steve

          • 2. Re: Abusing TEIID-196 for Poor man's dynamic tables
            markaddleman

            Great.  It isn't even abuse.

             

            From my perspective, using CREATE FOREIGN TEMP TABLE is a better solution than support for pushdown of array_get (from our earlier conversation).  For us, the two serve the same use case.  There is probably value in the array_get pushdown support but, assuming that TEIID-196 arrives in a suitable time frame, we'll probably use that.