This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1259736 - (TEIID-3671) Odata filter on child table not working correctly
Odata filter on child table not working correctly
Product: JBoss Data Virtualization 6
Classification: JBoss
Component: Teiid (Show other bugs)
Unspecified Unspecified
high Severity high
: ---
: ---
Assigned To: jolee
Filip Elias
: QA-Closed
Depends On:
Blocks: 1241696
  Show dependency treegraph
Reported: 2015-09-03 09:01 EDT by dsteigne
Modified: 2016-02-10 03:50 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Odata filters do not work correctly on child tables, hence filter results may sometimes be inaccurate.
Story Points: ---
Clone Of:
Last Closed: 2016-02-10 03:50:21 EST
Type: Support Patch
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
dynamic vdb w/details in comment (2.95 KB, application/xml)
2015-10-23 09:17 EDT, jolee
no flags Details
used for local testing (4.93 KB, application/xml)
2015-10-23 16:19 EDT, jolee
no flags Details

External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker TEIID-3671 Critical Closed filter on child table not working 2016-08-09 01:15 EDT
Red Hat Knowledge Base (Solution) 1599793 None None None Never

  None (edit)
Description dsteigne 2015-09-03 09:01:55 EDT
Describe the issue: 

the url - //localhost:8080/odata/testVDB/sales('13')/sales_uk?$format=json, i get the results from sales_uk table which are having id=13.

Now i am trying to apply a filter on this url, i am supposed to get results which are having id=13 and satisfy the filter condition, but this url blindly returns me data from sales_uk table which satisfy the filter condition. URL- //localhost:8080/odata/testVDB/sales('13')/sales_uk?$format=json&$filter=DISCOUNT eq '22'

Suggestions for improvement: 

Additional information:
Comment 2 jolee 2015-09-16 11:43:13 EDT : 8.7.x-prod-ipv6.1 : 62b86a878 : 8.7.x : 62b86a878
Comment 3 dsteigne 2015-10-14 11:28:24 EDT
The fix for this broke the existing work flow of Parent-child tables relationship. 
I was getting Nullpointer exception for the base urls , 'filter for child table not working' is not solved.
11:36:18,353 WARN  [org.teiid.ODATA] (http-/ TEIID16012 Could not produce a successful OData response.  Returning status ServerErrorException with message Internal Server Error.: org.odata4j.exceptions.ServerErrorException
	at org.teiid.odata.LocalClient.executeSQL( [classes:]
	at org.teiid.odata.TeiidProducer.getNavProperty( [classes:]
	at org.teiid.odata.TeiidProducer.getNavProperty( [classes:]
	at org.odata4j.producer.resources.PropertyRequestResource.getNavProperty( [odata-core-0.8.7.redhat-61-1.jar:0.8.7.redhat-61-1]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_75]
	at sun.reflect.NativeMethodAccessorImpl.invoke( [rt.jar:1.7.0_75]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke( [rt.jar:1.7.0_75]
	at java.lang.reflect.Method.invoke( [rt.jar:1.7.0_75]
	at org.jboss.resteasy.core.MethodInjectorImpl.invoke( [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]
	at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget( [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]
	at org.jboss.resteasy.core.ResourceMethod.invoke( [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]
	at org.jboss.resteasy.core.ResourceLocator.invokeOnTargetObject( [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]
	at org.jboss.resteasy.core.ResourceLocator.invoke( [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]
	at org.jboss.resteasy.core.SynchronousDispatcher.getResponse( [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke( [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke( [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]
	at org.teiid.odata.ODataServletContainerDispatcher.service( [classes:]
	at org.teiid.odata.ODataServlet.service( [classes:]
	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service( [resteasy-jaxrs-2.3.8.SP4-redhat-2.jar:]
	at javax.servlet.http.HttpServlet.service( [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-1.jar:1.0.2.Final-redhat-1]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter( [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
	at org.apache.catalina.core.StandardWrapperValve.invoke( [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
	at org.apache.catalina.core.StandardContextValve.invoke( [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke( [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
	at [jboss-as-web-7.4.3.Final-redhat-2.jar:7.4.3.Final-redhat-2]
	at org.apache.catalina.core.StandardHostValve.invoke( [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
	at org.apache.catalina.valves.ErrorReportValve.invoke( [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
	at org.apache.catalina.core.StandardEngineValve.invoke( [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
	at org.apache.catalina.connector.CoyoteAdapter.service( [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
	at org.apache.coyote.http11.Http11Processor.process( [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process( [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
	at$ [jbossweb-7.4.10.Final-redhat-1.jar:7.4.10.Final-redhat-1]
	at [rt.jar:1.7.0_75]
Caused by: java.lang.NullPointerException
	at org.teiid.odata.EntityList.getEntity( [classes:]
	at org.teiid.odata.EntityList.addEntity( [classes:]
	at org.teiid.odata.LocalClient.executeSQL( [classes:]
	... 33 more
Comment 4 JBoss JIRA Server 2015-10-20 04:52:34 EDT
Juraj Duráni <> updated the status of jira TEIID-3671 to Reopened
Comment 7 jolee 2015-10-23 09:17 EDT
Created attachment 1085846 [details]
dynamic vdb w/details in comment

I seem to be getting a close variation of the results that Jurag and Debbie have seen,  I will use it to vet proposed changes unless someone points out a discrepancy that should be addressed.
Comment 9 jolee 2015-10-23 15:58:29 EDT : 8.7.x-prod-ipv6.1 : 184a1f2 : 8.7.x : 184a1f2
Comment 10 jolee 2015-10-23 16:19 EDT
Created attachment 1085929 [details]
used for local testing

just updating as last file had issues which were troublesome to track down (TEIID-3787)
Comment 11 Juraj Duráni 2015-10-30 02:29:53 EDT
Both, old and new, issues has been verified in the rebuild. Setting to VERIFIED.
Comment 12 JBoss JIRA Server 2015-10-30 09:59:31 EDT
Steven Hawkins <> updated the status of jira TEIID-3671 to Resolved
Comment 13 JBoss JIRA Server 2015-10-30 09:59:38 EDT
Steven Hawkins <> updated the status of jira TEIID-3671 to Closed

Note You need to log in before you can comment on or make changes to this bug.