13 Replies Latest reply on Aug 13, 2015 2:58 AM by Amit Singh

    Data Not getting parsed for complex type in Odata

    Amit Singh Newbie

      While retrieving the table data from SAP using Odata, it doesn't display the data for complex type, as it is not getting parsed .

      It throws error

      Type not found "RMTSAMPLEFLIGHT.FlightDetails"

       

       

      After looking at the translator code at ODataEntitySchemaBuilder.java , I didn't find any code where buildEntityTypes(schema, edmSchemas) handles complex data type.

      I am trying to make changes there.

      I am able to define the EdmComplexType information inside the schema

      but I am stuck at a point where I need to define the EdmProperty for this complex type inside a entity type

      example

      <EntityType Name="Flight" sap:content-version="1">

      <Property Name="flightDetails" Type="RMTSAMPLEFLIGHT.FlightDetails" Nullable="false"/>

      <Property Name="carrid" Type="Edm.String" Nullable="false" MaxLength="3" sap:label="Airline"/>

      <Property Name="connid" Type="Edm.String" Nullable="false" MaxLength="4" sap:label="Flight Number"/>

      <Property Name="fldate" Type="Edm.DateTime" Nullable="false" sap:label="Date"/>


      How can I set the complex type information for EdmProperty.

      Please help me in this regard.

       

      Thanks

      Amit

        • 1. Re: Data Not getting parsed for complex type in Odata
          Steven Hawkins Master

          Amit,

           

          Can you include the full stack for the exception to understand your scenario more fully?  I'm assuming that you are referring to the odata translator correct?  The complex handling that is currently there will inline the simple type properties of the complex type on the parent entity at import time - see ODataMetadataProcessor.addEntitySetAsTable.

           

          Steve

          • 2. Re: Data Not getting parsed for complex type in Odata
            Amit Singh Newbie

            This is the complete stack trace

             

            This is the query got formed in the get request

             

            https://sapes1.sapdevcenter.com/sap/opu/odata/IWFND/RMTSAMPLEFLIGHT/FlightCollection?$select=flightDetails,carrid,connid…

             

            Our VDB contains the schema for FlightCollection

             

            INFO   | jvm 1| 2015/06/17 12:31:52 | ERROR [CONNECTOR] Connector worker process failed for atomic-request=2jgzU5YTAky/.0.0.0
            INFO   | jvm 1| 2015/06/17 12:31:52 | java.lang.RuntimeException: unknown property type: RMTSAMPLEFLIGHT.FlightDetails
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.odata4j.format.xml.AtomFeedFormatParser.parseProperties(AtomFeedFormatParser.java:210) ~[odata4j-core-0.8.0-SNAPSHOT-redhat.jar:na]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.odata4j.format.xml.AtomFeedFormatParser.parseDSAtomEntry(AtomFeedFormatParser.java:272) ~[odata4j-core-0.8.0-SNAPSHOT-redhat.jar:na]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.odata4j.format.xml.AtomFeedFormatParser.parseEntry(AtomFeedFormatParser.java:382) ~[odata4j-core-0.8.0-SNAPSHOT-redhat.jar:na]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.odata4j.format.xml.AtomFeedFormatParser.parseFeed(AtomFeedFormatParser.java:168) ~[odata4j-core-0.8.0-SNAPSHOT-redhat.jar:na]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.odata4j.format.xml.AtomFeedFormatParser.parse(AtomFeedFormatParser.java:156) ~[odata4j-core-0.8.0-SNAPSHOT-redhat.jar:na]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.odata4j.format.xml.AtomFeedFormatParser.parse(AtomFeedFormatParser.java:44) ~[odata4j-core-0.8.0-SNAPSHOT-redhat.jar:na]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.teiid.translator.odata.BaseQueryExecution.parse(BaseQueryExecution.java:91) ~[translator-odata-8.10.0.Final.jar:na]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.teiid.translator.odata.BaseQueryExecution.executeWithReturnEntity(BaseQueryExecution.java:123) ~[translator-odata-8.10.0.Final.jar:na]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.teiid.translator.odata.ODataQueryExecution.execute(ODataQueryExecution.java:92) ~[translator-odata-8.10.0.Final.jar:na]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:337) ~[teiid-engine-8.10.0.Final.jar:8.10.0.Final]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:209) [teiid-engine-8.10.0.Final.jar:8.10.0.Final]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at com.sun.proxy.$Proxy233.execute(Unknown Source) [na:na]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:298) [teiid-engine-8.10.0.Final.jar:8.10.0.Final]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:110) [teiid-engine-8.10.0.Final.jar:8.10.0.Final]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:107) [teiid-engine-8.10.0.Final.jar:8.10.0.Final]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_45]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:58) [teiid-engine-8.10.0.Final.jar:8.10.0.Final]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276) [teiid-engine-8.10.0.Final.jar:8.10.0.Final]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) [teiid-engine-8.10.0.Final.jar:8.10.0.Final]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210) [teiid-engine-8.10.0.Final.jar:8.10.0.Final]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_45]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_45]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at java.lang.Thread.run(Thread.java:745) [na:1.8.0_45]
            INFO   | jvm 1| 2015/06/17 12:31:52 | ERROR [PROCESSOR] TEIID30019 Unexpected exception for request 2jgzU5YTAky/.0
            INFO   | jvm 1| 2015/06/17 12:31:52 | java.lang.RuntimeException: unknown property type: RMTSAMPLEFLIGHT.FlightDetails
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.odata4j.format.xml.AtomFeedFormatParser.parseProperties(AtomFeedFormatParser.java:210) ~[odata4j-core-0.8.0-SNAPSHOT-redhat.jar:na]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.odata4j.format.xml.AtomFeedFormatParser.parseDSAtomEntry(AtomFeedFormatParser.java:272) ~[odata4j-core-0.8.0-SNAPSHOT-redhat.jar:na]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.odata4j.format.xml.AtomFeedFormatParser.parseEntry(AtomFeedFormatParser.java:382) ~[odata4j-core-0.8.0-SNAPSHOT-redhat.jar:na]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.odata4j.format.xml.AtomFeedFormatParser.parseFeed(AtomFeedFormatParser.java:168) ~[odata4j-core-0.8.0-SNAPSHOT-redhat.jar:na]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.odata4j.format.xml.AtomFeedFormatParser.parse(AtomFeedFormatParser.java:156) ~[odata4j-core-0.8.0-SNAPSHOT-redhat.jar:na]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.odata4j.format.xml.AtomFeedFormatParser.parse(AtomFeedFormatParser.java:44) ~[odata4j-core-0.8.0-SNAPSHOT-redhat.jar:na]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.teiid.translator.odata.BaseQueryExecution.parse(BaseQueryExecution.java:91) ~[translator-odata-8.10.0.Final.jar:na]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.teiid.translator.odata.BaseQueryExecution.executeWithReturnEntity(BaseQueryExecution.java:123) ~[translator-odata-8.10.0.Final.jar:na]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.teiid.translator.odata.ODataQueryExecution.execute(ODataQueryExecution.java:92) ~[translator-odata-8.10.0.Final.jar:na]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:337) ~[teiid-engine-8.10.0.Final.jar:8.10.0.Final]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:209) ~[teiid-engine-8.10.0.Final.jar:8.10.0.Final]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at com.sun.proxy.$Proxy233.execute(Unknown Source) ~[na:na]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:298) ~[teiid-engine-8.10.0.Final.jar:8.10.0.Final]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:110) ~[teiid-engine-8.10.0.Final.jar:8.10.0.Final]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:107) ~[teiid-engine-8.10.0.Final.jar:8.10.0.Final]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_45]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:58) ~[teiid-engine-8.10.0.Final.jar:8.10.0.Final]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276) ~[teiid-engine-8.10.0.Final.jar:8.10.0.Final]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) ~[teiid-engine-8.10.0.Final.jar:8.10.0.Final]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210) ~[teiid-engine-8.10.0.Final.jar:8.10.0.Final]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_45]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_45]
            INFO   | jvm 1| 2015/06/17 12:31:52 |     at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_45]
            • 3. Re: Data Not getting parsed for complex type in Odata
              Steven Hawkins Master

              Yes, now I agree that the handling is not there.  Can you log an issue for this?

              • 5. Re: Data Not getting parsed for complex type in Odata
                Amit Singh Newbie

                Hi Steven,

                 

                Thanks For raising the issue.

                 

                After realizing the above issue , I went ahead and made changed to ODataEntitySchemaBuilder.java to include the complex type as part of the schema. With those changes I was able to parse the output and there were no error, though it got failed later while creating the ODataEntitiesResponse from the feed..

                 

                Below is the exception trace.

                 

                INFO   | jvm 1| 2015/06/17 01:23:46 | WARN  [CONNECTOR] TEIID30004 Connector returned a 0 row non-last batch: custom-test-sap-nw-gateway.
                INFO   | jvm 1| 2015/06/17 01:23:46 | WARN  [CONNECTOR] Connector worker process failed for atomic-request=1IlPVr2nJGQV.0.0.0
                INFO   | jvm 1| 2015/06/17 01:23:46 | org.teiid.core.types.TransformationException: TEIID10076 Invalid conversion from type class java.lang.Object with value '[OProperty[countryFrom,EdmSimpleType[Edm.String],US], OProperty[cityFrom,EdmSimpleType[Edm.String],new york], OProperty[airportFrom,EdmSimpleType[Edm.String],JFK], OProperty[countryTo,EdmSimpleType[Edm.String],US], OProperty[cityTo,EdmSimpleType[Edm.String],SAN FRANCISCO], OProperty[airportTo,EdmSimpleType[Edm.String],SFO], OProperty[flightTime,EdmSimpleType[Edm.String],361], OProperty[departureTime,EdmSimpleType[Edm.Time],11:00:00.000], OProperty[arrivalTime,EdmSimpleType[Edm.Time],14:01:00.000], OProperty[distance,EdmSimpleType[Edm.Decimal],2572.0000], OProperty[distanceUnit,EdmSimpleType[Edm.String],SMI], OProperty[flightType,EdmSimpleType[Edm.String],], OProperty[period,EdmSimpleType[Edm.Int16],0]]' to type class java.lang.Integer
                INFO   | jvm 1| 2015/06/17 01:23:46 |     at org.teiid.core.types.basic.ObjectToAnyTransform.transform(ObjectToAnyTransform.java:111) ~[sdf-jdbc-SNAPSHOT.jar:SNAPSHOT]
                INFO   | jvm 1| 2015/06/17 01:23:46 |     at org.teiid.core.types.DataTypeManager.transformValue(DataTypeManager.java:941) ~[sdf-jdbc-SNAPSHOT.jar:SNAPSHOT]
                INFO   | jvm 1| 2015/06/17 01:23:46 |     at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.correctTypes(ConnectorWorkItem.java:538) ~[teiid-engine-8.10.0.Final.jar:8.10.0.Final]
                INFO   | jvm 1| 2015/06/17 01:23:46 |     at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.handleBatch(ConnectorWorkItem.java:405) ~[teiid-engine-8.10.0.Final.jar:8.10.0.Final]
                INFO   | jvm 1| 2015/06/17 01:23:46 |     at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.more(ConnectorWorkItem.java:214) ~[teiid-engine-8.10.0.Final.jar:8.10.0.Final]
                INFO   | jvm 1| 2015/06/17 01:23:46 |     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
                INFO   | jvm 1| 2015/06/17 01:23:46 |     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
                INFO   | jvm 1| 2015/06/17 01:23:46 |     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
                INFO   | jvm 1| 2015/06/17 01:23:46 |     at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
                INFO   | jvm 1| 2015/06/17 01:23:46 |     at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:209) [teiid-engine-8.10.0.Final.jar:8.10.0.Final]
                INFO   | jvm 1| 2015/06/17 01:23:46 |     at com.sun.proxy.$Proxy233.more(Unknown Source) [na:na]
                INFO   | jvm 1| 2015/06/17 01:23:46 |     at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:301) [teiid-engine-8.10.0.Final.jar:8.10.0.Final]
                INFO   | jvm 1| 2015/06/17 01:23:46 |     at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:110) [teiid-engine-8.10.0.Final.jar:8.10.0.Final]
                INFO   | jvm 1| 2015/06/17 01:23:46 |     at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:107) [teiid-engine-8.10.0.Final.jar:8.10.0.Final]
                INFO   | jvm 1| 2015/06/17 01:23:46 |     at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_45]
                INFO   | jvm 1| 2015/06/17 01:23:46 |     at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:58) [teiid-engine-8.10.0.Final.jar:8.10.0.Final]
                INFO   | jvm 1| 2015/06/17 01:23:46 |     at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276) [teiid-engine-8.10.0.Final.jar:8.10.0.Final]
                INFO   | jvm 1| 2015/06/17 01:23:46 |     at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) [teiid-engine-8.10.0.Final.jar:8.10.0.Final]
                INFO   | jvm 1| 2015/06/17 01:23:46 |     at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210) [teiid-engine-8.10.0.Final.jar:8.10.0.Final]
                INFO   | jvm 1| 2015/06/17 01:23:46 |     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_45]
                INFO   | jvm 1| 2015/06/17 01:23:46 |     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_45]
                INFO   | jvm 1| 2015/06/17 01:23:46 |     at java.lang.Thread.run(Thread.java:745) [na:1.8.0_45]
                INFO   | jvm 1| 2015/06/17 01:23:46 | WARN  [PROCESSOR] TEIID30020 Processing exception for request 1IlPVr2nJGQV.0 'TEIID10076 Invalid conversion from type class java.lang.Object with value '[OProperty[countryFrom,EdmSimpleType[Edm.String],US], OProperty[cityFrom,EdmSimpleType[Edm.String],new york], OProperty[airportFrom,EdmSimpleType[Edm.String],JFK], OProperty[countryTo,EdmSimpleType[Edm.String],US], OProperty[cityTo,EdmSimpleType[Edm.String],SAN FRANCISCO], OProperty[airportTo,EdmSimpleType[Edm.String],SFO], OProperty[flightTime,EdmSimpleType[Edm.String],361], OProperty[departureTime,EdmSimpleType[Edm.Time],11:00:00.000], OProperty[arrivalTime,EdmSimpleType[Edm.Time],14:01:00.000], OProperty[distance,EdmSimpleType[Edm.Decimal],2572.0000], OProperty[distanceUnit,EdmSimpleType[Edm.String],SMI], OProperty[flightType,EdmSimpleType[Edm.String],], OProperty[period,EdmSimpleType[Edm.Int16],0]]' to type class java.lang.Integer'. Originally TransformationException ObjectToAnyTransform.java:111. Enable more detailed logging to see the entire stacktrace.

                 

                Let me know if this is the same issue as reported https://issues.jboss.org/browse/TEIID-3436.

                 

                Thanks

                Amit

                • 6. Re: Data Not getting parsed for complex type in Odata
                  Steven Hawkins Master

                  > Let me know if this is the same issue as reported https://issues.jboss.org/browse/TEIID-3436.

                   

                  It would depend on the scope of the changes you made.  TEIID-3436 prevents collection properties on tables from being read as arrays.

                   

                  Also can you try using the changes from TEIID-3543?

                  • 7. Re: Data Not getting parsed for complex type in Odata
                    Amit Singh Newbie

                    After taking the changes from TEIID-3543, it throwing the same exception.

                     

                    While debugging we noticed

                    complexTypeBuilder.setNamespace(schema.getName()); 


                    Its not setting the proper value.

                    • 8. Re: Data Not getting parsed for complex type in Odata
                      Steven Hawkins Master

                      It would probably be best to be in synch with a released version and open an issue with the particular scenario details.

                       

                      in this case the setNamespace call is to the schema as all of the full name of the complex type is set as the complextype property.  The lookup logic will compensate for that.

                      • 9. Re: Data Not getting parsed for complex type in Odata
                        Amit Singh Newbie

                        I have synched the code with 8.11 version and the problem related to ComplexType is resolved.

                        But while retrieving data select * from FlightCollection

                        It throws a different exception .

                         

                         

                        jvm 1| WARN  [CONNECTOR] TEIID30004 Connector returned a 0 row non-last batch: 16d79382-a82d-49ff-b3a6-7e124c57a3fb-newSAPDEMO

                        -sap-nw-gateway.

                        jvm 1| WARN  [CONNECTOR] Connector worker process failed for atomic-request=QohLkY/LIX3m.0.1.1
                        jvm 1| org.teiid.core.types.TransformationException: TEIID10068 Failed to transform String to Time.  Expected format = hh:mm:s

                        s for PT11H00M00S

                        jvm 1at org.teiid.core.types.basic.StringToTimeTransform.transformDirect(StringToTimeTransform.java:64) ~[sdf-jdbc-SNAP

                        SHOT.jar:SNAPSHOT]

                        jvm 1at org.teiid.core.types.Transform.transform(Transform.java:47) ~[sdf-jdbc-SNAPSHOT.jar:SNAPSHOT]
                        jvm 1at org.teiid.core.types.DataTypeManager.transformValue(DataTypeManager.java:942) ~[sdf-jdbc-SNAPSHOT.jar:SNAPSHOT]

                         

                        jvm 1at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.correctTypes(ConnectorWorkItem.java:551) ~[teiid-engine-8.11.2

                        .jar:8.11.2]

                        jvm 1at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.handleBatch(ConnectorWorkItem.java:418) ~[teiid-engine-8.11.2.

                        jar:8.11.2]

                        jvm 1at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.more(ConnectorWorkItem.java:215) ~[teiid-engine-8.11.2.jar:8.1

                        1.2]

                        jvm 1at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
                        jvm 1at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
                        jvm 1at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
                        jvm 1at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
                        jvm 1at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211) [teiid-engine-8.11.2.jar:8.

                        11.2]

                        jvm 1at com.sun.proxy.$Proxy234.more(Unknown Source) [na:na]
                        jvm 1at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:301) [teiid-engine-8.11.

                        2.jar:8.11.2]

                        jvm 1at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:110) [teiid-engine-8.11.2.ja

                        r:8.11.2]

                        jvm 1at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:107) [teiid-engine-8.11.2.ja

                        r:8.11.2]

                        jvm 1at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_45]
                        jvm 1at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:58) [teiid-engine-8.11.2.jar:8.11.2]
                        jvm 1at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276) [teiid-engine-8.11.2.jar:8.

                        11.2]

                        jvm 1at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) [teiid-eng

                        ine-8.11.2.jar:8.11.2]

                        jvm 1at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210) [teiid-engine-8.11.2.jar

                        :8.11.2]

                        jvm 1at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_45]
                        jvm 1at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_45]
                        jvm 1at java.lang.Thread.run(Thread.java:745) [na:1.8.0_45]
                        jvm 1| Caused by: java.lang.IllegalArgumentException: null
                        jvm 1at java.sql.Time.valueOf(Time.java:110) ~[na:1.8.0_45]
                        jvm 1at org.teiid.core.types.basic.StringToTimeTransform.transformDirect(StringToTimeTransform.java:59) ~[sdf-jdbc-SNAP

                        SHOT.jar:SNAPSHOT]

                        jvm 1... 22 common frames omitted
                        jvm 1| WARN  [PROCESSOR] TEIID30020 Processing exception for request QohLkY/LIX3m.0 'TEIID10068 Failed to transform String to

                        Time.  Expected format = hh:mm:ss for PT11H00M00S'. Originally TransformationException Time.java:110. Enable more detailed logging

                        to see the entire stacktrace.

                        • 10. Re: Data Not getting parsed for complex type in Odata
                          Ramesh Reddy Master

                          Amit,

                           

                          The type returned and type configured as target type on source model are not matching. The issue is Teiid is fails to recognize "PT11H00M00S" as time, I remember seeing this before but could not find any references to it in OData V2 specification for Time format. To debug, issue $metadata call directly (with out using Teiid) figure out what is this column designed as, then issue the data call directly and make sure it matches with what is been defined by the OData spec. Otherwise you can configure this as string, so that translation does not happen.

                           

                          Ramesh..

                          • 11. Re: Data Not getting parsed for complex type in Odata
                            Amit Singh Newbie

                            Yes ,

                             

                            SAP actually passes value in Duration Data Type(PT11H00M00S) for  Edm.Time , and that's why the mismatch is happening.

                            • 12. Re: Data Not getting parsed for complex type in Odata
                              Ramesh Reddy Master

                              Amit,

                               

                              The above value describes pattern of "Edm.Duration" type from OData V4 specification. There is no "Edm.Duration" in OData V2 specification thus you are seeing the above error. Are you sure the SAP service is V2 complaint? There should be an header parameter specifying the OData version in the response, please check that. The Teiid translator you are using is written for OData V2.

                               

                              Alternative is treat like that data type as string.

                               

                              Ramesh..