3 Replies Latest reply on Mar 26, 2019 6:48 AM by rareddy

    How to define relationships for views

    srivi

      Hi

      I am a bit new to JDV and I am trying to create a VDB from a set of views in a Greenplum DB. I have a view layer that has views like sales, customer and product. These are not tables but views with some filters etc applied. I create a model using teiid from these views and now I want to create relationships between these views. From the data source we will not know the PK and FK here I want to specify them explicitly in the model is that possible?

      Please note that I am creating the teiid model from the RDBMS views. I don't want to do the exercise of creating the view model again

      Regards

      Srividhya

        • 1. Re: How to define relationships for views
          rareddy

          Srividya,

           

          If the Views are not defined in the Teiid, then what is the purpose of your use case to use Teiid? Also, by saying you already created a model in the Teiid, you have the view definitions in Teiid. So, add the PK/FK relationships in Teiid model then that would suffice.

           

          Ramesh..

          • 2. Re: How to define relationships for views
            srivi

            Hi Ramesh

             

            "If the Views are not defined in the Teiid, then what is the purpose of your use case to use Teiid? "

             

            I have certain views created already in EDW (before we used JDV) with the union of several tables and some business logic in it. I don't want to redo that effort in JDV right now. So I created a data source model using JDBC connection pulling these views.

            The problem I am facing is that in this JDBC data source model that I created in teiid I am unable to define PK/FK.

            I selected the column and tried the properties pane but the window shows no fields. So like in Erwin or other tools I want to establish the relationship between these views that I pulled from EDW. Wanted some guidance here.

             

            Regards

            Srividhya

            • 3. Re: How to define relationships for views
              rareddy

              OK, thanks.

               

              What you can do is create another Virtual model based on your EDW's source model which is one to one (if you are using the designer, when you create model you have an option to select a physical model and convert to view model). Once you have that model, you would be able to add in those PK/FK. There is no performance penalty for creating more view layers at runtime.

               

              Ramesh..