1 2 Previous Next 20 Replies Latest reply on Oct 17, 2012 2:51 PM by shawkins Go to original post
      • 15. Re: Running Alter View SQL command giving issues
        rajkota

        Hi Steve,

         

        Now I am working on Teiid 8 environment. I am still getting the StackOverflowError while I am trying to define the table for each view.

        Note: We are creating the VDB dynamically as Mark Addleman mentioned in earlier posts.

        Here are my code changes:

         

        For updatable view definition:

         

        <view updatable="true" name="testDefTimeRange">

                                      <columns>

                                                <column name="ts" type="timestamp"/>

                                      </columns>

                                      <definition>

                                                SELECT now() ts

                                      </definition>

        </view>

         

        Code changes under setMetadata():

         

        Table table = metadataFactory.addTable(viewDefinition.viewName);

        table.setVirtual(true);          //setting virtual for all views.

        table.setTableType(Type.View);

         

        if (viewDefinition.isMaterialized()) {                    

          table.setMaterialized(true); 

          table.setSelectTransformation(selectTransformation); //with cache hint

        }

         

        table.setSelectTransformation(selectTransformation); //without cache hint

        if(viewDefinition.isUpdatable()){

            table.setSupportsUpdate(true);

        }                    

         

        for(each col in view ){

        metadataFactory.addColumn(...);

        }

         

        metadataFactory.addIndex(..);

         

        ------

         

        Error details are here:

         

        [00:34:40.865][info][talledLocalContainer] 00:34:40,848 ERROR [org.teiid.PROCESSOR] (pool-11-thread-1) TEIID30019 Unexpected exception for request vXX/VAuEIK+I.1: java.lang.StackOverflowError

        [00:34:40.865][info][talledLocalContainer]           at org.teiid.core.types.DataTypeManager$1.primaryHash(DataTypeManager.java:156)

        [00:34:40.865][info][talledLocalContainer]           at org.teiid.core.types.DataTypeManager$1.primaryHash(DataTypeManager.java:151)

        [00:34:40.865][info][talledLocalContainer]           at org.teiid.core.types.DataTypeManager$HashedValueCache.getValue(DataTypeManager.java:89)

        [00:34:40.865][info][talledLocalContainer]           at org.teiid.core.types.DataTypeManager$WeakReferenceHashedValueCache.getValue(DataTypeManager.java:119)

        [00:34:40.865][info][talledLocalContainer]           at org.teiid.core.types.DataTypeManager.getCanonicalString(DataTypeManager.java:895)

        [00:34:40.866][info][talledLocalContainer]           at org.teiid.query.sql.symbol.Symbol.setShortName(Symbol.java:90) [teiid-engine-8.1.0.FinalCAFix-SNAPSHOT.jar:8.1.0.FinalCAFix-SNAPSHOT]

         

        I could not able to understand the reason behind this error.

         

        I have attached our server log here. Though it is saying VDB is successfully deployed and our application is up, but I could not able to access any view from Data Source Explorer.

         

        Please suggest me here.

         

        Thanks, Raj

        • 16. Re: Running Alter View SQL command giving issues
          shawkins

          If you use 8.2 Beta1 this is likely to be somewhat resolved by https://issues.jboss.org/browse/TEIID-2191, since it appears that somewhere you have defined a view with itself.  If this is intentional, then there is an issue as we currently do not support recursive views.  If this is not intentional then when using 8.2 Beta1 the exception should indicate which view definition needs modified.

           

          Steve

          • 17. Re: Running Alter View SQL command giving issues
            rajkota

            Hi Steve,

            We are using dynamic VDB implementation and  we define our views in XML files (simulates Teiid's dynamic VDB file).  During JBoss startup, in our bootstrap services, we do read and process these XML files and then we construct views and models programatically in order to get the dynamic VDB.

             

            We are not using recursive views and not defining a new view under another view, so it is not intentional. We are using Teiid 8.1, can we get the fix for TEIID-2191 as a patch to 8.1 to verify our issue?

             

            Thanks,

            Raj

            • 18. Re: Running Alter View SQL command giving issues
              rajkota

              Hi Steve,

              Teiid 8.1 source is available in our repository and will get the patch for TEIID-2191 from JIRA and I will apply this patch to the existing source code and then will run the Teiid artifacts build to verify the issue.

               

              Thanks, Raj

              • 19. Re: Running Alter View SQL command giving issues
                rajkota

                Hi Steve,

                 

                 

                After merging the code changes related to fix of D-2191 into Teiid 8 source code, I am getting the below error on JBoss startup - unable to run any view against VDB now.

                 

                 

                Here is the error message.

                22:47:54,941 INFO  [org.teiid.PROCESSOR.MATVIEWS] (pool-11-thread-1) TEIID30013 Loading materialized view table #MAT_CHORUS_METADATA_TREE_DEFINITION.TREE_DEFINITION

                [22:47:55.002][info][talledLocalContainer] 22:47:54,968 ERROR [org.teiid.PROCESSOR.MATVIEWS] (pool-11-thread-1) TEIID30015 Failed to load materialized view table #MAT_CHORUS_METADATA_TREE_DEFINITION.TREE_DEFINITION.: org.teiid.api.exception.query.QueryPlannerException: TEIID31124 Recursive plan detected.  Command type Query was already issued against materialized_templates.tree_definition_virtual.

                [22:47:55.002][info][talledLocalContainer]           at org.teiid.query.optimizer.relational.RelationalPlanner.optimize(RelationalPlanner.java:244) [teiid-engine-8.1.0.FinalCAFix-SNAPSHOT.jar:8.1.0.Final]

                [22:47:55.002][info][talledLocalContainer]           at org.teiid.query.optimizer.QueryOptimizer.optimizePlan(QueryOptimizer.java:188) [teiid-engine-8.1.0.FinalCAFix-SNAPSHOT.jar:8.1.0.Final]

                [22:47:55.002][info][talledLocalContainer]           at org.teiid.dqp.internal.process.QueryProcessorFactoryImpl.createQueryProcessor(QueryProcessorFactoryImpl.java:89) [teiid-engine-8.1.0.FinalCAFix-SNAPSHOT.jar:8.1.0.Final]

                [22:47:55.002][info][talledLocalContainer]           at org.teiid.query.tempdata.TempTableDataManager.loadGlobalTable(TempTableDataManager.java:452) [teiid-engine-8.1.0.FinalCAFix-SNAPSHOT.jar:8.1.0.Final]

                [22:47:55.002][info][talledLocalContainer]           at org.teiid.query.tempdata.TempTableDataManager.registerQuery(TempTableDataManager.java:398) [teiid-engine-8.1.0.FinalCAFix-SNAPSHOT.jar:8.1.0.Final]

                [22:47:55.002][info][talledLocalContainer]           at org.teiid.query.tempdata.TempTableDataManager.registerRequest(TempTableDataManager.java:152) [teiid-engine-8.1.0.FinalCAFix-SNAPSHOT.jar:8.1.0.Final]

                [22:47:55.002][info][talledLocalContainer]           at org.teiid.query.tempdata.TempTableDataManager.registerRequest(TempTableDataManager.java:137) [teiid-engine-8.1.0.FinalCAFix-SNAPSHOT.jar:8.1.0.Final]

                [22:47:55.003][info][talledLocalContainer]           at org.teiid.query.processor.relational.AccessNode.registerRequest(AccessNode.java:377) [teiid-engine-8.1.0.FinalCAFix-SNAPSHOT.jar:8.1.0.Final]

                 

                I have attached our server log and the classes that I have modified as part of merging.

                 

                What it does it meant by Recursive plan? and please help me to resolve these issues in order to make alter view runnable using our approach.

                 

                Thanks, Raj

                • 20. Re: Running Alter View SQL command giving issues
                  shawkins

                  Recursive means that the view is defined by itself, for example:

                   

                  create view x (a string) as select a from y;

                  create view y (a string) as select a from x;

                   

                  So if I issue "select * from x" the planner will throw the exception you see.  You need to check your definition for materialized_templates.tree_definition_virtual

                   

                  I'll also adjust the message to give the particular planning cycle, which may be useful if there is a long planning cycle.

                   

                  Steve

                  1 2 Previous Next