1 Reply Latest reply on Mar 4, 2013 2:39 PM by shawkins

    teiid query hints getting overriden

    gamvi01

      Hi

       

      Is it possible to append hints to existing hints that exits for a table/view. ?

       

       

      We have a usecase where we set hints to the transformation query of a view in getMetadata call of a translator. when we are querying for that view we also pass a general hint /*+ sh:'data_window' */. we observed that teiid hints are getting ovveriden. Is there any property with which we can ask teiid to append the hints rather than ovveriding them ? 

       

       

      Below is the snippet of what happens in getMetadata call.

       

      if (v != null) {

                  v.setVirtual(true);

                  v.setTableType(Type.View);

                  String transformation = null;

                  String localHint = "";

                  if (hint != null) {

                      localHint = "/*+ sh:'" + hint + "' */ ";

                  }

                  String localCacheHint = "";

                  if (cacheHint != null) {

                      localCacheHint = "/*+ " + cacheHint + " */ ";

                  }

       

                         transformation = "SELECT " + localHint + columnList.toString() + " FROM GSV." + tableName + " AS b";

       

                  if (cacheHint != null) {

                      v.setMaterialized(true);

                      transformation = localCacheHint + transformation;

                  }

        • 1. Re: teiid query hints getting overriden
          shawkins

          > we observed that teiid hints are getting ovveriden. Is there any property with which we can ask teiid to append the hints rather than ovveriding them ?

           

          The source hint's primary intent was for usage in the user query and not in view layers, thus depending upon how you use your view the source hint will in many circumstances be ignored.  https://issues.jboss.org/browse/TEIID-2381 covers some possibilities for expanding the usage of source hints.  Can you vote for that issue and add any relevant comments there?

           

          Steve