2 Replies Latest reply on Aug 20, 2009 1:15 PM by Dimitri Zerjal

    Trouble with text files import

    Dimitri Zerjal Newbie

      Hi,

      I am trying to connect a text file source with a mysql source. I easily imported the mysql database but I have a problem with the text file.

      I tried to follow the quick example to import a text file source (.txt + -def.txt) but I don't understand what type of import I have to select to use them.

      I followed the quick example but on chapter 4.2. building a VDB there should be a video at the end of the list ("There is a video at the end of the list that will take you through all the steps involved") and I can't find it.

      Could you please give me a link to that video or a hint on how to import my text file and its associated descriptor file.

      Thx in advance for any answer.

        • 1. Re: Trouble with text files import
          Ramesh Reddy Master

          sharkin,

          Here is direct link to the video. Keeping it correct in the doc book is proving to be difficult.

          http://docs.jboss.org/teiid/6.1/quick-start-guide/en-US/html/images/EmbeddedDesignerExampleVideo.swf

          Unfortunately, there is NO importer for the Text sources, where the model can be created automatically. This is a manual exercise. Using designer need to create a "new" source model and add "base table" and all its elements as they are specified in the ".def" file. So, in effect you are creating a schema manually using designer that matches up to what is in the "def" file.

          For example:
          marketdata-def.txt has following lines

          MarketData.Price.location = marketdata-price.txt
          MarketData.Price.delimiter = ,
          MarketData.Price.headerLine = 1
          MarketData.Price.skipHeaderLines = 1

          "MarketData" defined your model name
          "Price" defines the Table name
          ".location" specifies the location of the data file, where data for "price" table exists

          marketdata-price.txt has

          SYMBOL,PRICE
          BA,42.75
          MON,78.75

          it is defining that "Price" table has columns "symbol" and "price"

          so using the designer you need to create
          1) a "source" model of name "marketdata"
          2) create a base table called "price"
          3) in the base table create two columns called "SYMBOL string" and "PRICE double"

          to match the .def file, now map this to your domain object and you are set. Once you are done creating a Model for your text resources, create a " Text Connector" and attach it to the "model" then you can preview data from text file in the designer.


          In Teiid 6.2 release we are introducing a new feature where you can load metadata from the ".def" files automatically, but this does not involve designer either. Using this feature you do not need to create a VDB. The above creation of the model is not necessary either, you would define that in the .def file. If you want take sneak peek at this look at

          http://www.jboss.org/community/wiki/TeiidConnectorSuppliedMetadata

          more information will be coming on this feature with Teiid 6.2 release.

          Also, be sure to tell us how something can be improved upon or have any questions.

          Thank you

          • 2. Re: Trouble with text files import
            Dimitri Zerjal Newbie

            Thx a lot for your very helpfull answer !

            I was having problem with the connector story, I had the table done, but I wasn't able to find how to create the connector ... When I saw the video, I understood I am completely blind, right in the middle of the window ...