3 Replies Latest reply on Jun 10, 2015 8:38 AM by van.halbert

    delegate translator in VDB

    nitdede

      As per my design,

      There would be two VDB say A and B. B would be source for A.

      I am importing B into A like

       

      <property name="lib" value="com.lgc.common"/>

        <import-vdb name="B" version="1" import-data-policies="false"/>

          <model name="A" type="VIRTUAL" visible="true">

              <property name="modelClass" value="Relational"/>

              <metadata type="DDL-FILE">/ddl/A.ddl</metadata>

          </model>

       

      database query will be fired from  A to B.

      before hitting to B, I need to do some processing into query, that's why need translator.

      Please help me how can I delegated translator here.

        • 1. Re: delegate translator in VDB
          van.halbert

          Nitesh,

           

          With this VDB design, models A and B are treated as being in the same VDB, and the delegating translator would not be callable from B to A.   If you want to use a delegating translator, take a look at the doc's [1] and how it explains to use a translator override.   The translator override would be defined for model B, which is mapped to a data source that defines connecting to another VDB, for which model A is contained. 

           

          [1]  Delegating Translator - Teiid 8.11 (draft) - Project Documentation Editor

          • 2. Re: delegate translator in VDB
            nitdede

            Thanks Van,

            But I can not make any change into  VDB (B), so is there any other way to modify the query as per the requirement before it goes to VDB B.

            • 3. Re: delegate translator in VDB
              van.halbert

              Nitesh,

               

              Let me first apologize, I inadvertently swapped A and B in my statement.  You would change model A to map to the delegating translator, which would call the VDB for which model B is defined.   In your implementation of the delegating translator, you can make adjustments to the query being submitted before calling VDB "B".