4 Replies Latest reply on Aug 12, 2010 10:55 AM by rareddy

    Query Text File using Teiid 7.0

    beginnerram

      Hi,

       

      I am now trying to access a text file as Data source . I tried the dynamic Vdb portfolio example and it works file. If i try to create using the  eclipse 7.0 designer and deploy it on the server .. I have some issues. I get the following error:

       

      org.teiid.jdbc.TeiidSQLException

       

      : Remote org.teiid.api.exception.query.QueryResolverException: testtxtmodel.gettextfiles does not exist.

       

       

      The steps carried out :

      1. Created new Model Project.

      2. Import "Metadata from text files on the file system" Import Type : "Relational Database". The imported file contained the following contents

       

      SCHEMA,sch,"",CurrentMP/TestTxtModel
      TABLE,AGE,"dsfsf",CurrentMP/TestTxtModel/sch
      COLUMN,name,VARCHAR,255,""
      COLUMN,age1,VARCHAR,255,""

       

      3. created VDB and added the model to it with file Translator.

      4. While depoying it on the JBoss , Included the TextModel-ds.xml file with contents similar to the given example.

      5. The VDB is up and running. But when i query using

       

      select * from (call TestTxtModel.getTextFiles('*.txt')) f, TEXTTABLE(f.file COLUMNS name string, age1 string HEADER) resp

       

       

       

      I get the mentioned error.

        • 1. Re: Query Text File using Teiid 7.0
          shawkins

          Hi Ramya,

           

          Teiid Designer 7.0 did not have support for the file/ws translators.  What needs to happen is that the metadata for the file procedures needs to added to model in your project.  The simpliest way may be to start a Teiid server with the sample text dynamic vdb, then import the MarketData metadata from the server through the JDBC metadata importer.  This should give you a model with the getTextFiles procedure.  You can then switch the translator to a file translator using the TextModel-ds.  Teiid Designer 7.1 should address this short coming.  To make this easier for others, I think we'll post sample physical models for the text and ws translators in a wiki article, but it may take me a day or two to get to that.

           

          Steve

          • 2. Re: Query Text File using Teiid 7.0
            rareddy

            Ramya,

             

            As we promised here is an article talking about text data integration. Let us know if you have any questions.

             

            Thanks

             

            Ramesh..

            • 3. Re: Query Text File using Teiid 7.0
              beginnerram

              Thank you Very much. The article was really helpful. Now I am trying to do the  same for Web service. I created a Souce model with Invoke as procedure and  "binding, request, action , endpoint and response" as procedure parameters with Result as Return type. I m just trying to query the same. I am still trying to understand on hw to query using XML table and invoke as i get query error while trying to execute for the dynamicVDB also.

              • 4. Re: Query Text File using Teiid 7.0
                rareddy

                Ramya,

                 

                That was going to be my next blog/article, again we are working on it. It may take few more days for us to come up with it. I will send out a message to the teiid-users list once it ready. Here are instructions to subscribe to it.

                 

                Thank you.


                Ramesh..